From e9b12a50a010df72992b97be71eb628d458ba20f Mon Sep 17 00:00:00 2001 From: maciej-nedza <76946708+maciej-nedza@users.noreply.github.com> Date: Fri, 13 Dec 2024 16:14:38 +0100 Subject: [PATCH] [DE-1091] Release 6.0.0 (#54) --- README.md | 96 +++--- advancedbilling/advanced_billing_client.py | 7 +- advancedbilling/configuration.py | 50 ++-- .../controllers/advance_invoice_controller.py | 6 +- .../controllers/api_exports_controller.py | 18 +- .../controllers/base_controller.py | 2 +- .../controllers/billing_portal_controller.py | 8 +- .../component_price_points_controller.py | 36 ++- .../controllers/components_controller.py | 24 +- .../controllers/coupons_controller.py | 67 +++-- .../controllers/custom_fields_controller.py | 18 +- .../controllers/customers_controller.py | 14 +- ...vents_based_billing_segments_controller.py | 12 +- .../controllers/events_controller.py | 35 ++- .../controllers/insights_controller.py | 8 +- .../controllers/invoices_controller.py | 34 +-- .../controllers/offers_controller.py | 12 +- .../payment_profiles_controller.py | 24 +- .../product_families_controller.py | 36 +-- .../product_price_points_controller.py | 27 +- .../controllers/products_controller.py | 12 +- .../proforma_invoices_controller.py | 18 +- .../controllers/reason_codes_controller.py | 18 +- .../controllers/referral_codes_controller.py | 2 +- .../sales_commissions_controller.py | 6 +- .../controllers/sites_controller.py | 6 +- .../subscription_components_controller.py | 56 ++-- ...iption_group_invoice_account_controller.py | 8 +- .../subscription_group_status_controller.py | 8 +- .../subscription_groups_controller.py | 18 +- ...subscription_invoice_account_controller.py | 12 +- .../subscription_notes_controller.py | 14 +- .../subscription_products_controller.py | 4 +- .../subscription_status_controller.py | 22 +- .../controllers/subscriptions_controller.py | 51 +++- .../controllers/webhooks_controller.py | 12 +- advancedbilling/exceptions/__init__.py | 1 + .../subscription_response_error_exception.py | 39 +++ advancedbilling/models/__init__.py | 17 +- advancedbilling/models/account_balance.py | 14 +- advancedbilling/models/account_balances.py | 14 +- advancedbilling/models/ach_agreement.py | 14 +- .../models/activate_event_based_component.py | 14 +- .../models/activate_subscription_request.py | 14 +- advancedbilling/models/add_coupons_request.py | 14 +- .../models/add_subscription_to_a_group.py | 20 +- advancedbilling/models/address_change.py | 14 +- .../models/agreement_acceptance.py | 14 +- advancedbilling/models/all_vaults.py | 2 + advancedbilling/models/allocate_components.py | 14 +- advancedbilling/models/allocation.py | 14 +- .../models/allocation_expiration_date.py | 14 +- advancedbilling/models/allocation_preview.py | 14 +- .../models/allocation_preview_direction.py | 2 + .../models/allocation_preview_item.py | 14 +- .../models/allocation_preview_line_item.py | 14 +- .../allocation_preview_line_item_kind.py | 2 + .../models/allocation_preview_response.py | 14 +- advancedbilling/models/allocation_response.py | 14 +- advancedbilling/models/allocation_settings.py | 14 +- .../models/apple_pay_payment_profile.py | 14 +- advancedbilling/models/apple_pay_vault.py | 2 + .../models/applied_credit_note_data.py | 14 +- .../models/apply_credit_note_event.py | 14 +- .../models/apply_credit_note_event_data.py | 14 +- .../models/apply_debit_note_event.py | 14 +- .../models/apply_debit_note_event_data.py | 14 +- advancedbilling/models/apply_payment_event.py | 14 +- .../models/apply_payment_event_data.py | 14 +- advancedbilling/models/attribute_error.py | 14 +- advancedbilling/models/auto_invite.py | 2 + advancedbilling/models/auto_resume.py | 14 +- .../models/backport_invoice_event.py | 14 +- .../models/bank_account_attributes.py | 14 +- .../models/bank_account_holder_type.py | 2 + .../models/bank_account_payment_profile.py | 14 +- .../models/bank_account_response.py | 14 +- advancedbilling/models/bank_account_type.py | 2 + advancedbilling/models/bank_account_vault.py | 2 + .../models/bank_account_verification.py | 14 +- .../bank_account_verification_request.py | 14 +- advancedbilling/models/base_refund_error.py | 14 +- advancedbilling/models/base_string_error.py | 14 +- advancedbilling/models/basic_date_field.py | 2 + advancedbilling/models/batch_job.py | 14 +- advancedbilling/models/batch_job_response.py | 14 +- advancedbilling/models/billing_manifest.py | 14 +- .../models/billing_manifest_item.py | 14 +- .../models/billing_manifest_line_item_kind.py | 2 + advancedbilling/models/billing_schedule.py | 14 +- advancedbilling/models/breakouts.py | 14 +- .../bulk_components_price_point_assignment.py | 14 +- ...ulk_create_product_price_points_request.py | 14 +- ...lk_create_product_price_points_response.py | 14 +- .../models/bulk_create_segments.py | 14 +- .../models/bulk_update_segments.py | 14 +- .../models/bulk_update_segments_item.py | 14 +- advancedbilling/models/calendar_billing.py | 14 +- .../cancel_grouped_subscriptions_request.py | 14 +- advancedbilling/models/cancellation_method.py | 2 + .../models/cancellation_options.py | 14 +- .../models/cancellation_request.py | 14 +- advancedbilling/models/card_type.py | 2 + .../models/change_chargeback_status_event.py | 14 +- .../change_chargeback_status_event_data.py | 14 +- .../change_invoice_collection_method_event.py | 14 +- ...ge_invoice_collection_method_event_data.py | 14 +- .../models/change_invoice_status_event.py | 14 +- .../change_invoice_status_event_data.py | 14 +- advancedbilling/models/chargeback_status.py | 2 + advancedbilling/models/chargify_ebb.py | 14 +- advancedbilling/models/cleanup_scope.py | 2 + advancedbilling/models/collection_method.py | 2 + advancedbilling/models/component.py | 19 +- .../models/component_allocation_change.py | 14 +- .../models/component_allocation_error_item.py | 14 +- advancedbilling/models/component_cost_data.py | 14 +- .../models/component_cost_data_rate_tier.py | 14 +- .../models/component_currency_price.py | 14 +- .../component_currency_prices_response.py | 14 +- .../models/component_custom_price.py | 14 +- advancedbilling/models/component_kind.py | 2 + advancedbilling/models/component_price.py | 14 +- .../models/component_price_point.py | 82 ++++- .../component_price_point_assignment.py | 14 +- .../component_price_point_error_item.py | 14 +- .../models/component_price_point_item.py | 14 +- .../models/component_price_point_response.py | 14 +- .../models/component_price_points_response.py | 14 +- advancedbilling/models/component_response.py | 14 +- .../models/compounding_strategy.py | 8 +- .../models/consolidated_invoice.py | 14 +- advancedbilling/models/count_response.py | 14 +- advancedbilling/models/coupon.py | 50 +++- advancedbilling/models/coupon_currency.py | 25 +- .../models/coupon_currency_request.py | 14 +- .../models/coupon_currency_response.py | 14 +- ...percentage_coupon.py => coupon_payload.py} | 131 ++++---- ..._or_update_coupon.py => coupon_request.py} | 28 +- advancedbilling/models/coupon_response.py | 14 +- advancedbilling/models/coupon_restriction.py | 14 +- advancedbilling/models/coupon_subcodes.py | 14 +- .../models/coupon_subcodes_response.py | 14 +- advancedbilling/models/coupon_usage.py | 14 +- advancedbilling/models/create_allocation.py | 14 +- .../models/create_allocation_request.py | 14 +- .../models/create_component_price_point.py | 20 +- .../create_component_price_point_request.py | 14 +- .../create_component_price_points_request.py | 14 +- .../models/create_credit_note_event.py | 14 +- .../models/create_currency_price.py | 14 +- .../models/create_currency_prices_request.py | 14 +- advancedbilling/models/create_customer.py | 14 +- .../models/create_customer_request.py | 14 +- .../models/create_debit_note_event.py | 14 +- .../models/create_ebb_component.py | 14 +- advancedbilling/models/create_invoice.py | 14 +- .../models/create_invoice_address.py | 14 +- .../models/create_invoice_coupon.py | 22 +- advancedbilling/models/create_invoice_item.py | 14 +- .../models/create_invoice_payment.py | 14 +- .../create_invoice_payment_application.py | 14 +- .../models/create_invoice_payment_request.py | 14 +- .../models/create_invoice_request.py | 14 +- .../models/create_invoice_status.py | 2 + advancedbilling/models/create_metadata.py | 14 +- .../models/create_metadata_request.py | 14 +- advancedbilling/models/create_metafield.py | 14 +- .../models/create_metafields_request.py | 14 +- .../models/create_metered_component.py | 14 +- .../models/create_multi_invoice_payment.py | 14 +- .../create_multi_invoice_payment_request.py | 14 +- advancedbilling/models/create_offer.py | 14 +- .../models/create_offer_component.py | 14 +- .../models/create_offer_request.py | 14 +- .../models/create_on_off_component.py | 14 +- .../models/create_or_update_endpoint.py | 14 +- .../create_or_update_endpoint_request.py | 14 +- .../create_or_update_flat_amount_coupon.py | 195 ------------ .../models/create_or_update_product.py | 14 +- .../create_or_update_product_request.py | 14 +- .../models/create_or_update_segment_price.py | 14 +- advancedbilling/models/create_payment.py | 14 +- .../models/create_payment_profile.py | 14 +- .../models/create_payment_profile_request.py | 14 +- .../models/create_prepaid_component.py | 14 +- ...ate_prepaid_usage_component_price_point.py | 32 +- advancedbilling/models/create_prepayment.py | 14 +- .../models/create_prepayment_method.py | 2 + .../models/create_prepayment_request.py | 14 +- .../models/create_prepayment_response.py | 14 +- .../models/create_product_currency_price.py | 14 +- .../create_product_currency_prices_request.py | 14 +- .../models/create_product_family.py | 14 +- .../models/create_product_family_request.py | 14 +- .../models/create_product_price_point.py | 14 +- .../create_product_price_point_request.py | 14 +- .../models/create_quantity_based_component.py | 14 +- advancedbilling/models/create_reason_code.py | 14 +- .../models/create_reason_code_request.py | 14 +- advancedbilling/models/create_segment.py | 14 +- .../models/create_segment_request.py | 14 +- .../create_signup_proforma_preview_include.py | 2 + advancedbilling/models/create_subscription.py | 15 +- .../models/create_subscription_component.py | 14 +- .../models/create_subscription_group.py | 14 +- .../create_subscription_group_request.py | 14 +- .../models/create_subscription_request.py | 14 +- advancedbilling/models/create_usage.py | 14 +- .../models/create_usage_request.py | 14 +- advancedbilling/models/created_prepayment.py | 14 +- .../models/credit_account_balance_changed.py | 14 +- .../models/credit_card_attributes.py | 14 +- .../models/credit_card_payment_profile.py | 14 +- advancedbilling/models/credit_card_vault.py | 2 + advancedbilling/models/credit_note.py | 14 +- .../models/credit_note_application.py | 14 +- .../models/credit_note_line_item.py | 14 +- advancedbilling/models/credit_note_status.py | 2 + advancedbilling/models/credit_scheme.py | 2 + .../models/credit_scheme_request.py | 14 +- advancedbilling/models/credit_type.py | 2 + advancedbilling/models/currency_price.py | 30 +- advancedbilling/models/currency_price_role.py | 2 + .../models/currency_prices_response.py | 14 +- advancedbilling/models/custom_field_owner.py | 2 + .../models/custom_field_value_change.py | 14 +- advancedbilling/models/customer.py | 14 +- advancedbilling/models/customer_attributes.py | 14 +- advancedbilling/models/customer_change.py | 14 +- .../customer_changes_preview_response.py | 14 +- .../models/customer_custom_fields_change.py | 14 +- advancedbilling/models/customer_error.py | 14 +- .../models/customer_payer_change.py | 14 +- advancedbilling/models/customer_response.py | 14 +- advancedbilling/models/debit_note.py | 14 +- advancedbilling/models/debit_note_role.py | 2 + advancedbilling/models/debit_note_status.py | 2 + .../models/deduct_service_credit.py | 14 +- .../models/deduct_service_credit_request.py | 14 +- .../models/delayed_cancellation_response.py | 14 +- .../delete_subscription_group_response.py | 14 +- advancedbilling/models/direction.py | 2 + advancedbilling/models/discount_type.py | 2 + advancedbilling/models/dunner_data.py | 14 +- advancedbilling/models/dunning_step_data.py | 14 +- .../models/dunning_step_reached.py | 14 +- advancedbilling/models/ebb_component.py | 52 +--- advancedbilling/models/ebb_event.py | 14 +- .../models/enable_webhooks_request.py | 14 +- .../models/enable_webhooks_response.py | 14 +- advancedbilling/models/endpoint.py | 14 +- advancedbilling/models/endpoint_response.py | 14 +- advancedbilling/models/errors.py | 14 +- advancedbilling/models/event.py | 89 +++++- .../event_based_billing_segment_error.py | 14 +- advancedbilling/models/event_key.py | 280 ++++++++++++++++++ advancedbilling/models/event_response.py | 14 +- advancedbilling/models/event_type.py | 123 -------- .../models/expiration_interval_unit.py | 2 + .../models/failed_payment_action.py | 2 + .../models/failed_payment_event.py | 14 +- .../models/failed_payment_event_data.py | 14 +- advancedbilling/models/first_charge_type.py | 2 + .../full_subscription_group_response.py | 14 +- .../get_one_time_token_payment_profile.py | 14 +- .../models/get_one_time_token_request.py | 14 +- advancedbilling/models/group_billing.py | 14 +- advancedbilling/models/group_settings.py | 14 +- advancedbilling/models/group_target.py | 14 +- advancedbilling/models/group_target_type.py | 2 + advancedbilling/models/group_type.py | 2 + advancedbilling/models/historic_usage.py | 14 +- advancedbilling/models/include_not_null.py | 2 + .../models/include_null_or_not_null.py | 2 + advancedbilling/models/include_option.py | 2 + advancedbilling/models/interval_unit.py | 2 + advancedbilling/models/invoice.py | 44 ++- advancedbilling/models/invoice_address.py | 14 +- .../models/invoice_avatax_details.py | 140 +++++++++ .../models/invoice_balance_item.py | 14 +- .../models/invoice_consolidation_level.py | 2 + advancedbilling/models/invoice_credit.py | 14 +- .../models/invoice_custom_field.py | 14 +- advancedbilling/models/invoice_customer.py | 14 +- advancedbilling/models/invoice_date_field.py | 2 + advancedbilling/models/invoice_debit.py | 150 ++++++++++ advancedbilling/models/invoice_discount.py | 14 +- .../models/invoice_discount_breakout.py | 14 +- .../models/invoice_discount_source_type.py | 2 + .../models/invoice_discount_type.py | 2 + .../models/invoice_display_settings.py | 14 +- .../models/invoice_event_payment_method.py | 2 + advancedbilling/models/invoice_event_type.py | 2 + advancedbilling/models/invoice_issued.py | 14 +- advancedbilling/models/invoice_line_item.py | 23 +- .../invoice_line_item_component_cost_data.py | 14 +- .../models/invoice_line_item_event_data.py | 14 +- .../invoice_line_item_pricing_detail.py | 14 +- advancedbilling/models/invoice_payer.py | 14 +- .../models/invoice_payer_change.py | 14 +- advancedbilling/models/invoice_payment.py | 14 +- .../models/invoice_payment_application.py | 14 +- .../models/invoice_payment_method.py | 14 +- .../models/invoice_payment_method_type.py | 2 + .../models/invoice_payment_type.py | 2 + advancedbilling/models/invoice_pre_payment.py | 14 +- .../models/invoice_previous_balance.py | 14 +- advancedbilling/models/invoice_refund.py | 14 +- advancedbilling/models/invoice_response.py | 14 +- advancedbilling/models/invoice_role.py | 2 + advancedbilling/models/invoice_seller.py | 14 +- advancedbilling/models/invoice_sort_field.py | 2 + advancedbilling/models/invoice_status.py | 7 +- advancedbilling/models/invoice_tax.py | 14 +- .../models/invoice_tax_breakout.py | 14 +- .../models/invoice_tax_component_breakout.py | 14 +- .../models/issue_advance_invoice_request.py | 14 +- advancedbilling/models/issue_invoice_event.py | 14 +- .../models/issue_invoice_event_data.py | 14 +- .../models/issue_invoice_request.py | 14 +- .../models/issue_service_credit.py | 14 +- .../models/issue_service_credit_request.py | 14 +- advancedbilling/models/item_category.py | 2 + .../models/item_price_point_changed.py | 14 +- .../models/item_price_point_data.py | 14 +- advancedbilling/models/line_item_kind.py | 2 + .../models/line_item_transaction_type.py | 2 + .../models/list_components_filter.py | 14 +- .../list_components_price_points_include.py | 2 + .../list_components_price_points_response.py | 14 +- advancedbilling/models/list_coupons_filter.py | 14 +- .../models/list_credit_notes_response.py | 14 +- .../models/list_events_date_field.py | 2 + .../models/list_invoice_events_response.py | 14 +- .../models/list_invoices_response.py | 14 +- .../models/list_metafields_response.py | 14 +- advancedbilling/models/list_mrr_filter.py | 14 +- advancedbilling/models/list_mrr_response.py | 14 +- .../models/list_mrr_response_result.py | 14 +- .../models/list_offers_response.py | 14 +- .../models/list_prepayment_date_field.py | 2 + .../models/list_prepayments_filter.py | 14 +- .../models/list_price_points_filter.py | 14 +- .../list_product_price_points_response.py | 14 +- .../models/list_products_filter.py | 14 +- .../models/list_products_include.py | 2 + .../list_products_price_points_include.py | 2 + .../models/list_proforma_invoices_meta.py | 14 +- .../models/list_proforma_invoices_response.py | 14 +- .../models/list_public_keys_meta.py | 14 +- .../models/list_public_keys_response.py | 14 +- advancedbilling/models/list_sale_rep_item.py | 14 +- .../models/list_segments_filter.py | 14 +- .../models/list_segments_response.py | 14 +- .../list_subcription_group_prepayment_item.py | 14 +- .../list_subscription_components_filter.py | 14 +- ...subscription_components_for_site_filter.py | 14 +- .../list_subscription_components_include.py | 2 + .../list_subscription_components_response.py | 14 +- .../list_subscription_components_sort.py | 2 + .../list_subscription_group_prepayment.py | 14 +- ..._subscription_group_prepayment_response.py | 14 +- .../models/list_subscription_groups_item.py | 14 +- .../models/list_subscription_groups_meta.py | 14 +- .../list_subscription_groups_response.py | 14 +- advancedbilling/models/metadata.py | 14 +- advancedbilling/models/metafield.py | 14 +- advancedbilling/models/metafield_input.py | 2 + advancedbilling/models/metafield_scope.py | 14 +- advancedbilling/models/metered_component.py | 46 +-- advancedbilling/models/metered_usage.py | 14 +- advancedbilling/models/movement.py | 14 +- advancedbilling/models/movement_line_item.py | 14 +- advancedbilling/models/mrr.py | 14 +- advancedbilling/models/mrr_movement.py | 14 +- advancedbilling/models/mrr_response.py | 14 +- .../models/multi_invoice_payment.py | 14 +- .../models/multi_invoice_payment_response.py | 14 +- .../models/nested_subscription_group.py | 14 +- advancedbilling/models/net_terms.py | 14 +- advancedbilling/models/offer.py | 14 +- advancedbilling/models/offer_discount.py | 14 +- advancedbilling/models/offer_item.py | 14 +- advancedbilling/models/offer_response.py | 14 +- advancedbilling/models/offer_signup_page.py | 14 +- ..._codes_json_response.py => ok_response.py} | 20 +- advancedbilling/models/on_off_component.py | 86 +++--- .../models/organization_address.py | 14 +- advancedbilling/models/origin_invoice.py | 14 +- advancedbilling/models/overage_pricing.py | 14 +- .../models/override_subscription.py | 14 +- .../models/override_subscription_request.py | 14 +- advancedbilling/models/paginated_metadata.py | 14 +- advancedbilling/models/paid_invoice.py | 14 +- advancedbilling/models/pause_request.py | 14 +- advancedbilling/models/pay_pal_vault.py | 2 + advancedbilling/models/payer_attributes.py | 14 +- advancedbilling/models/payer_error.py | 14 +- .../payment_collection_method_changed.py | 14 +- .../models/payment_for_allocation.py | 14 +- .../models/payment_method_apple_pay.py | 14 +- .../models/payment_method_bank_account.py | 14 +- .../models/payment_method_credit_card.py | 14 +- .../models/payment_method_external.py | 14 +- .../models/payment_method_paypal.py | 14 +- .../models/payment_profile_attributes.py | 14 +- .../models/payment_profile_response.py | 14 +- .../models/payment_related_events.py | 14 +- advancedbilling/models/payment_type.py | 2 + .../models/paypal_payment_profile.py | 14 +- .../models/pending_cancellation_change.py | 14 +- .../models/portal_management_link.py | 14 +- .../models/prepaid_component_price_point.py | 133 --------- .../models/prepaid_configuration.py | 14 +- .../models/prepaid_configuration_response.py | 14 +- .../prepaid_product_price_point_filter.py | 14 +- .../prepaid_subscription_balance_changed.py | 14 +- advancedbilling/models/prepaid_usage.py | 14 +- .../models/prepaid_usage_allocation_detail.py | 14 +- .../models/prepaid_usage_component.py | 60 ++-- advancedbilling/models/prepayment.py | 14 +- .../prepayment_account_balance_changed.py | 14 +- advancedbilling/models/prepayment_method.py | 2 + advancedbilling/models/prepayment_response.py | 14 +- .../models/prepayments_response.py | 14 +- .../models/preview_allocations_request.py | 14 +- advancedbilling/models/price.py | 14 +- advancedbilling/models/price_point_type.py | 2 + advancedbilling/models/pricing_scheme.py | 2 + advancedbilling/models/product.py | 14 +- advancedbilling/models/product_family.py | 14 +- .../models/product_family_response.py | 14 +- advancedbilling/models/product_price_point.py | 14 +- .../models/product_price_point_errors.py | 14 +- .../models/product_price_point_response.py | 14 +- advancedbilling/models/product_response.py | 14 +- advancedbilling/models/proforma_error.py | 14 +- advancedbilling/models/proforma_invoice.py | 14 +- .../models/proforma_invoice_credit.py | 14 +- .../models/proforma_invoice_discount.py | 14 +- .../proforma_invoice_discount_source_type.py | 2 + .../models/proforma_invoice_issued.py | 14 +- .../models/proforma_invoice_payment.py | 14 +- .../models/proforma_invoice_role.py | 2 + .../models/proforma_invoice_status.py | 2 + .../models/proforma_invoice_tax.py | 14 +- .../proforma_invoice_tax_source_type.py | 2 + advancedbilling/models/proration.py | 14 +- advancedbilling/models/public_key.py | 14 +- advancedbilling/models/public_signup_page.py | 14 +- .../models/quantity_based_component.py | 22 +- .../reactivate_subscription_group_request.py | 14 +- .../reactivate_subscription_group_response.py | 14 +- .../models/reactivate_subscription_request.py | 14 +- .../models/reactivation_billing.py | 14 +- advancedbilling/models/reactivation_charge.py | 2 + advancedbilling/models/reason_code.py | 14 +- .../models/reason_code_response.py | 14 +- .../models/record_payment_request.py | 14 +- .../models/record_payment_response.py | 14 +- advancedbilling/models/recurring_scheme.py | 2 + advancedbilling/models/referral_code.py | 14 +- .../models/referral_validation_response.py | 14 +- .../models/refund_consolidated_invoice.py | 14 +- advancedbilling/models/refund_invoice.py | 14 +- .../models/refund_invoice_event.py | 14 +- .../models/refund_invoice_event_data.py | 14 +- .../models/refund_invoice_request.py | 14 +- advancedbilling/models/refund_prepayment.py | 14 +- .../refund_prepayment_base_refund_error.py | 14 +- .../models/refund_prepayment_request.py | 14 +- advancedbilling/models/refund_success.py | 14 +- .../models/remove_payment_event.py | 14 +- .../models/remove_payment_event_data.py | 14 +- advancedbilling/models/renewal_preview.py | 14 +- .../models/renewal_preview_component.py | 14 +- .../models/renewal_preview_line_item.py | 14 +- .../models/renewal_preview_request.py | 14 +- .../models/renewal_preview_response.py | 14 +- .../models/replay_webhooks_request.py | 14 +- .../models/replay_webhooks_response.py | 14 +- advancedbilling/models/resent_invitation.py | 14 +- advancedbilling/models/resource_type.py | 2 + advancedbilling/models/restriction_type.py | 2 + advancedbilling/models/resume_options.py | 14 +- advancedbilling/models/resumption_charge.py | 2 + advancedbilling/models/revoked_invitation.py | 14 +- advancedbilling/models/sale_rep.py | 14 +- advancedbilling/models/sale_rep_item_mrr.py | 14 +- advancedbilling/models/sale_rep_settings.py | 14 +- .../models/sale_rep_subscription.py | 14 +- advancedbilling/models/segment.py | 14 +- advancedbilling/models/segment_price.py | 14 +- advancedbilling/models/segment_response.py | 14 +- .../models/send_invoice_request.py | 14 +- advancedbilling/models/service_credit.py | 14 +- .../models/service_credit_response.py | 14 +- advancedbilling/models/service_credit_type.py | 2 + .../models/signup_proforma_preview.py | 14 +- .../signup_proforma_preview_response.py | 14 +- advancedbilling/models/site.py | 14 +- advancedbilling/models/site_response.py | 14 +- advancedbilling/models/site_statistics.py | 14 +- advancedbilling/models/site_summary.py | 14 +- advancedbilling/models/snap_day.py | 2 + advancedbilling/models/sorting_direction.py | 2 + advancedbilling/models/subscription.py | 14 +- .../models/subscription_component.py | 14 +- ...ription_component_allocation_error_item.py | 14 +- .../models/subscription_component_response.py | 14 +- .../subscription_component_subscription.py | 14 +- .../models/subscription_custom_price.py | 14 +- .../models/subscription_date_field.py | 2 + advancedbilling/models/subscription_filter.py | 14 +- advancedbilling/models/subscription_group.py | 14 +- .../models/subscription_group_balances.py | 14 +- .../models/subscription_group_bank_account.py | 14 +- ...bscription_group_component_custom_price.py | 14 +- .../models/subscription_group_credit_card.py | 14 +- .../models/subscription_group_customer.py | 14 +- .../models/subscription_group_include.py | 2 + .../models/subscription_group_item.py | 14 +- .../models/subscription_group_member_error.py | 86 ------ .../subscription_group_members_array_error.py | 14 +- .../subscription_group_payment_profile.py | 14 +- .../models/subscription_group_prepayment.py | 14 +- .../subscription_group_prepayment_method.py | 2 + .../subscription_group_prepayment_request.py | 14 +- .../subscription_group_prepayment_response.py | 14 +- .../models/subscription_group_response.py | 14 +- .../models/subscription_group_signup.py | 14 +- .../subscription_group_signup_component.py | 14 +- .../models/subscription_group_signup_error.py | 14 +- ...> subscription_group_signup_event_data.py} | 35 ++- .../subscription_group_signup_failure_data.py | 14 +- .../models/subscription_group_signup_item.py | 14 +- .../subscription_group_signup_request.py | 14 +- .../subscription_group_signup_response.py | 14 +- .../subscription_group_signup_success.py | 106 ------- .../subscription_group_signup_success_data.py | 169 ----------- .../models/subscription_group_single_error.py | 14 +- .../subscription_group_subscription_error.py | 14 +- .../models/subscription_group_update_error.py | 24 +- .../subscription_groups_list_include.py | 2 + .../models/subscription_include.py | 2 + .../models/subscription_included_coupon.py | 14 +- .../models/subscription_list_date_field.py | 2 + .../models/subscription_list_include.py | 2 + .../models/subscription_migration_preview.py | 14 +- .../subscription_migration_preview_options.py | 14 +- .../subscription_migration_preview_request.py | 14 +- ...subscription_migration_preview_response.py | 14 +- advancedbilling/models/subscription_mrr.py | 14 +- .../models/subscription_mrr_breakout.py | 14 +- .../models/subscription_mrr_response.py | 14 +- advancedbilling/models/subscription_note.py | 14 +- .../models/subscription_note_response.py | 14 +- .../models/subscription_preview.py | 14 +- .../models/subscription_preview_response.py | 14 +- .../models/subscription_product_change.py | 14 +- .../models/subscription_product_migration.py | 14 +- .../subscription_product_migration_request.py | 14 +- .../models/subscription_purge_type.py | 2 + .../models/subscription_response.py | 14 +- advancedbilling/models/subscription_sort.py | 2 + advancedbilling/models/subscription_state.py | 2 + .../models/subscription_state_change.py | 14 +- .../models/subscription_state_filter.py | 2 + advancedbilling/models/tax_configuration.py | 14 +- .../models/tax_configuration_kind.py | 2 + .../models/tax_destination_address.py | 2 + .../too_many_management_link_requests.py | 14 +- .../update_allocation_expiration_date.py | 14 +- advancedbilling/models/update_component.py | 14 +- .../models/update_component_price_point.py | 14 +- .../update_component_price_point_request.py | 14 +- .../models/update_component_request.py | 14 +- .../models/update_coupon_currency.py | 14 +- .../models/update_currency_price.py | 16 +- .../models/update_currency_prices_request.py | 14 +- advancedbilling/models/update_customer.py | 14 +- .../models/update_customer_request.py | 14 +- advancedbilling/models/update_metadata.py | 14 +- .../models/update_metadata_request.py | 14 +- advancedbilling/models/update_metafield.py | 14 +- .../models/update_metafields_request.py | 14 +- .../models/update_payment_profile.py | 14 +- .../models/update_payment_profile_request.py | 14 +- advancedbilling/models/update_price.py | 14 +- .../models/update_product_price_point.py | 14 +- .../update_product_price_point_request.py | 14 +- advancedbilling/models/update_reason_code.py | 14 +- .../models/update_reason_code_request.py | 14 +- advancedbilling/models/update_segment.py | 14 +- .../models/update_segment_request.py | 14 +- advancedbilling/models/update_subscription.py | 15 +- .../models/update_subscription_component.py | 14 +- .../models/update_subscription_group.py | 14 +- .../update_subscription_group_request.py | 14 +- .../models/update_subscription_note.py | 14 +- .../update_subscription_note_request.py | 14 +- .../models/update_subscription_request.py | 14 +- .../models/upsert_prepaid_configuration.py | 14 +- .../upsert_prepaid_configuration_request.py | 14 +- advancedbilling/models/usage.py | 14 +- advancedbilling/models/usage_response.py | 14 +- advancedbilling/models/void_invoice.py | 14 +- advancedbilling/models/void_invoice_event.py | 14 +- .../models/void_invoice_event_data.py | 14 +- .../models/void_invoice_request.py | 14 +- .../models/void_remainder_event.py | 14 +- .../models/void_remainder_event_data.py | 14 +- advancedbilling/models/webhook.py | 14 +- advancedbilling/models/webhook_order.py | 2 + advancedbilling/models/webhook_response.py | 14 +- advancedbilling/models/webhook_status.py | 2 + .../models/webhook_subscription.py | 2 + .../utilities/union_type_lookup.py | 47 +-- doc/client.md | 10 +- doc/controllers/component-price-points.md | 16 +- doc/controllers/components.md | 9 +- doc/controllers/coupons.md | 57 ++-- doc/controllers/events.md | 38 ++- doc/controllers/offers.md | 6 + doc/controllers/product-families.md | 16 +- doc/controllers/product-price-points.md | 1 + doc/controllers/reason-codes.md | 9 +- doc/controllers/subscription-components.md | 10 - doc/controllers/subscription-notes.md | 18 ++ doc/controllers/subscription-status.md | 7 + doc/controllers/subscriptions.md | 49 +-- doc/models/add-subscription-to-a-group.md | 2 +- .../change-invoice-status-event-data.md | 2 +- doc/models/change-invoice-status-event.md | 4 +- doc/models/component-price-point.md | 6 + doc/models/component.md | 2 +- doc/models/compounding-strategy.md | 2 + .../add-subscription-to-a-group-group.md | 14 - ...entage.md => coupon-payload-percentage.md} | 2 +- .../create-or-update-coupon-coupon.md | 14 - .../containers/event-event-specific-data.md | 5 +- doc/models/coupon-currency-response.md | 6 +- doc/models/coupon-currency.md | 4 +- doc/models/coupon-payload.md | 38 +++ ...-or-update-coupon.md => coupon-request.md} | 19 +- doc/models/coupon.md | 11 +- doc/models/create-component-price-point.md | 4 +- doc/models/create-ebb-component.md | 10 +- doc/models/create-invoice-coupon.md | 2 +- doc/models/create-metered-component.md | 24 +- doc/models/create-on-off-component.md | 11 +- .../create-or-update-flat-amount-coupon.md | 40 --- .../create-or-update-percentage-coupon.md | 40 --- doc/models/create-prepaid-component.md | 20 +- ...ate-prepaid-usage-component-price-point.md | 6 +- doc/models/currency-price.md | 4 +- doc/models/currency-prices-response.md | 2 +- doc/models/ebb-component.md | 15 +- doc/models/event-key.md | 92 ++++++ doc/models/event-response.md | 2 +- doc/models/event-type.md | 46 --- doc/models/event.md | 6 +- doc/models/invoice-avatax-details.md | 29 ++ doc/models/invoice-debit.md | 32 ++ doc/models/invoice-line-item.md | 1 + doc/models/invoice-status.md | 1 + doc/models/invoice.md | 3 + doc/models/issue-invoice-event-data.md | 4 +- doc/models/issue-invoice-event.md | 4 +- doc/models/metered-component.md | 13 +- ...-codes-json-response.md => ok-response.md} | 6 +- doc/models/on-off-component.md | 25 +- doc/models/paid-invoice.md | 2 +- doc/models/prepaid-component-price-point.md | 49 --- doc/models/prepaid-usage-component.md | 34 ++- doc/models/quantity-based-component.md | 1 - doc/models/subscription-group-member-error.md | 25 -- ...> subscription-group-signup-event-data.md} | 14 +- .../subscription-group-signup-success-data.md | 40 --- .../subscription-group-signup-success.md | 42 --- ...n-group-update-error-response-exception.md | 12 +- doc/models/subscription-group-update-error.md | 20 +- .../subscription-response-error-exception.md | 27 ++ doc/models/update-currency-price.md | 4 +- doc/models/update-currency-prices-request.md | 2 +- pyproject.toml | 4 +- requirements.txt | 3 +- tests/conftest.py | 9 +- tests/data/init_cases.py | 3 +- tests/test_invoices.py | 4 +- 691 files changed, 6032 insertions(+), 4888 deletions(-) create mode 100644 advancedbilling/exceptions/subscription_response_error_exception.py rename advancedbilling/models/{create_or_update_percentage_coupon.py => coupon_payload.py} (62%) rename advancedbilling/models/{create_or_update_coupon.py => coupon_request.py} (76%) delete mode 100644 advancedbilling/models/create_or_update_flat_amount_coupon.py create mode 100644 advancedbilling/models/event_key.py delete mode 100644 advancedbilling/models/event_type.py create mode 100644 advancedbilling/models/invoice_avatax_details.py create mode 100644 advancedbilling/models/invoice_debit.py rename advancedbilling/models/{reason_codes_json_response.py => ok_response.py} (72%) delete mode 100644 advancedbilling/models/prepaid_component_price_point.py delete mode 100644 advancedbilling/models/subscription_group_member_error.py rename advancedbilling/models/{subscription_group_signup_failure.py => subscription_group_signup_event_data.py} (75%) delete mode 100644 advancedbilling/models/subscription_group_signup_success.py delete mode 100644 advancedbilling/models/subscription_group_signup_success_data.py delete mode 100644 doc/models/containers/add-subscription-to-a-group-group.md rename doc/models/containers/{create-or-update-percentage-coupon-percentage.md => coupon-payload-percentage.md} (63%) delete mode 100644 doc/models/containers/create-or-update-coupon-coupon.md create mode 100644 doc/models/coupon-payload.md rename doc/models/{create-or-update-coupon.md => coupon-request.md} (52%) delete mode 100644 doc/models/create-or-update-flat-amount-coupon.md delete mode 100644 doc/models/create-or-update-percentage-coupon.md create mode 100644 doc/models/event-key.md delete mode 100644 doc/models/event-type.md create mode 100644 doc/models/invoice-avatax-details.md create mode 100644 doc/models/invoice-debit.md rename doc/models/{reason-codes-json-response.md => ok-response.md} (70%) delete mode 100644 doc/models/prepaid-component-price-point.md delete mode 100644 doc/models/subscription-group-member-error.md rename doc/models/{subscription-group-signup-failure.md => subscription-group-signup-event-data.md} (67%) delete mode 100644 doc/models/subscription-group-signup-success-data.md delete mode 100644 doc/models/subscription-group-signup-success.md create mode 100644 doc/models/subscription-response-error-exception.md diff --git a/README.md b/README.md index a102ad98..1d0e279d 100644 --- a/README.md +++ b/README.md @@ -30,24 +30,23 @@ curl -u :x -H Accept:application/json -H Content-Type:application/json The package is compatible with Python versions `3 >=3.7, <= 3.11`. Install the package from PyPi using the following pip command: -```python -pip install maxio-advanced-billing-sdk==5.2.0 +```bash +pip install maxio-advanced-billing-sdk==6.0.0 ``` You can also view the package at: -https://pypi.python.org/pypi/maxio-advanced-billing-sdk/5.2.0 +https://pypi.python.org/pypi/maxio-advanced-billing-sdk/6.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/5.2.0/doc/client.md) +**_Note:_** Documentation for the client can be found [here.](https://www.github.com/maxio-com/ab-python-sdk/tree/6.0.0/doc/client.md) The following parameters are configurable for the API Client: | Parameter | Type | Description | | --- | --- | --- | -| `subdomain` | `str` | The subdomain for your Advanced Billing site.
*Default*: `'subdomain'` | -| `domain` | `str` | The Advanced Billing server domain.
*Default*: `'chargify.com'` | -| `environment` | `Environment` | The API environment.
**Default: `Environment.PRODUCTION`** | +| `site` | `str` | The subdomain for your Advanced Billing site.
*Default*: `'subdomain'` | +| `environment` | `Environment` | The API environment.
**Default: `Environment.US`** | | `http_client_instance` | `HttpClient` | 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 | @@ -56,7 +55,7 @@ The following parameters are configurable for the API Client: | `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']** | -| `basic_auth_credentials` | [`BasicAuthCredentials`](https://www.github.com/maxio-com/ab-python-sdk/tree/5.2.0/doc/auth/basic-authentication.md) | The credential object for Basic Authentication | +| `basic_auth_credentials` | [`BasicAuthCredentials`](https://www.github.com/maxio-com/ab-python-sdk/tree/6.0.0/doc/auth/basic-authentication.md) | The credential object for Basic Authentication | The API client can be initialized as follows: @@ -66,9 +65,8 @@ client = AdvancedBillingClient( username='BasicAuthUserName', password='BasicAuthPassword' ), - environment=Environment.PRODUCTION, - subdomain='subdomain', - domain='chargify.com' + environment=Environment.US, + site='subdomain' ) ``` @@ -80,53 +78,53 @@ The SDK can be configured to use a different environment for making API calls. A | Name | Description | | --- | --- | -| production | **Default** Production server | -| environment2 | Production server | +| US | **Default** Default Advanced Billing environment hosted in US. Valid for the majority of our customers. | +| EU | Advanced Billing environment hosted in EU. Use only when you requested EU hosting for your AB account. | ## Authorization This API uses the following authentication schemes. -* [`BasicAuth (Basic Authentication)`](https://www.github.com/maxio-com/ab-python-sdk/tree/5.2.0/doc/auth/basic-authentication.md) +* [`BasicAuth (Basic Authentication)`](https://www.github.com/maxio-com/ab-python-sdk/tree/6.0.0/doc/auth/basic-authentication.md) ## List of APIs -* [API Exports](https://www.github.com/maxio-com/ab-python-sdk/tree/5.2.0/doc/controllers/api-exports.md) -* [Advance Invoice](https://www.github.com/maxio-com/ab-python-sdk/tree/5.2.0/doc/controllers/advance-invoice.md) -* [Billing Portal](https://www.github.com/maxio-com/ab-python-sdk/tree/5.2.0/doc/controllers/billing-portal.md) -* [Component Price Points](https://www.github.com/maxio-com/ab-python-sdk/tree/5.2.0/doc/controllers/component-price-points.md) -* [Custom Fields](https://www.github.com/maxio-com/ab-python-sdk/tree/5.2.0/doc/controllers/custom-fields.md) -* [Events-Based Billing Segments](https://www.github.com/maxio-com/ab-python-sdk/tree/5.2.0/doc/controllers/events-based-billing-segments.md) -* [Payment Profiles](https://www.github.com/maxio-com/ab-python-sdk/tree/5.2.0/doc/controllers/payment-profiles.md) -* [Product Families](https://www.github.com/maxio-com/ab-python-sdk/tree/5.2.0/doc/controllers/product-families.md) -* [Product Price Points](https://www.github.com/maxio-com/ab-python-sdk/tree/5.2.0/doc/controllers/product-price-points.md) -* [Proforma Invoices](https://www.github.com/maxio-com/ab-python-sdk/tree/5.2.0/doc/controllers/proforma-invoices.md) -* [Reason Codes](https://www.github.com/maxio-com/ab-python-sdk/tree/5.2.0/doc/controllers/reason-codes.md) -* [Referral Codes](https://www.github.com/maxio-com/ab-python-sdk/tree/5.2.0/doc/controllers/referral-codes.md) -* [Sales Commissions](https://www.github.com/maxio-com/ab-python-sdk/tree/5.2.0/doc/controllers/sales-commissions.md) -* [Subscription Components](https://www.github.com/maxio-com/ab-python-sdk/tree/5.2.0/doc/controllers/subscription-components.md) -* [Subscription Groups](https://www.github.com/maxio-com/ab-python-sdk/tree/5.2.0/doc/controllers/subscription-groups.md) -* [Subscription Group Invoice Account](https://www.github.com/maxio-com/ab-python-sdk/tree/5.2.0/doc/controllers/subscription-group-invoice-account.md) -* [Subscription Group Status](https://www.github.com/maxio-com/ab-python-sdk/tree/5.2.0/doc/controllers/subscription-group-status.md) -* [Subscription Invoice Account](https://www.github.com/maxio-com/ab-python-sdk/tree/5.2.0/doc/controllers/subscription-invoice-account.md) -* [Subscription Notes](https://www.github.com/maxio-com/ab-python-sdk/tree/5.2.0/doc/controllers/subscription-notes.md) -* [Subscription Products](https://www.github.com/maxio-com/ab-python-sdk/tree/5.2.0/doc/controllers/subscription-products.md) -* [Subscription Status](https://www.github.com/maxio-com/ab-python-sdk/tree/5.2.0/doc/controllers/subscription-status.md) -* [Coupons](https://www.github.com/maxio-com/ab-python-sdk/tree/5.2.0/doc/controllers/coupons.md) -* [Components](https://www.github.com/maxio-com/ab-python-sdk/tree/5.2.0/doc/controllers/components.md) -* [Customers](https://www.github.com/maxio-com/ab-python-sdk/tree/5.2.0/doc/controllers/customers.md) -* [Events](https://www.github.com/maxio-com/ab-python-sdk/tree/5.2.0/doc/controllers/events.md) -* [Insights](https://www.github.com/maxio-com/ab-python-sdk/tree/5.2.0/doc/controllers/insights.md) -* [Invoices](https://www.github.com/maxio-com/ab-python-sdk/tree/5.2.0/doc/controllers/invoices.md) -* [Offers](https://www.github.com/maxio-com/ab-python-sdk/tree/5.2.0/doc/controllers/offers.md) -* [Products](https://www.github.com/maxio-com/ab-python-sdk/tree/5.2.0/doc/controllers/products.md) -* [Sites](https://www.github.com/maxio-com/ab-python-sdk/tree/5.2.0/doc/controllers/sites.md) -* [Subscriptions](https://www.github.com/maxio-com/ab-python-sdk/tree/5.2.0/doc/controllers/subscriptions.md) -* [Webhooks](https://www.github.com/maxio-com/ab-python-sdk/tree/5.2.0/doc/controllers/webhooks.md) +* [API Exports](https://www.github.com/maxio-com/ab-python-sdk/tree/6.0.0/doc/controllers/api-exports.md) +* [Advance Invoice](https://www.github.com/maxio-com/ab-python-sdk/tree/6.0.0/doc/controllers/advance-invoice.md) +* [Billing Portal](https://www.github.com/maxio-com/ab-python-sdk/tree/6.0.0/doc/controllers/billing-portal.md) +* [Component Price Points](https://www.github.com/maxio-com/ab-python-sdk/tree/6.0.0/doc/controllers/component-price-points.md) +* [Custom Fields](https://www.github.com/maxio-com/ab-python-sdk/tree/6.0.0/doc/controllers/custom-fields.md) +* [Events-Based Billing Segments](https://www.github.com/maxio-com/ab-python-sdk/tree/6.0.0/doc/controllers/events-based-billing-segments.md) +* [Payment Profiles](https://www.github.com/maxio-com/ab-python-sdk/tree/6.0.0/doc/controllers/payment-profiles.md) +* [Product Families](https://www.github.com/maxio-com/ab-python-sdk/tree/6.0.0/doc/controllers/product-families.md) +* [Product Price Points](https://www.github.com/maxio-com/ab-python-sdk/tree/6.0.0/doc/controllers/product-price-points.md) +* [Proforma Invoices](https://www.github.com/maxio-com/ab-python-sdk/tree/6.0.0/doc/controllers/proforma-invoices.md) +* [Reason Codes](https://www.github.com/maxio-com/ab-python-sdk/tree/6.0.0/doc/controllers/reason-codes.md) +* [Referral Codes](https://www.github.com/maxio-com/ab-python-sdk/tree/6.0.0/doc/controllers/referral-codes.md) +* [Sales Commissions](https://www.github.com/maxio-com/ab-python-sdk/tree/6.0.0/doc/controllers/sales-commissions.md) +* [Subscription Components](https://www.github.com/maxio-com/ab-python-sdk/tree/6.0.0/doc/controllers/subscription-components.md) +* [Subscription Groups](https://www.github.com/maxio-com/ab-python-sdk/tree/6.0.0/doc/controllers/subscription-groups.md) +* [Subscription Group Invoice Account](https://www.github.com/maxio-com/ab-python-sdk/tree/6.0.0/doc/controllers/subscription-group-invoice-account.md) +* [Subscription Group Status](https://www.github.com/maxio-com/ab-python-sdk/tree/6.0.0/doc/controllers/subscription-group-status.md) +* [Subscription Invoice Account](https://www.github.com/maxio-com/ab-python-sdk/tree/6.0.0/doc/controllers/subscription-invoice-account.md) +* [Subscription Notes](https://www.github.com/maxio-com/ab-python-sdk/tree/6.0.0/doc/controllers/subscription-notes.md) +* [Subscription Products](https://www.github.com/maxio-com/ab-python-sdk/tree/6.0.0/doc/controllers/subscription-products.md) +* [Subscription Status](https://www.github.com/maxio-com/ab-python-sdk/tree/6.0.0/doc/controllers/subscription-status.md) +* [Coupons](https://www.github.com/maxio-com/ab-python-sdk/tree/6.0.0/doc/controllers/coupons.md) +* [Components](https://www.github.com/maxio-com/ab-python-sdk/tree/6.0.0/doc/controllers/components.md) +* [Customers](https://www.github.com/maxio-com/ab-python-sdk/tree/6.0.0/doc/controllers/customers.md) +* [Events](https://www.github.com/maxio-com/ab-python-sdk/tree/6.0.0/doc/controllers/events.md) +* [Insights](https://www.github.com/maxio-com/ab-python-sdk/tree/6.0.0/doc/controllers/insights.md) +* [Invoices](https://www.github.com/maxio-com/ab-python-sdk/tree/6.0.0/doc/controllers/invoices.md) +* [Offers](https://www.github.com/maxio-com/ab-python-sdk/tree/6.0.0/doc/controllers/offers.md) +* [Products](https://www.github.com/maxio-com/ab-python-sdk/tree/6.0.0/doc/controllers/products.md) +* [Sites](https://www.github.com/maxio-com/ab-python-sdk/tree/6.0.0/doc/controllers/sites.md) +* [Subscriptions](https://www.github.com/maxio-com/ab-python-sdk/tree/6.0.0/doc/controllers/subscriptions.md) +* [Webhooks](https://www.github.com/maxio-com/ab-python-sdk/tree/6.0.0/doc/controllers/webhooks.md) ## Classes Documentation -* [Utility Classes](https://www.github.com/maxio-com/ab-python-sdk/tree/5.2.0/doc/utility-classes.md) -* [HttpResponse](https://www.github.com/maxio-com/ab-python-sdk/tree/5.2.0/doc/http-response.md) -* [HttpRequest](https://www.github.com/maxio-com/ab-python-sdk/tree/5.2.0/doc/http-request.md) +* [Utility Classes](https://www.github.com/maxio-com/ab-python-sdk/tree/6.0.0/doc/utility-classes.md) +* [HttpResponse](https://www.github.com/maxio-com/ab-python-sdk/tree/6.0.0/doc/http-response.md) +* [HttpRequest](https://www.github.com/maxio-com/ab-python-sdk/tree/6.0.0/doc/http-request.md) diff --git a/advancedbilling/advanced_billing_client.py b/advancedbilling/advanced_billing_client.py index 1297723f..a4704526 100644 --- a/advancedbilling/advanced_billing_client.py +++ b/advancedbilling/advanced_billing_client.py @@ -204,16 +204,15 @@ 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, - environment=Environment.PRODUCTION, subdomain='subdomain', - domain='chargify.com', basic_auth_credentials=None, - config=None): + environment=Environment.US, site='subdomain', + basic_auth_credentials=None, config=None): self.config = config or 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, - environment=environment, subdomain=subdomain, domain=domain, + environment=environment, site=site, basic_auth_credentials=basic_auth_credentials) self.global_configuration = GlobalConfiguration(self.config)\ diff --git a/advancedbilling/configuration.py b/advancedbilling/configuration.py index 99307026..80add27b 100644 --- a/advancedbilling/configuration.py +++ b/advancedbilling/configuration.py @@ -15,15 +15,16 @@ class Environment(Enum): """An enum for SDK environments""" - # Production server - PRODUCTION = 0 - # Production server - ENVIRONMENT2 = 1 + # 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. + EU = 1 class Server(Enum): """An enum for API servers""" - DEFAULT = 0 + PRODUCTION = 0 + EBB = 1 class Configuration(HttpClientConfiguration): @@ -35,12 +36,8 @@ def environment(self): return self._environment @property - def subdomain(self): - return self._subdomain - - @property - def domain(self): - return self._domain + def site(self): + return self._site @property def basic_auth_credentials(self): @@ -50,8 +47,8 @@ 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, - environment=Environment.PRODUCTION, subdomain='subdomain', - domain='chargify.com', basic_auth_credentials=None): + environment=Environment.US, site='subdomain', + basic_auth_credentials=None): if retry_methods is None: retry_methods = ['GET', 'PUT'] @@ -67,10 +64,7 @@ def __init__(self, http_client_instance=None, self._environment = environment # The subdomain for your Advanced Billing site. - self._subdomain = subdomain - - # The Advanced Billing server domain. - self._domain = domain + self._site = site self._basic_auth_credentials = basic_auth_credentials @@ -81,7 +75,7 @@ def clone_with(self, http_client_instance=None, override_http_client_configuration=None, http_call_back=None, timeout=None, max_retries=None, backoff_factor=None, retry_statuses=None, retry_methods=None, environment=None, - subdomain=None, domain=None, basic_auth_credentials=None): + site=None, basic_auth_credentials=None): 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 http_call_back = http_call_back or self.http_callback @@ -91,8 +85,7 @@ def clone_with(self, http_client_instance=None, retry_statuses = retry_statuses or self.retry_statuses retry_methods = retry_methods or self.retry_methods environment = environment or self.environment - subdomain = subdomain or self.subdomain - domain = domain or self.domain + site = site or self.site basic_auth_credentials = basic_auth_credentials or self.basic_auth_credentials return Configuration( http_client_instance=http_client_instance, @@ -100,7 +93,7 @@ def clone_with(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, - environment=environment, subdomain=subdomain, domain=domain, + environment=environment, site=site, basic_auth_credentials=basic_auth_credentials ) @@ -116,15 +109,17 @@ def create_http_client(self): # All the environments the SDK can run in environments = { - Environment.PRODUCTION: { - Server.DEFAULT: 'https://{subdomain}.{domain}' + Environment.US: { + Server.PRODUCTION: 'https://{site}.chargify.com', + Server.EBB: 'https://events.chargify.com/{site}' }, - Environment.ENVIRONMENT2: { - Server.DEFAULT: 'https://events.chargify.com' + Environment.EU: { + Server.PRODUCTION: 'https://{site}.ebilling.maxio.com', + Server.EBB: 'https://events.chargify.com/{site}' } } - def get_base_uri(self, server=Server.DEFAULT): + def get_base_uri(self, server=Server.PRODUCTION): """Generates the appropriate base URI for the environment and the server. @@ -137,8 +132,7 @@ def get_base_uri(self, server=Server.DEFAULT): """ parameters = { - "subdomain": {'value': self.subdomain, 'encode': False}, - "domain": {'value': self.domain, 'encode': False}, + "site": {'value': self.site, 'encode': False}, } return APIHelper.append_url_with_template_parameters( diff --git a/advancedbilling/controllers/advance_invoice_controller.py b/advancedbilling/controllers/advance_invoice_controller.py index d9e45cc6..98e3481f 100644 --- a/advancedbilling/controllers/advance_invoice_controller.py +++ b/advancedbilling/controllers/advance_invoice_controller.py @@ -66,7 +66,7 @@ def issue_advance_invoice(self, """ return super().new_api_call_builder.request( - RequestBuilder().server(Server.DEFAULT) + RequestBuilder().server(Server.PRODUCTION) .path('/subscriptions/{subscription_id}/advance_invoice/issue.json') .http_method(HttpMethodEnum.POST) .template_param(Parameter() @@ -115,7 +115,7 @@ def read_advance_invoice(self, """ return super().new_api_call_builder.request( - RequestBuilder().server(Server.DEFAULT) + RequestBuilder().server(Server.PRODUCTION) .path('/subscriptions/{subscription_id}/advance_invoice.json') .http_method(HttpMethodEnum.GET) .template_param(Parameter() @@ -163,7 +163,7 @@ def void_advance_invoice(self, """ return super().new_api_call_builder.request( - RequestBuilder().server(Server.DEFAULT) + RequestBuilder().server(Server.PRODUCTION) .path('/subscriptions/{subscription_id}/advance_invoice/void.json') .http_method(HttpMethodEnum.POST) .template_param(Parameter() diff --git a/advancedbilling/controllers/api_exports_controller.py b/advancedbilling/controllers/api_exports_controller.py index 7e5da23e..e8168dc0 100644 --- a/advancedbilling/controllers/api_exports_controller.py +++ b/advancedbilling/controllers/api_exports_controller.py @@ -74,7 +74,7 @@ def list_exported_proforma_invoices(self, """ return super().new_api_call_builder.request( - RequestBuilder().server(Server.DEFAULT) + RequestBuilder().server(Server.PRODUCTION) .path('/api_exports/proforma_invoices/{batch_id}/rows.json') .http_method(HttpMethodEnum.GET) .template_param(Parameter() @@ -144,7 +144,7 @@ def list_exported_invoices(self, """ return super().new_api_call_builder.request( - RequestBuilder().server(Server.DEFAULT) + RequestBuilder().server(Server.PRODUCTION) .path('/api_exports/invoices/{batch_id}/rows.json') .http_method(HttpMethodEnum.GET) .template_param(Parameter() @@ -214,7 +214,7 @@ def list_exported_subscriptions(self, """ return super().new_api_call_builder.request( - RequestBuilder().server(Server.DEFAULT) + RequestBuilder().server(Server.PRODUCTION) .path('/api_exports/subscriptions/{batch_id}/rows.json') .http_method(HttpMethodEnum.GET) .template_param(Parameter() @@ -258,7 +258,7 @@ def export_proforma_invoices(self): """ return super().new_api_call_builder.request( - RequestBuilder().server(Server.DEFAULT) + RequestBuilder().server(Server.PRODUCTION) .path('/api_exports/proforma_invoices.json') .http_method(HttpMethodEnum.POST) .header_param(Parameter() @@ -290,7 +290,7 @@ def export_invoices(self): """ return super().new_api_call_builder.request( - RequestBuilder().server(Server.DEFAULT) + RequestBuilder().server(Server.PRODUCTION) .path('/api_exports/invoices.json') .http_method(HttpMethodEnum.POST) .header_param(Parameter() @@ -322,7 +322,7 @@ def export_subscriptions(self): """ return super().new_api_call_builder.request( - RequestBuilder().server(Server.DEFAULT) + RequestBuilder().server(Server.PRODUCTION) .path('/api_exports/subscriptions.json') .http_method(HttpMethodEnum.POST) .header_param(Parameter() @@ -357,7 +357,7 @@ def read_proforma_invoices_export(self, """ return super().new_api_call_builder.request( - RequestBuilder().server(Server.DEFAULT) + RequestBuilder().server(Server.PRODUCTION) .path('/api_exports/proforma_invoices/{batch_id}.json') .http_method(HttpMethodEnum.GET) .template_param(Parameter() @@ -397,7 +397,7 @@ def read_invoices_export(self, """ return super().new_api_call_builder.request( - RequestBuilder().server(Server.DEFAULT) + RequestBuilder().server(Server.PRODUCTION) .path('/api_exports/invoices/{batch_id}.json') .http_method(HttpMethodEnum.GET) .template_param(Parameter() @@ -437,7 +437,7 @@ def read_subscriptions_export(self, """ return super().new_api_call_builder.request( - RequestBuilder().server(Server.DEFAULT) + RequestBuilder().server(Server.PRODUCTION) .path('/api_exports/subscriptions/{batch_id}.json') .http_method(HttpMethodEnum.GET) .template_param(Parameter() diff --git a/advancedbilling/controllers/base_controller.py b/advancedbilling/controllers/base_controller.py index 9c1004cb..c1ce5d3b 100644 --- a/advancedbilling/controllers/base_controller.py +++ b/advancedbilling/controllers/base_controller.py @@ -30,7 +30,7 @@ class BaseController(object): @staticmethod def user_agent(): - return 'AB SDK Python:5.2.0 on OS {os-info}' + return 'AB SDK Python:6.0.0 on OS {os-info}' @staticmethod def user_agent_parameters(): diff --git a/advancedbilling/controllers/billing_portal_controller.py b/advancedbilling/controllers/billing_portal_controller.py index 56004c5a..80d4d940 100644 --- a/advancedbilling/controllers/billing_portal_controller.py +++ b/advancedbilling/controllers/billing_portal_controller.py @@ -81,7 +81,7 @@ def enable_billing_portal_for_customer(self, """ return super().new_api_call_builder.request( - RequestBuilder().server(Server.DEFAULT) + RequestBuilder().server(Server.PRODUCTION) .path('/portal/customers/{customer_id}/enable.json') .http_method(HttpMethodEnum.POST) .template_param(Parameter() @@ -135,7 +135,7 @@ def read_billing_portal_link(self, """ return super().new_api_call_builder.request( - RequestBuilder().server(Server.DEFAULT) + RequestBuilder().server(Server.PRODUCTION) .path('/portal/customers/{customer_id}/management_link.json') .http_method(HttpMethodEnum.GET) .template_param(Parameter() @@ -188,7 +188,7 @@ def resend_billing_portal_invitation(self, """ return super().new_api_call_builder.request( - RequestBuilder().server(Server.DEFAULT) + RequestBuilder().server(Server.PRODUCTION) .path('/portal/customers/{customer_id}/invitations/invite.json') .http_method(HttpMethodEnum.POST) .template_param(Parameter() @@ -233,7 +233,7 @@ def revoke_billing_portal_access(self, """ return super().new_api_call_builder.request( - RequestBuilder().server(Server.DEFAULT) + RequestBuilder().server(Server.PRODUCTION) .path('/portal/customers/{customer_id}/invitations/revoke.json') .http_method(HttpMethodEnum.DELETE) .template_param(Parameter() diff --git a/advancedbilling/controllers/component_price_points_controller.py b/advancedbilling/controllers/component_price_points_controller.py index d9a51986..0245dafa 100644 --- a/advancedbilling/controllers/component_price_points_controller.py +++ b/advancedbilling/controllers/component_price_points_controller.py @@ -64,7 +64,7 @@ def promote_component_price_point_to_default(self, """ return super().new_api_call_builder.request( - RequestBuilder().server(Server.DEFAULT) + RequestBuilder().server(Server.PRODUCTION) .path('/components/{component_id}/price_points/{price_point_id}/default.json') .http_method(HttpMethodEnum.PUT) .template_param(Parameter() @@ -112,7 +112,7 @@ def create_component_price_point(self, """ return super().new_api_call_builder.request( - RequestBuilder().server(Server.DEFAULT) + RequestBuilder().server(Server.PRODUCTION) .path('/components/{component_id}/price_points.json') .http_method(HttpMethodEnum.POST) .template_param(Parameter() @@ -134,6 +134,7 @@ def create_component_price_point(self, 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) ).execute() def list_component_price_points(self, @@ -192,7 +193,7 @@ def list_component_price_points(self, """ return super().new_api_call_builder.request( - RequestBuilder().server(Server.DEFAULT) + RequestBuilder().server(Server.PRODUCTION) .path('/components/{component_id}/price_points.json') .http_method(HttpMethodEnum.GET) .template_param(Parameter() @@ -249,7 +250,7 @@ def bulk_create_component_price_points(self, """ return super().new_api_call_builder.request( - RequestBuilder().server(Server.DEFAULT) + RequestBuilder().server(Server.PRODUCTION) .path('/components/{component_id}/price_points/bulk.json') .http_method(HttpMethodEnum.POST) .template_param(Parameter() @@ -271,6 +272,7 @@ def bulk_create_component_price_points(self, 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) ).execute() def update_component_price_point(self, @@ -313,7 +315,7 @@ def update_component_price_point(self, """ return super().new_api_call_builder.request( - RequestBuilder().server(Server.DEFAULT) + RequestBuilder().server(Server.PRODUCTION) .path('/components/{component_id}/price_points/{price_point_id}.json') .http_method(HttpMethodEnum.PUT) .template_param(Parameter() @@ -347,7 +349,8 @@ def update_component_price_point(self, def read_component_price_point(self, component_id, - price_point_id): + price_point_id, + currency_prices=None): """Does a GET request to /components/{component_id}/price_points/{price_point_id}.json. Use this endpoint to retrieve details for a specific component price @@ -363,6 +366,8 @@ def read_component_price_point(self, 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 @@ -376,7 +381,7 @@ def read_component_price_point(self, """ return super().new_api_call_builder.request( - RequestBuilder().server(Server.DEFAULT) + RequestBuilder().server(Server.PRODUCTION) .path('/components/{component_id}/price_points/{price_point_id}.json') .http_method(HttpMethodEnum.GET) .template_param(Parameter() @@ -391,6 +396,9 @@ def read_component_price_point(self, .is_required(True) .should_encode(True) .validator(lambda value: UnionTypeLookUp.get('ReadComponentPricePointPricePointId').validate(value))) + .query_param(Parameter() + .key('currency_prices') + .value(currency_prices)) .header_param(Parameter() .key('accept') .value('application/json')) @@ -432,7 +440,7 @@ def archive_component_price_point(self, """ return super().new_api_call_builder.request( - RequestBuilder().server(Server.DEFAULT) + RequestBuilder().server(Server.PRODUCTION) .path('/components/{component_id}/price_points/{price_point_id}.json') .http_method(HttpMethodEnum.DELETE) .template_param(Parameter() @@ -482,7 +490,7 @@ def unarchive_component_price_point(self, """ return super().new_api_call_builder.request( - RequestBuilder().server(Server.DEFAULT) + RequestBuilder().server(Server.PRODUCTION) .path('/components/{component_id}/price_points/{price_point_id}/unarchive.json') .http_method(HttpMethodEnum.PUT) .template_param(Parameter() @@ -536,7 +544,7 @@ def create_currency_prices(self, """ return super().new_api_call_builder.request( - RequestBuilder().server(Server.DEFAULT) + RequestBuilder().server(Server.PRODUCTION) .path('/price_points/{price_point_id}/currency_prices.json') .http_method(HttpMethodEnum.POST) .template_param(Parameter() @@ -558,7 +566,7 @@ def create_currency_prices(self, ResponseHandler() .deserializer(APIHelper.json_deserialize) .deserialize_into(ComponentCurrencyPricesResponse.from_dictionary) - .local_error('422', 'Unprocessable Entity (WebDAV)', ErrorArrayMapResponseException) + .local_error_template('422', 'HTTP Response Not OK. Status code: {$statusCode}. Response: \'{$response.body}\'.', ErrorArrayMapResponseException) ).execute() def update_currency_prices(self, @@ -588,7 +596,7 @@ def update_currency_prices(self, """ return super().new_api_call_builder.request( - RequestBuilder().server(Server.DEFAULT) + RequestBuilder().server(Server.PRODUCTION) .path('/price_points/{price_point_id}/currency_prices.json') .http_method(HttpMethodEnum.PUT) .template_param(Parameter() @@ -610,7 +618,7 @@ def update_currency_prices(self, ResponseHandler() .deserializer(APIHelper.json_deserialize) .deserialize_into(ComponentCurrencyPricesResponse.from_dictionary) - .local_error('422', 'Unprocessable Entity (WebDAV)', ErrorArrayMapResponseException) + .local_error_template('422', 'HTTP Response Not OK. Status code: {$statusCode}. Response: \'{$response.body}\'.', ErrorArrayMapResponseException) ).execute() def list_all_component_price_points(self, @@ -662,7 +670,7 @@ def list_all_component_price_points(self, """ return super().new_api_call_builder.request( - RequestBuilder().server(Server.DEFAULT) + RequestBuilder().server(Server.PRODUCTION) .path('/components_price_points.json') .http_method(HttpMethodEnum.GET) .query_param(Parameter() diff --git a/advancedbilling/controllers/components_controller.py b/advancedbilling/controllers/components_controller.py index 3eb65467..6344379c 100644 --- a/advancedbilling/controllers/components_controller.py +++ b/advancedbilling/controllers/components_controller.py @@ -66,7 +66,7 @@ def create_metered_component(self, """ return super().new_api_call_builder.request( - RequestBuilder().server(Server.DEFAULT) + RequestBuilder().server(Server.PRODUCTION) .path('/product_families/{product_family_id}/metered_components.json') .http_method(HttpMethodEnum.POST) .template_param(Parameter() @@ -136,7 +136,7 @@ def create_quantity_based_component(self, """ return super().new_api_call_builder.request( - RequestBuilder().server(Server.DEFAULT) + RequestBuilder().server(Server.PRODUCTION) .path('/product_families/{product_family_id}/quantity_based_components.json') .http_method(HttpMethodEnum.POST) .template_param(Parameter() @@ -193,7 +193,7 @@ def create_on_off_component(self, """ return super().new_api_call_builder.request( - RequestBuilder().server(Server.DEFAULT) + RequestBuilder().server(Server.PRODUCTION) .path('/product_families/{product_family_id}/on_off_components.json') .http_method(HttpMethodEnum.POST) .template_param(Parameter() @@ -255,7 +255,7 @@ def create_prepaid_usage_component(self, """ return super().new_api_call_builder.request( - RequestBuilder().server(Server.DEFAULT) + RequestBuilder().server(Server.PRODUCTION) .path('/product_families/{product_family_id}/prepaid_usage_components.json') .http_method(HttpMethodEnum.POST) .template_param(Parameter() @@ -320,7 +320,7 @@ def create_event_based_component(self, """ return super().new_api_call_builder.request( - RequestBuilder().server(Server.DEFAULT) + RequestBuilder().server(Server.PRODUCTION) .path('/product_families/{product_family_id}/event_based_components.json') .http_method(HttpMethodEnum.POST) .template_param(Parameter() @@ -369,7 +369,7 @@ def find_component(self, """ return super().new_api_call_builder.request( - RequestBuilder().server(Server.DEFAULT) + RequestBuilder().server(Server.PRODUCTION) .path('/components/lookup.json') .http_method(HttpMethodEnum.GET) .query_param(Parameter() @@ -415,7 +415,7 @@ def read_component(self, """ return super().new_api_call_builder.request( - RequestBuilder().server(Server.DEFAULT) + RequestBuilder().server(Server.PRODUCTION) .path('/product_families/{product_family_id}/components/{component_id}.json') .http_method(HttpMethodEnum.GET) .template_param(Parameter() @@ -469,7 +469,7 @@ def update_product_family_component(self, """ return super().new_api_call_builder.request( - RequestBuilder().server(Server.DEFAULT) + RequestBuilder().server(Server.PRODUCTION) .path('/product_families/{product_family_id}/components/{component_id}.json') .http_method(HttpMethodEnum.PUT) .template_param(Parameter() @@ -527,7 +527,7 @@ def archive_component(self, """ return super().new_api_call_builder.request( - RequestBuilder().server(Server.DEFAULT) + RequestBuilder().server(Server.PRODUCTION) .path('/product_families/{product_family_id}/components/{component_id}.json') .http_method(HttpMethodEnum.DELETE) .template_param(Parameter() @@ -619,7 +619,7 @@ def list_components(self, """ return super().new_api_call_builder.request( - RequestBuilder().server(Server.DEFAULT) + RequestBuilder().server(Server.PRODUCTION) .path('/components.json') .http_method(HttpMethodEnum.GET) .query_param(Parameter() @@ -686,7 +686,7 @@ def update_component(self, """ return super().new_api_call_builder.request( - RequestBuilder().server(Server.DEFAULT) + RequestBuilder().server(Server.PRODUCTION) .path('/components/{component_id}.json') .http_method(HttpMethodEnum.PUT) .template_param(Parameter() @@ -783,7 +783,7 @@ def list_components_for_product_family(self, """ return super().new_api_call_builder.request( - RequestBuilder().server(Server.DEFAULT) + RequestBuilder().server(Server.PRODUCTION) .path('/product_families/{product_family_id}/components.json') .http_method(HttpMethodEnum.GET) .template_param(Parameter() diff --git a/advancedbilling/controllers/coupons_controller.py b/advancedbilling/controllers/coupons_controller.py index c6ff4dbe..e6218b0c 100644 --- a/advancedbilling/controllers/coupons_controller.py +++ b/advancedbilling/controllers/coupons_controller.py @@ -23,6 +23,7 @@ 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 @@ -49,19 +50,17 @@ def create_coupon(self, ns-and-Subscriptions). ## Create Coupon This request will create a coupon, based on the provided information. - When creating a coupon, you must specify a product family using the - `product_family_id`. If no `product_family_id` is passed, the first - product family available is used. You will also need to formulate your - URL to cite the Product Family ID in your request. + 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 hashes of `restricted_products` - and/or `restricted_components` in the format: - `{ "": boolean_value }` + 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 - body (CreateOrUpdateCoupon, optional): TODO: type description here. + body (CouponRequest, optional): TODO: type description here. Returns: CouponResponse: Response from the API. Created @@ -75,7 +74,7 @@ def create_coupon(self, """ return super().new_api_call_builder.request( - RequestBuilder().server(Server.DEFAULT) + RequestBuilder().server(Server.PRODUCTION) .path('/product_families/{product_family_id}/coupons.json') .http_method(HttpMethodEnum.POST) .template_param(Parameter() @@ -152,7 +151,7 @@ def list_coupons_for_product_family(self, """ return super().new_api_call_builder.request( - RequestBuilder().server(Server.DEFAULT) + RequestBuilder().server(Server.PRODUCTION) .path('/product_families/{product_family_id}/coupons.json') .http_method(HttpMethodEnum.GET) .template_param(Parameter() @@ -185,7 +184,8 @@ def list_coupons_for_product_family(self, def find_coupon(self, product_family_id=None, - code=None): + code=None, + currency_prices=None): """Does a GET request to /coupons/find.json. You can search for a coupon via the API with the find method. By @@ -200,6 +200,10 @@ def find_coupon(self, 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. Returns: CouponResponse: Response from the API. OK @@ -213,7 +217,7 @@ def find_coupon(self, """ return super().new_api_call_builder.request( - RequestBuilder().server(Server.DEFAULT) + RequestBuilder().server(Server.PRODUCTION) .path('/coupons/find.json') .http_method(HttpMethodEnum.GET) .query_param(Parameter() @@ -222,6 +226,9 @@ def find_coupon(self, .query_param(Parameter() .key('code') .value(code)) + .query_param(Parameter() + .key('currency_prices') + .value(currency_prices)) .header_param(Parameter() .key('accept') .value('application/json')) @@ -234,7 +241,8 @@ def find_coupon(self, def read_coupon(self, product_family_id, - coupon_id): + coupon_id, + currency_prices=None): """Does 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 @@ -253,6 +261,10 @@ def read_coupon(self, 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. Returns: CouponResponse: Response from the API. OK @@ -266,7 +278,7 @@ def read_coupon(self, """ return super().new_api_call_builder.request( - RequestBuilder().server(Server.DEFAULT) + RequestBuilder().server(Server.PRODUCTION) .path('/product_families/{product_family_id}/coupons/{coupon_id}.json') .http_method(HttpMethodEnum.GET) .template_param(Parameter() @@ -279,6 +291,9 @@ def read_coupon(self, .value(coupon_id) .is_required(True) .should_encode(True)) + .query_param(Parameter() + .key('currency_prices') + .value(currency_prices)) .header_param(Parameter() .key('accept') .value('application/json')) @@ -307,7 +322,7 @@ def update_coupon(self, 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 (CreateOrUpdateCoupon, optional): TODO: type description here. + body (CouponRequest, optional): TODO: type description here. Returns: CouponResponse: Response from the API. OK @@ -321,7 +336,7 @@ def update_coupon(self, """ return super().new_api_call_builder.request( - RequestBuilder().server(Server.DEFAULT) + RequestBuilder().server(Server.PRODUCTION) .path('/product_families/{product_family_id}/coupons/{coupon_id}.json') .http_method(HttpMethodEnum.PUT) .template_param(Parameter() @@ -348,6 +363,7 @@ def update_coupon(self, 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) ).execute() def archive_coupon(self, @@ -378,7 +394,7 @@ def archive_coupon(self, """ return super().new_api_call_builder.request( - RequestBuilder().server(Server.DEFAULT) + RequestBuilder().server(Server.PRODUCTION) .path('/product_families/{product_family_id}/coupons/{coupon_id}.json') .http_method(HttpMethodEnum.DELETE) .template_param(Parameter() @@ -451,7 +467,7 @@ def list_coupons(self, """ return super().new_api_call_builder.request( - RequestBuilder().server(Server.DEFAULT) + RequestBuilder().server(Server.PRODUCTION) .path('/coupons.json') .http_method(HttpMethodEnum.GET) .query_param(Parameter() @@ -502,7 +518,7 @@ def read_coupon_usage(self, """ return super().new_api_call_builder.request( - RequestBuilder().server(Server.DEFAULT) + RequestBuilder().server(Server.PRODUCTION) .path('/product_families/{product_family_id}/coupons/{coupon_id}/usage.json') .http_method(HttpMethodEnum.GET) .template_param(Parameter() @@ -574,7 +590,7 @@ def validate_coupon(self, """ return super().new_api_call_builder.request( - RequestBuilder().server(Server.DEFAULT) + RequestBuilder().server(Server.PRODUCTION) .path('/coupons/validate.json') .http_method(HttpMethodEnum.GET) .query_param(Parameter() @@ -626,7 +642,7 @@ def create_or_update_coupon_currency_prices(self, """ return super().new_api_call_builder.request( - RequestBuilder().server(Server.DEFAULT) + RequestBuilder().server(Server.PRODUCTION) .path('/coupons/{coupon_id}/currency_prices.json') .http_method(HttpMethodEnum.PUT) .template_param(Parameter() @@ -648,6 +664,7 @@ def create_or_update_coupon_currency_prices(self, 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) ).execute() def create_coupon_subcodes(self, @@ -712,7 +729,7 @@ def create_coupon_subcodes(self, """ return super().new_api_call_builder.request( - RequestBuilder().server(Server.DEFAULT) + RequestBuilder().server(Server.PRODUCTION) .path('/coupons/{coupon_id}/codes.json') .http_method(HttpMethodEnum.POST) .template_param(Parameter() @@ -778,7 +795,7 @@ def list_coupon_subcodes(self, """ return super().new_api_call_builder.request( - RequestBuilder().server(Server.DEFAULT) + RequestBuilder().server(Server.PRODUCTION) .path('/coupons/{coupon_id}/codes.json') .http_method(HttpMethodEnum.GET) .template_param(Parameter() @@ -833,7 +850,7 @@ def update_coupon_subcodes(self, """ return super().new_api_call_builder.request( - RequestBuilder().server(Server.DEFAULT) + RequestBuilder().server(Server.PRODUCTION) .path('/coupons/{coupon_id}/codes.json') .http_method(HttpMethodEnum.PUT) .template_param(Parameter() @@ -900,7 +917,7 @@ def delete_coupon_subcode(self, """ return super().new_api_call_builder.request( - RequestBuilder().server(Server.DEFAULT) + RequestBuilder().server(Server.PRODUCTION) .path('/coupons/{coupon_id}/codes/{subcode}.json') .http_method(HttpMethodEnum.DELETE) .template_param(Parameter() diff --git a/advancedbilling/controllers/custom_fields_controller.py b/advancedbilling/controllers/custom_fields_controller.py index f2df1133..625e6518 100644 --- a/advancedbilling/controllers/custom_fields_controller.py +++ b/advancedbilling/controllers/custom_fields_controller.py @@ -89,7 +89,7 @@ def create_metafields(self, """ return super().new_api_call_builder.request( - RequestBuilder().server(Server.DEFAULT) + RequestBuilder().server(Server.PRODUCTION) .path('/{resource_type}/metafields.json') .http_method(HttpMethodEnum.POST) .template_param(Parameter() @@ -161,7 +161,7 @@ def list_metafields(self, """ return super().new_api_call_builder.request( - RequestBuilder().server(Server.DEFAULT) + RequestBuilder().server(Server.PRODUCTION) .path('/{resource_type}/metafields.json') .http_method(HttpMethodEnum.GET) .template_param(Parameter() @@ -217,7 +217,7 @@ def update_metafield(self, """ return super().new_api_call_builder.request( - RequestBuilder().server(Server.DEFAULT) + RequestBuilder().server(Server.PRODUCTION) .path('/{resource_type}/metafields.json') .http_method(HttpMethodEnum.PUT) .template_param(Parameter() @@ -269,7 +269,7 @@ def delete_metafield(self, """ return super().new_api_call_builder.request( - RequestBuilder().server(Server.DEFAULT) + RequestBuilder().server(Server.PRODUCTION) .path('/{resource_type}/metafields.json') .http_method(HttpMethodEnum.DELETE) .template_param(Parameter() @@ -338,7 +338,7 @@ def create_metadata(self, """ return super().new_api_call_builder.request( - RequestBuilder().server(Server.DEFAULT) + RequestBuilder().server(Server.PRODUCTION) .path('/{resource_type}/{resource_id}/metadata.json') .http_method(HttpMethodEnum.POST) .template_param(Parameter() @@ -417,7 +417,7 @@ def list_metadata(self, """ return super().new_api_call_builder.request( - RequestBuilder().server(Server.DEFAULT) + RequestBuilder().server(Server.PRODUCTION) .path('/{resource_type}/{resource_id}/metadata.json') .http_method(HttpMethodEnum.GET) .template_param(Parameter() @@ -475,7 +475,7 @@ def update_metadata(self, """ return super().new_api_call_builder.request( - RequestBuilder().server(Server.DEFAULT) + RequestBuilder().server(Server.PRODUCTION) .path('/{resource_type}/{resource_id}/metadata.json') .http_method(HttpMethodEnum.PUT) .template_param(Parameter() @@ -553,7 +553,7 @@ def delete_metadata(self, """ return super().new_api_call_builder.request( - RequestBuilder().server(Server.DEFAULT) + RequestBuilder().server(Server.PRODUCTION) .path('/{resource_type}/{resource_id}/metadata.json') .http_method(HttpMethodEnum.DELETE) .template_param(Parameter() @@ -660,7 +660,7 @@ def list_metadata_for_resource_type(self, """ return super().new_api_call_builder.request( - RequestBuilder().server(Server.DEFAULT) + RequestBuilder().server(Server.PRODUCTION) .path('/{resource_type}/metadata.json') .http_method(HttpMethodEnum.GET) .template_param(Parameter() diff --git a/advancedbilling/controllers/customers_controller.py b/advancedbilling/controllers/customers_controller.py index e9e97439..04c7806c 100644 --- a/advancedbilling/controllers/customers_controller.py +++ b/advancedbilling/controllers/customers_controller.py @@ -84,7 +84,7 @@ def create_customer(self, """ return super().new_api_call_builder.request( - RequestBuilder().server(Server.DEFAULT) + RequestBuilder().server(Server.PRODUCTION) .path('/customers.json') .http_method(HttpMethodEnum.POST) .header_param(Parameter() @@ -187,7 +187,7 @@ def list_customers(self, """ return super().new_api_call_builder.request( - RequestBuilder().server(Server.DEFAULT) + RequestBuilder().server(Server.PRODUCTION) .path('/customers.json') .http_method(HttpMethodEnum.GET) .query_param(Parameter() @@ -249,7 +249,7 @@ def read_customer(self, """ return super().new_api_call_builder.request( - RequestBuilder().server(Server.DEFAULT) + RequestBuilder().server(Server.PRODUCTION) .path('/customers/{id}.json') .http_method(HttpMethodEnum.GET) .template_param(Parameter() @@ -291,7 +291,7 @@ def update_customer(self, """ return super().new_api_call_builder.request( - RequestBuilder().server(Server.DEFAULT) + RequestBuilder().server(Server.PRODUCTION) .path('/customers/{id}.json') .http_method(HttpMethodEnum.PUT) .template_param(Parameter() @@ -338,7 +338,7 @@ def delete_customer(self, """ return super().new_api_call_builder.request( - RequestBuilder().server(Server.DEFAULT) + RequestBuilder().server(Server.PRODUCTION) .path('/customers/{id}.json') .http_method(HttpMethodEnum.DELETE) .template_param(Parameter() @@ -371,7 +371,7 @@ def read_customer_by_reference(self, """ return super().new_api_call_builder.request( - RequestBuilder().server(Server.DEFAULT) + RequestBuilder().server(Server.PRODUCTION) .path('/customers/lookup.json') .http_method(HttpMethodEnum.GET) .query_param(Parameter() @@ -409,7 +409,7 @@ def list_customer_subscriptions(self, """ return super().new_api_call_builder.request( - RequestBuilder().server(Server.DEFAULT) + RequestBuilder().server(Server.PRODUCTION) .path('/customers/{customer_id}/subscriptions.json') .http_method(HttpMethodEnum.GET) .template_param(Parameter() diff --git a/advancedbilling/controllers/events_based_billing_segments_controller.py b/advancedbilling/controllers/events_based_billing_segments_controller.py index 35b36601..cd752471 100644 --- a/advancedbilling/controllers/events_based_billing_segments_controller.py +++ b/advancedbilling/controllers/events_based_billing_segments_controller.py @@ -61,7 +61,7 @@ def create_segment(self, """ return super().new_api_call_builder.request( - RequestBuilder().server(Server.DEFAULT) + RequestBuilder().server(Server.PRODUCTION) .path('/components/{component_id}/price_points/{price_point_id}/segments.json') .http_method(HttpMethodEnum.POST) .template_param(Parameter() @@ -143,7 +143,7 @@ def list_segments_for_price_point(self, """ return super().new_api_call_builder.request( - RequestBuilder().server(Server.DEFAULT) + RequestBuilder().server(Server.PRODUCTION) .path('/components/{component_id}/price_points/{price_point_id}/segments.json') .http_method(HttpMethodEnum.GET) .template_param(Parameter() @@ -209,7 +209,7 @@ def update_segment(self, """ return super().new_api_call_builder.request( - RequestBuilder().server(Server.DEFAULT) + RequestBuilder().server(Server.PRODUCTION) .path('/components/{component_id}/price_points/{price_point_id}/segments/{id}.json') .http_method(HttpMethodEnum.PUT) .template_param(Parameter() @@ -273,7 +273,7 @@ def delete_segment(self, """ return super().new_api_call_builder.request( - RequestBuilder().server(Server.DEFAULT) + RequestBuilder().server(Server.PRODUCTION) .path('/components/{component_id}/price_points/{price_point_id}/segments/{id}.json') .http_method(HttpMethodEnum.DELETE) .template_param(Parameter() @@ -327,7 +327,7 @@ def bulk_create_segments(self, """ return super().new_api_call_builder.request( - RequestBuilder().server(Server.DEFAULT) + RequestBuilder().server(Server.PRODUCTION) .path('/components/{component_id}/price_points/{price_point_id}/segments/bulk.json') .http_method(HttpMethodEnum.POST) .template_param(Parameter() @@ -391,7 +391,7 @@ def bulk_update_segments(self, """ return super().new_api_call_builder.request( - RequestBuilder().server(Server.DEFAULT) + RequestBuilder().server(Server.PRODUCTION) .path('/components/{component_id}/price_points/{price_point_id}/segments/bulk.json') .http_method(HttpMethodEnum.PUT) .template_param(Parameter() diff --git a/advancedbilling/controllers/events_controller.py b/advancedbilling/controllers/events_controller.py index 514cc5dd..714d6664 100644 --- a/advancedbilling/controllers/events_controller.py +++ b/advancedbilling/controllers/events_controller.py @@ -53,9 +53,17 @@ def list_events(self, integration) + `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). ## Event Specific Data - Event Specific Data - Each event type has its own `event_specific_data` specified. + 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 Here’s an example event for the `subscription_product_change` event: ``` { @@ -118,7 +126,7 @@ def list_events(self, or equal to the one specified direction -- Direction -- The sort direction of the returned events. - filter -- List[EventType] -- You can pass multiple event + 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 @@ -159,7 +167,7 @@ def list_events(self, """ return super().new_api_call_builder.request( - RequestBuilder().server(Server.DEFAULT) + RequestBuilder().server(Server.PRODUCTION) .path('/events.json') .http_method(HttpMethodEnum.GET) .query_param(Parameter() @@ -211,7 +219,16 @@ def list_subscription_events(self, """Does a GET request to /subscriptions/{subscription_id}/events.json. The following request will return a list of events for a subscription. - Each event type has its own `event_specific_data` specified. + ## Event Key + 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. + 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 @@ -242,7 +259,7 @@ def list_subscription_events(self, or equal to the one specified direction -- Direction -- The sort direction of the returned events. - filter -- List[EventType] -- You can pass multiple event + filter -- List[EventKey] -- You can pass multiple event keys after comma. Use in query `filter=signup_success,payment_success`. @@ -258,7 +275,7 @@ def list_subscription_events(self, """ return super().new_api_call_builder.request( - RequestBuilder().server(Server.DEFAULT) + RequestBuilder().server(Server.PRODUCTION) .path('/subscriptions/{subscription_id}/events.json') .http_method(HttpMethodEnum.GET) .template_param(Parameter() @@ -328,7 +345,7 @@ def read_events_count(self, or equal to the one specified direction -- Direction -- The sort direction of the returned events. - filter -- List[EventType] -- You can pass multiple event + filter -- List[EventKey] -- You can pass multiple event keys after comma. Use in query `filter=signup_success,payment_success`. @@ -344,7 +361,7 @@ def read_events_count(self, """ return super().new_api_call_builder.request( - RequestBuilder().server(Server.DEFAULT) + RequestBuilder().server(Server.PRODUCTION) .path('/events/count.json') .http_method(HttpMethodEnum.GET) .query_param(Parameter() diff --git a/advancedbilling/controllers/insights_controller.py b/advancedbilling/controllers/insights_controller.py index 180d497e..aa7b030f 100644 --- a/advancedbilling/controllers/insights_controller.py +++ b/advancedbilling/controllers/insights_controller.py @@ -55,7 +55,7 @@ def read_site_stats(self): """ return super().new_api_call_builder.request( - RequestBuilder().server(Server.DEFAULT) + RequestBuilder().server(Server.PRODUCTION) .path('/stats.json') .http_method(HttpMethodEnum.GET) .header_param(Parameter() @@ -95,7 +95,7 @@ def read_mrr(self, """ return super().new_api_call_builder.request( - RequestBuilder().server(Server.DEFAULT) + RequestBuilder().server(Server.PRODUCTION) .path('/mrr.json') .http_method(HttpMethodEnum.GET) .query_param(Parameter() @@ -183,7 +183,7 @@ def list_mrr_movements(self, """ return super().new_api_call_builder.request( - RequestBuilder().server(Server.DEFAULT) + RequestBuilder().server(Server.PRODUCTION) .path('/mrr_movements.json') .http_method(HttpMethodEnum.GET) .query_param(Parameter() @@ -259,7 +259,7 @@ def list_mrr_per_subscription(self, """ return super().new_api_call_builder.request( - RequestBuilder().server(Server.DEFAULT) + RequestBuilder().server(Server.PRODUCTION) .path('/subscriptions_mrr.json') .http_method(HttpMethodEnum.GET) .query_param(Parameter() diff --git a/advancedbilling/controllers/invoices_controller.py b/advancedbilling/controllers/invoices_controller.py index 5dff3500..94b1eae4 100644 --- a/advancedbilling/controllers/invoices_controller.py +++ b/advancedbilling/controllers/invoices_controller.py @@ -67,7 +67,7 @@ def refund_invoice(self, """ return super().new_api_call_builder.request( - RequestBuilder().server(Server.DEFAULT) + RequestBuilder().server(Server.PRODUCTION) .path('/invoices/{uid}/refunds.json') .http_method(HttpMethodEnum.POST) .template_param(Parameter() @@ -192,7 +192,7 @@ def list_invoices(self, """ return super().new_api_call_builder.request( - RequestBuilder().server(Server.DEFAULT) + RequestBuilder().server(Server.PRODUCTION) .path('/invoices.json') .http_method(HttpMethodEnum.GET) .query_param(Parameter() @@ -306,7 +306,7 @@ def read_invoice(self, """ return super().new_api_call_builder.request( - RequestBuilder().server(Server.DEFAULT) + RequestBuilder().server(Server.PRODUCTION) .path('/invoices/{uid}.json') .http_method(HttpMethodEnum.GET) .template_param(Parameter() @@ -406,7 +406,7 @@ def list_invoice_events(self, """ return super().new_api_call_builder.request( - RequestBuilder().server(Server.DEFAULT) + RequestBuilder().server(Server.PRODUCTION) .path('/invoices/events.json') .http_method(HttpMethodEnum.GET) .query_param(Parameter() @@ -513,7 +513,7 @@ def record_payment_for_invoice(self, """ return super().new_api_call_builder.request( - RequestBuilder().server(Server.DEFAULT) + RequestBuilder().server(Server.PRODUCTION) .path('/invoices/{uid}/payments.json') .http_method(HttpMethodEnum.POST) .template_param(Parameter() @@ -586,7 +586,7 @@ def record_payment_for_multiple_invoices(self, """ return super().new_api_call_builder.request( - RequestBuilder().server(Server.DEFAULT) + RequestBuilder().server(Server.PRODUCTION) .path('/invoices/payments.json') .http_method(HttpMethodEnum.POST) .header_param(Parameter() @@ -658,7 +658,7 @@ def list_credit_notes(self, """ return super().new_api_call_builder.request( - RequestBuilder().server(Server.DEFAULT) + RequestBuilder().server(Server.PRODUCTION) .path('/credit_notes.json') .http_method(HttpMethodEnum.GET) .query_param(Parameter() @@ -716,7 +716,7 @@ def read_credit_note(self, """ return super().new_api_call_builder.request( - RequestBuilder().server(Server.DEFAULT) + RequestBuilder().server(Server.PRODUCTION) .path('/credit_notes/{uid}.json') .http_method(HttpMethodEnum.GET) .template_param(Parameter() @@ -765,7 +765,7 @@ def record_payment_for_subscription(self, """ return super().new_api_call_builder.request( - RequestBuilder().server(Server.DEFAULT) + RequestBuilder().server(Server.PRODUCTION) .path('/subscriptions/{subscription_id}/payments.json') .http_method(HttpMethodEnum.POST) .template_param(Parameter() @@ -829,7 +829,7 @@ def reopen_invoice(self, """ return super().new_api_call_builder.request( - RequestBuilder().server(Server.DEFAULT) + RequestBuilder().server(Server.PRODUCTION) .path('/invoices/{uid}/reopen.json') .http_method(HttpMethodEnum.POST) .template_param(Parameter() @@ -875,7 +875,7 @@ def void_invoice(self, """ return super().new_api_call_builder.request( - RequestBuilder().server(Server.DEFAULT) + RequestBuilder().server(Server.PRODUCTION) .path('/invoices/{uid}/void.json') .http_method(HttpMethodEnum.POST) .template_param(Parameter() @@ -947,7 +947,7 @@ def list_consolidated_invoice_segments(self, """ return super().new_api_call_builder.request( - RequestBuilder().server(Server.DEFAULT) + RequestBuilder().server(Server.PRODUCTION) .path('/invoices/{invoice_uid}/segments.json') .http_method(HttpMethodEnum.GET) .template_param(Parameter() @@ -1165,7 +1165,7 @@ def create_invoice(self, """ return super().new_api_call_builder.request( - RequestBuilder().server(Server.DEFAULT) + RequestBuilder().server(Server.PRODUCTION) .path('/subscriptions/{subscription_id}/invoices.json') .http_method(HttpMethodEnum.POST) .template_param(Parameter() @@ -1228,7 +1228,7 @@ def send_invoice(self, """ return super().new_api_call_builder.request( - RequestBuilder().server(Server.DEFAULT) + RequestBuilder().server(Server.PRODUCTION) .path('/invoices/{uid}/deliveries.json') .http_method(HttpMethodEnum.POST) .template_param(Parameter() @@ -1272,7 +1272,7 @@ def preview_customer_information_changes(self, """ return super().new_api_call_builder.request( - RequestBuilder().server(Server.DEFAULT) + RequestBuilder().server(Server.PRODUCTION) .path('/invoices/{uid}/customer_information/preview.json') .http_method(HttpMethodEnum.POST) .template_param(Parameter() @@ -1319,7 +1319,7 @@ def update_customer_information(self, """ return super().new_api_call_builder.request( - RequestBuilder().server(Server.DEFAULT) + RequestBuilder().server(Server.PRODUCTION) .path('/invoices/{uid}/customer_information.json') .http_method(HttpMethodEnum.PUT) .template_param(Parameter() @@ -1390,7 +1390,7 @@ def issue_invoice(self, """ return super().new_api_call_builder.request( - RequestBuilder().server(Server.DEFAULT) + RequestBuilder().server(Server.PRODUCTION) .path('/invoices/{uid}/issue.json') .http_method(HttpMethodEnum.POST) .template_param(Parameter() diff --git a/advancedbilling/controllers/offers_controller.py b/advancedbilling/controllers/offers_controller.py index 1b1c03b1..1c2fbaa5 100644 --- a/advancedbilling/controllers/offers_controller.py +++ b/advancedbilling/controllers/offers_controller.py @@ -18,6 +18,7 @@ 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 class OffersController(BaseController): @@ -63,7 +64,7 @@ def create_offer(self, """ return super().new_api_call_builder.request( - RequestBuilder().server(Server.DEFAULT) + RequestBuilder().server(Server.PRODUCTION) .path('/offers.json') .http_method(HttpMethodEnum.POST) .header_param(Parameter() @@ -125,7 +126,7 @@ def list_offers(self, """ return super().new_api_call_builder.request( - RequestBuilder().server(Server.DEFAULT) + RequestBuilder().server(Server.PRODUCTION) .path('/offers.json') .http_method(HttpMethodEnum.GET) .query_param(Parameter() @@ -145,6 +146,7 @@ def list_offers(self, 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) ).execute() def read_offer(self, @@ -170,7 +172,7 @@ def read_offer(self, """ return super().new_api_call_builder.request( - RequestBuilder().server(Server.DEFAULT) + RequestBuilder().server(Server.PRODUCTION) .path('/offers/{offer_id}.json') .http_method(HttpMethodEnum.GET) .template_param(Parameter() @@ -210,7 +212,7 @@ def archive_offer(self, """ return super().new_api_call_builder.request( - RequestBuilder().server(Server.DEFAULT) + RequestBuilder().server(Server.PRODUCTION) .path('/offers/{offer_id}/archive.json') .http_method(HttpMethodEnum.PUT) .template_param(Parameter() @@ -243,7 +245,7 @@ def unarchive_offer(self, """ return super().new_api_call_builder.request( - RequestBuilder().server(Server.DEFAULT) + RequestBuilder().server(Server.PRODUCTION) .path('/offers/{offer_id}/unarchive.json') .http_method(HttpMethodEnum.PUT) .template_param(Parameter() diff --git a/advancedbilling/controllers/payment_profiles_controller.py b/advancedbilling/controllers/payment_profiles_controller.py index 899983bc..b758577c 100644 --- a/advancedbilling/controllers/payment_profiles_controller.py +++ b/advancedbilling/controllers/payment_profiles_controller.py @@ -374,7 +374,7 @@ def create_payment_profile(self, """ return super().new_api_call_builder.request( - RequestBuilder().server(Server.DEFAULT) + RequestBuilder().server(Server.PRODUCTION) .path('/payment_profiles.json') .http_method(HttpMethodEnum.POST) .header_param(Parameter() @@ -439,7 +439,7 @@ def list_payment_profiles(self, """ return super().new_api_call_builder.request( - RequestBuilder().server(Server.DEFAULT) + RequestBuilder().server(Server.PRODUCTION) .path('/payment_profiles.json') .http_method(HttpMethodEnum.GET) .query_param(Parameter() @@ -514,7 +514,7 @@ def read_payment_profile(self, """ return super().new_api_call_builder.request( - RequestBuilder().server(Server.DEFAULT) + RequestBuilder().server(Server.PRODUCTION) .path('/payment_profiles/{payment_profile_id}.json') .http_method(HttpMethodEnum.GET) .template_param(Parameter() @@ -598,7 +598,7 @@ def update_payment_profile(self, """ return super().new_api_call_builder.request( - RequestBuilder().server(Server.DEFAULT) + RequestBuilder().server(Server.PRODUCTION) .path('/payment_profiles/{payment_profile_id}.json') .http_method(HttpMethodEnum.PUT) .template_param(Parameter() @@ -647,7 +647,7 @@ def delete_unused_payment_profile(self, """ return super().new_api_call_builder.request( - RequestBuilder().server(Server.DEFAULT) + RequestBuilder().server(Server.PRODUCTION) .path('/payment_profiles/{payment_profile_id}.json') .http_method(HttpMethodEnum.DELETE) .template_param(Parameter() @@ -691,7 +691,7 @@ def delete_subscriptions_payment_profile(self, """ return super().new_api_call_builder.request( - RequestBuilder().server(Server.DEFAULT) + RequestBuilder().server(Server.PRODUCTION) .path('/subscriptions/{subscription_id}/payment_profiles/{payment_profile_id}.json') .http_method(HttpMethodEnum.DELETE) .template_param(Parameter() @@ -733,7 +733,7 @@ def verify_bank_account(self, """ return super().new_api_call_builder.request( - RequestBuilder().server(Server.DEFAULT) + RequestBuilder().server(Server.PRODUCTION) .path('/bank_accounts/{bank_account_id}/verification.json') .http_method(HttpMethodEnum.PUT) .template_param(Parameter() @@ -784,7 +784,7 @@ def delete_subscription_group_payment_profile(self, """ return super().new_api_call_builder.request( - RequestBuilder().server(Server.DEFAULT) + RequestBuilder().server(Server.PRODUCTION) .path('/subscription_groups/{uid}/payment_profiles/{payment_profile_id}.json') .http_method(HttpMethodEnum.DELETE) .template_param(Parameter() @@ -827,7 +827,7 @@ def change_subscription_default_payment_profile(self, """ return super().new_api_call_builder.request( - RequestBuilder().server(Server.DEFAULT) + RequestBuilder().server(Server.PRODUCTION) .path('/subscriptions/{subscription_id}/payment_profiles/{payment_profile_id}/change_payment_profile.json') .http_method(HttpMethodEnum.POST) .template_param(Parameter() @@ -881,7 +881,7 @@ def change_subscription_group_default_payment_profile(self, """ return super().new_api_call_builder.request( - RequestBuilder().server(Server.DEFAULT) + RequestBuilder().server(Server.PRODUCTION) .path('/subscription_groups/{uid}/payment_profiles/{payment_profile_id}/change_payment_profile.json') .http_method(HttpMethodEnum.POST) .template_param(Parameter() @@ -933,7 +933,7 @@ def read_one_time_token(self, """ return super().new_api_call_builder.request( - RequestBuilder().server(Server.DEFAULT) + RequestBuilder().server(Server.PRODUCTION) .path('/one_time_tokens/{chargify_token}.json') .http_method(HttpMethodEnum.GET) .template_param(Parameter() @@ -987,7 +987,7 @@ def send_request_update_payment_email(self, """ return super().new_api_call_builder.request( - RequestBuilder().server(Server.DEFAULT) + RequestBuilder().server(Server.PRODUCTION) .path('/subscriptions/{subscription_id}/request_payment_profiles_update.json') .http_method(HttpMethodEnum.POST) .template_param(Parameter() diff --git a/advancedbilling/controllers/product_families_controller.py b/advancedbilling/controllers/product_families_controller.py index f60e5c92..21b94ceb 100644 --- a/advancedbilling/controllers/product_families_controller.py +++ b/advancedbilling/controllers/product_families_controller.py @@ -63,22 +63,22 @@ def list_products_for_product_family(self, `date_field=created_at`. filter -- ListProductsFilter -- Filter to use for List Products operations - start_date -- str -- The start date (format YYYY-MM-DD) + 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 -- str -- The end date (format YYYY-MM-DD) with + 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 -- str -- The start date and time (format - YYYY-MM-DD HH:MM:SS) with which to filter the + 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 -- str -- The end date and time (format + 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 @@ -102,7 +102,7 @@ def list_products_for_product_family(self, """ return super().new_api_call_builder.request( - RequestBuilder().server(Server.DEFAULT) + RequestBuilder().server(Server.PRODUCTION) .path('/product_families/{product_family_id}/products.json') .http_method(HttpMethodEnum.GET) .template_param(Parameter() @@ -130,10 +130,10 @@ def list_products_for_product_family(self, .value(options.get('end_date', None))) .query_param(Parameter() .key('start_datetime') - .value(options.get('start_datetime', None))) + .value(APIHelper.when_defined(APIHelper.RFC3339DateTime, options.get('start_datetime', None)))) .query_param(Parameter() .key('end_datetime') - .value(options.get('end_datetime', None))) + .value(APIHelper.when_defined(APIHelper.RFC3339DateTime, options.get('end_datetime', None)))) .query_param(Parameter() .key('include_archived') .value(options.get('include_archived', None))) @@ -180,7 +180,7 @@ def create_product_family(self, """ return super().new_api_call_builder.request( - RequestBuilder().server(Server.DEFAULT) + RequestBuilder().server(Server.PRODUCTION) .path('/product_families.json') .http_method(HttpMethodEnum.POST) .header_param(Parameter() @@ -216,22 +216,22 @@ def list_product_families(self, 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) + 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 -- str -- The end date (format YYYY-MM-DD) with + 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 -- str -- The start date and time (format - YYYY-MM-DD HH:MM:SS) with which to filter the + 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 -- str -- The end date and time (format + 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 @@ -251,7 +251,7 @@ def list_product_families(self, """ return super().new_api_call_builder.request( - RequestBuilder().server(Server.DEFAULT) + RequestBuilder().server(Server.PRODUCTION) .path('/product_families.json') .http_method(HttpMethodEnum.GET) .query_param(Parameter() @@ -265,10 +265,10 @@ def list_product_families(self, .value(options.get('end_date', None))) .query_param(Parameter() .key('start_datetime') - .value(options.get('start_datetime', None))) + .value(APIHelper.when_defined(APIHelper.RFC3339DateTime, options.get('start_datetime', None)))) .query_param(Parameter() .key('end_datetime') - .value(options.get('end_datetime', None))) + .value(APIHelper.when_defined(APIHelper.RFC3339DateTime, options.get('end_datetime', None)))) .header_param(Parameter() .key('accept') .value('application/json')) @@ -303,7 +303,7 @@ def read_product_family(self, """ return super().new_api_call_builder.request( - RequestBuilder().server(Server.DEFAULT) + RequestBuilder().server(Server.PRODUCTION) .path('/product_families/{id}.json') .http_method(HttpMethodEnum.GET) .template_param(Parameter() diff --git a/advancedbilling/controllers/product_price_points_controller.py b/advancedbilling/controllers/product_price_points_controller.py index 81547710..3e3d72b0 100644 --- a/advancedbilling/controllers/product_price_points_controller.py +++ b/advancedbilling/controllers/product_price_points_controller.py @@ -61,7 +61,7 @@ def create_product_price_point(self, """ return super().new_api_call_builder.request( - RequestBuilder().server(Server.DEFAULT) + RequestBuilder().server(Server.PRODUCTION) .path('/products/{product_id}/price_points.json') .http_method(HttpMethodEnum.POST) .template_param(Parameter() @@ -127,6 +127,8 @@ def list_product_price_points(self, 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. Returns: ListProductPricePointsResponse: Response from the API. OK @@ -140,7 +142,7 @@ def list_product_price_points(self, """ return super().new_api_call_builder.request( - RequestBuilder().server(Server.DEFAULT) + RequestBuilder().server(Server.PRODUCTION) .path('/products/{product_id}/price_points.json') .http_method(HttpMethodEnum.GET) .template_param(Parameter() @@ -161,6 +163,9 @@ def list_product_price_points(self, .query_param(Parameter() .key('filter[type]') .value(options.get('filter_type', None))) + .query_param(Parameter() + .key('archived') + .value(options.get('archived', None))) .header_param(Parameter() .key('accept') .value('application/json')) @@ -206,7 +211,7 @@ def update_product_price_point(self, """ return super().new_api_call_builder.request( - RequestBuilder().server(Server.DEFAULT) + RequestBuilder().server(Server.PRODUCTION) .path('/products/{product_id}/price_points/{price_point_id}.json') .http_method(HttpMethodEnum.PUT) .template_param(Parameter() @@ -278,7 +283,7 @@ def read_product_price_point(self, """ return super().new_api_call_builder.request( - RequestBuilder().server(Server.DEFAULT) + RequestBuilder().server(Server.PRODUCTION) .path('/products/{product_id}/price_points/{price_point_id}.json') .http_method(HttpMethodEnum.GET) .template_param(Parameter() @@ -336,7 +341,7 @@ def archive_product_price_point(self, """ return super().new_api_call_builder.request( - RequestBuilder().server(Server.DEFAULT) + RequestBuilder().server(Server.PRODUCTION) .path('/products/{product_id}/price_points/{price_point_id}.json') .http_method(HttpMethodEnum.DELETE) .template_param(Parameter() @@ -387,7 +392,7 @@ def unarchive_product_price_point(self, """ return super().new_api_call_builder.request( - RequestBuilder().server(Server.DEFAULT) + RequestBuilder().server(Server.PRODUCTION) .path('/products/{product_id}/price_points/{price_point_id}/unarchive.json') .http_method(HttpMethodEnum.PATCH) .template_param(Parameter() @@ -438,7 +443,7 @@ def promote_product_price_point_to_default(self, """ return super().new_api_call_builder.request( - RequestBuilder().server(Server.DEFAULT) + RequestBuilder().server(Server.PRODUCTION) .path('/products/{product_id}/price_points/{price_point_id}/default.json') .http_method(HttpMethodEnum.PATCH) .template_param(Parameter() @@ -488,7 +493,7 @@ def bulk_create_product_price_points(self, """ return super().new_api_call_builder.request( - RequestBuilder().server(Server.DEFAULT) + RequestBuilder().server(Server.PRODUCTION) .path('/products/{product_id}/price_points/bulk.json') .http_method(HttpMethodEnum.POST) .template_param(Parameter() @@ -545,7 +550,7 @@ def create_product_currency_prices(self, """ return super().new_api_call_builder.request( - RequestBuilder().server(Server.DEFAULT) + RequestBuilder().server(Server.PRODUCTION) .path('/product_price_points/{product_price_point_id}/currency_prices.json') .http_method(HttpMethodEnum.POST) .template_param(Parameter() @@ -601,7 +606,7 @@ def update_product_currency_prices(self, """ return super().new_api_call_builder.request( - RequestBuilder().server(Server.DEFAULT) + RequestBuilder().server(Server.PRODUCTION) .path('/product_price_points/{product_price_point_id}/currency_prices.json') .http_method(HttpMethodEnum.PUT) .template_param(Parameter() @@ -675,7 +680,7 @@ def list_all_product_price_points(self, """ return super().new_api_call_builder.request( - RequestBuilder().server(Server.DEFAULT) + RequestBuilder().server(Server.PRODUCTION) .path('/products_price_points.json') .http_method(HttpMethodEnum.GET) .query_param(Parameter() diff --git a/advancedbilling/controllers/products_controller.py b/advancedbilling/controllers/products_controller.py index f243c0bb..1364d972 100644 --- a/advancedbilling/controllers/products_controller.py +++ b/advancedbilling/controllers/products_controller.py @@ -57,7 +57,7 @@ def create_product(self, """ return super().new_api_call_builder.request( - RequestBuilder().server(Server.DEFAULT) + RequestBuilder().server(Server.PRODUCTION) .path('/product_families/{product_family_id}/products.json') .http_method(HttpMethodEnum.POST) .template_param(Parameter() @@ -104,7 +104,7 @@ def read_product(self, """ return super().new_api_call_builder.request( - RequestBuilder().server(Server.DEFAULT) + RequestBuilder().server(Server.PRODUCTION) .path('/products/{product_id}.json') .http_method(HttpMethodEnum.GET) .template_param(Parameter() @@ -154,7 +154,7 @@ def update_product(self, """ return super().new_api_call_builder.request( - RequestBuilder().server(Server.DEFAULT) + RequestBuilder().server(Server.PRODUCTION) .path('/products/{product_id}.json') .http_method(HttpMethodEnum.PUT) .template_param(Parameter() @@ -205,7 +205,7 @@ def archive_product(self, """ return super().new_api_call_builder.request( - RequestBuilder().server(Server.DEFAULT) + RequestBuilder().server(Server.PRODUCTION) .path('/products/{product_id}.json') .http_method(HttpMethodEnum.DELETE) .template_param(Parameter() @@ -245,7 +245,7 @@ def read_product_by_handle(self, """ return super().new_api_call_builder.request( - RequestBuilder().server(Server.DEFAULT) + RequestBuilder().server(Server.PRODUCTION) .path('/products/handle/{api_handle}.json') .http_method(HttpMethodEnum.GET) .template_param(Parameter() @@ -335,7 +335,7 @@ def list_products(self, """ return super().new_api_call_builder.request( - RequestBuilder().server(Server.DEFAULT) + RequestBuilder().server(Server.PRODUCTION) .path('/products.json') .http_method(HttpMethodEnum.GET) .query_param(Parameter() diff --git a/advancedbilling/controllers/proforma_invoices_controller.py b/advancedbilling/controllers/proforma_invoices_controller.py index a6957fe9..43ec9d9d 100644 --- a/advancedbilling/controllers/proforma_invoices_controller.py +++ b/advancedbilling/controllers/proforma_invoices_controller.py @@ -62,7 +62,7 @@ def create_consolidated_proforma_invoice(self, """ return super().new_api_call_builder.request( - RequestBuilder().server(Server.DEFAULT) + RequestBuilder().server(Server.PRODUCTION) .path('/subscription_groups/{uid}/proforma_invoices.json') .http_method(HttpMethodEnum.POST) .template_param(Parameter() @@ -112,7 +112,7 @@ def list_subscription_group_proforma_invoices(self, """ return super().new_api_call_builder.request( - RequestBuilder().server(Server.DEFAULT) + RequestBuilder().server(Server.PRODUCTION) .path('/subscription_groups/{uid}/proforma_invoices.json') .http_method(HttpMethodEnum.GET) .template_param(Parameter() @@ -172,7 +172,7 @@ def read_proforma_invoice(self, """ return super().new_api_call_builder.request( - RequestBuilder().server(Server.DEFAULT) + RequestBuilder().server(Server.PRODUCTION) .path('/proforma_invoices/{proforma_invoice_uid}.json') .http_method(HttpMethodEnum.GET) .template_param(Parameter() @@ -221,7 +221,7 @@ def create_proforma_invoice(self, """ return super().new_api_call_builder.request( - RequestBuilder().server(Server.DEFAULT) + RequestBuilder().server(Server.PRODUCTION) .path('/subscriptions/{subscription_id}/proforma_invoices.json') .http_method(HttpMethodEnum.POST) .template_param(Parameter() @@ -301,7 +301,7 @@ def list_proforma_invoices(self, """ return super().new_api_call_builder.request( - RequestBuilder().server(Server.DEFAULT) + RequestBuilder().server(Server.PRODUCTION) .path('/subscriptions/{subscription_id}/proforma_invoices.json') .http_method(HttpMethodEnum.GET) .template_param(Parameter() @@ -387,7 +387,7 @@ def void_proforma_invoice(self, """ return super().new_api_call_builder.request( - RequestBuilder().server(Server.DEFAULT) + RequestBuilder().server(Server.PRODUCTION) .path('/proforma_invoices/{proforma_invoice_uid}/void.json') .http_method(HttpMethodEnum.POST) .template_param(Parameter() @@ -450,7 +450,7 @@ def preview_proforma_invoice(self, """ return super().new_api_call_builder.request( - RequestBuilder().server(Server.DEFAULT) + RequestBuilder().server(Server.PRODUCTION) .path('/subscriptions/{subscription_id}/proforma_invoices/preview.json') .http_method(HttpMethodEnum.POST) .template_param(Parameter() @@ -505,7 +505,7 @@ def create_signup_proforma_invoice(self, """ return super().new_api_call_builder.request( - RequestBuilder().server(Server.DEFAULT) + RequestBuilder().server(Server.PRODUCTION) .path('/subscriptions/proforma_invoices.json') .http_method(HttpMethodEnum.POST) .header_param(Parameter() @@ -564,7 +564,7 @@ def preview_signup_proforma_invoice(self, """ return super().new_api_call_builder.request( - RequestBuilder().server(Server.DEFAULT) + RequestBuilder().server(Server.PRODUCTION) .path('/subscriptions/proforma_invoices/preview.json') .http_method(HttpMethodEnum.POST) .header_param(Parameter() diff --git a/advancedbilling/controllers/reason_codes_controller.py b/advancedbilling/controllers/reason_codes_controller.py index 24d54de3..d13681bb 100644 --- a/advancedbilling/controllers/reason_codes_controller.py +++ b/advancedbilling/controllers/reason_codes_controller.py @@ -16,7 +16,7 @@ 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.reason_codes_json_response import ReasonCodesJsonResponse +from advancedbilling.models.ok_response import OkResponse from advancedbilling.exceptions.error_list_response_exception import ErrorListResponseException from advancedbilling.exceptions.api_exception import APIException @@ -63,7 +63,7 @@ def create_reason_code(self, """ return super().new_api_call_builder.request( - RequestBuilder().server(Server.DEFAULT) + RequestBuilder().server(Server.PRODUCTION) .path('/reason_codes.json') .http_method(HttpMethodEnum.POST) .header_param(Parameter() @@ -124,7 +124,7 @@ def list_reason_codes(self, """ return super().new_api_call_builder.request( - RequestBuilder().server(Server.DEFAULT) + RequestBuilder().server(Server.PRODUCTION) .path('/reason_codes.json') .http_method(HttpMethodEnum.GET) .query_param(Parameter() @@ -141,6 +141,7 @@ def list_reason_codes(self, 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) ).execute() def read_reason_code(self, @@ -166,7 +167,7 @@ def read_reason_code(self, """ return super().new_api_call_builder.request( - RequestBuilder().server(Server.DEFAULT) + RequestBuilder().server(Server.PRODUCTION) .path('/reason_codes/{reason_code_id}.json') .http_method(HttpMethodEnum.GET) .template_param(Parameter() @@ -210,7 +211,7 @@ def update_reason_code(self, """ return super().new_api_call_builder.request( - RequestBuilder().server(Server.DEFAULT) + RequestBuilder().server(Server.PRODUCTION) .path('/reason_codes/{reason_code_id}.json') .http_method(HttpMethodEnum.PUT) .template_param(Parameter() @@ -233,6 +234,7 @@ def update_reason_code(self, .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) ).execute() def delete_reason_code(self, @@ -247,7 +249,7 @@ def delete_reason_code(self, reason_code_id (int): The Advanced Billing id of the reason code Returns: - ReasonCodesJsonResponse: Response from the API. OK + OkResponse: Response from the API. OK Raises: APIException: When an error occurs while fetching the data from @@ -258,7 +260,7 @@ def delete_reason_code(self, """ return super().new_api_call_builder.request( - RequestBuilder().server(Server.DEFAULT) + RequestBuilder().server(Server.PRODUCTION) .path('/reason_codes/{reason_code_id}.json') .http_method(HttpMethodEnum.DELETE) .template_param(Parameter() @@ -273,6 +275,6 @@ def delete_reason_code(self, ).response( ResponseHandler() .deserializer(APIHelper.json_deserialize) - .deserialize_into(ReasonCodesJsonResponse.from_dictionary) + .deserialize_into(OkResponse.from_dictionary) .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 9e674c7a..2b80a3dd 100644 --- a/advancedbilling/controllers/referral_codes_controller.py +++ b/advancedbilling/controllers/referral_codes_controller.py @@ -57,7 +57,7 @@ def validate_referral_code(self, """ return super().new_api_call_builder.request( - RequestBuilder().server(Server.DEFAULT) + RequestBuilder().server(Server.PRODUCTION) .path('/referral_codes/validate.json') .http_method(HttpMethodEnum.GET) .query_param(Parameter() diff --git a/advancedbilling/controllers/sales_commissions_controller.py b/advancedbilling/controllers/sales_commissions_controller.py index 8c6b1748..9008c860 100644 --- a/advancedbilling/controllers/sales_commissions_controller.py +++ b/advancedbilling/controllers/sales_commissions_controller.py @@ -88,7 +88,7 @@ def list_sales_commission_settings(self, """ return super().new_api_call_builder.request( - RequestBuilder().server(Server.DEFAULT) + RequestBuilder().server(Server.PRODUCTION) .path('/sellers/{seller_id}/sales_commission_settings.json') .http_method(HttpMethodEnum.GET) .template_param(Parameter() @@ -180,7 +180,7 @@ def list_sales_reps(self, """ return super().new_api_call_builder.request( - RequestBuilder().server(Server.DEFAULT) + RequestBuilder().server(Server.PRODUCTION) .path('/sellers/{seller_id}/sales_reps.json') .http_method(HttpMethodEnum.GET) .template_param(Parameter() @@ -269,7 +269,7 @@ def read_sales_rep(self, """ return super().new_api_call_builder.request( - RequestBuilder().server(Server.DEFAULT) + RequestBuilder().server(Server.PRODUCTION) .path('/sellers/{seller_id}/sales_reps/{sales_rep_id}.json') .http_method(HttpMethodEnum.GET) .template_param(Parameter() diff --git a/advancedbilling/controllers/sites_controller.py b/advancedbilling/controllers/sites_controller.py index 09cc19c0..22331ba3 100644 --- a/advancedbilling/controllers/sites_controller.py +++ b/advancedbilling/controllers/sites_controller.py @@ -58,7 +58,7 @@ def read_site(self): """ return super().new_api_call_builder.request( - RequestBuilder().server(Server.DEFAULT) + RequestBuilder().server(Server.PRODUCTION) .path('/site.json') .http_method(HttpMethodEnum.GET) .header_param(Parameter() @@ -103,7 +103,7 @@ def clear_site(self, """ return super().new_api_call_builder.request( - RequestBuilder().server(Server.DEFAULT) + RequestBuilder().server(Server.PRODUCTION) .path('/sites/clear_data.json') .http_method(HttpMethodEnum.POST) .query_param(Parameter() @@ -152,7 +152,7 @@ def list_chargify_js_public_keys(self, """ return super().new_api_call_builder.request( - RequestBuilder().server(Server.DEFAULT) + RequestBuilder().server(Server.PRODUCTION) .path('/chargify_js_keys.json') .http_method(HttpMethodEnum.GET) .query_param(Parameter() diff --git a/advancedbilling/controllers/subscription_components_controller.py b/advancedbilling/controllers/subscription_components_controller.py index 32d3cb9f..58cda37e 100644 --- a/advancedbilling/controllers/subscription_components_controller.py +++ b/advancedbilling/controllers/subscription_components_controller.py @@ -62,7 +62,7 @@ def read_subscription_component(self, """ return super().new_api_call_builder.request( - RequestBuilder().server(Server.DEFAULT) + RequestBuilder().server(Server.PRODUCTION) .path('/subscriptions/{subscription_id}/components/{component_id}.json') .http_method(HttpMethodEnum.GET) .template_param(Parameter() @@ -165,7 +165,7 @@ def list_subscription_components(self, """ return super().new_api_call_builder.request( - RequestBuilder().server(Server.DEFAULT) + RequestBuilder().server(Server.PRODUCTION) .path('/subscriptions/{subscription_id}/components.json') .http_method(HttpMethodEnum.GET) .template_param(Parameter() @@ -249,7 +249,7 @@ def bulk_update_subscription_components_price_points(self, """ return super().new_api_call_builder.request( - RequestBuilder().server(Server.DEFAULT) + RequestBuilder().server(Server.PRODUCTION) .path('/subscriptions/{subscription_id}/price_points.json') .http_method(HttpMethodEnum.POST) .template_param(Parameter() @@ -297,7 +297,7 @@ def bulk_reset_subscription_components_price_points(self, """ return super().new_api_call_builder.request( - RequestBuilder().server(Server.DEFAULT) + RequestBuilder().server(Server.PRODUCTION) .path('/subscriptions/{subscription_id}/price_points/reset.json') .http_method(HttpMethodEnum.POST) .template_param(Parameter() @@ -412,7 +412,7 @@ def allocate_component(self, """ return super().new_api_call_builder.request( - RequestBuilder().server(Server.DEFAULT) + RequestBuilder().server(Server.PRODUCTION) .path('/subscriptions/{subscription_id}/components/{component_id}/allocations.json') .http_method(HttpMethodEnum.POST) .template_param(Parameter() @@ -491,7 +491,7 @@ def list_allocations(self, """ return super().new_api_call_builder.request( - RequestBuilder().server(Server.DEFAULT) + RequestBuilder().server(Server.PRODUCTION) .path('/subscriptions/{subscription_id}/components/{component_id}/allocations.json') .http_method(HttpMethodEnum.GET) .template_param(Parameter() @@ -549,7 +549,7 @@ def allocate_components(self, """ return super().new_api_call_builder.request( - RequestBuilder().server(Server.DEFAULT) + RequestBuilder().server(Server.PRODUCTION) .path('/subscriptions/{subscription_id}/allocations.json') .http_method(HttpMethodEnum.POST) .template_param(Parameter() @@ -612,7 +612,7 @@ def preview_allocations(self, """ return super().new_api_call_builder.request( - RequestBuilder().server(Server.DEFAULT) + RequestBuilder().server(Server.PRODUCTION) .path('/subscriptions/{subscription_id}/allocations/preview.json') .http_method(HttpMethodEnum.POST) .template_param(Parameter() @@ -680,7 +680,7 @@ def update_prepaid_usage_allocation_expiration_date(self, """ return super().new_api_call_builder.request( - RequestBuilder().server(Server.DEFAULT) + RequestBuilder().server(Server.PRODUCTION) .path('/subscriptions/{subscription_id}/components/{component_id}/allocations/{allocation_id}.json') .http_method(HttpMethodEnum.PUT) .template_param(Parameter() @@ -748,7 +748,7 @@ def delete_prepaid_usage_allocation(self, """ return super().new_api_call_builder.request( - RequestBuilder().server(Server.DEFAULT) + RequestBuilder().server(Server.PRODUCTION) .path('/subscriptions/{subscription_id}/components/{component_id}/allocations/{allocation_id}.json') .http_method(HttpMethodEnum.DELETE) .template_param(Parameter() @@ -870,7 +870,7 @@ def create_usage(self, """ return super().new_api_call_builder.request( - RequestBuilder().server(Server.DEFAULT) + RequestBuilder().server(Server.PRODUCTION) .path('/subscriptions/{subscription_id}/components/{component_id}/usages.json') .http_method(HttpMethodEnum.POST) .template_param(Parameter() @@ -971,7 +971,7 @@ def list_usages(self, """ return super().new_api_call_builder.request( - RequestBuilder().server(Server.DEFAULT) + RequestBuilder().server(Server.PRODUCTION) .path('/subscriptions/{subscription_id}/components/{component_id}/usages.json') .http_method(HttpMethodEnum.GET) .template_param(Parameter() @@ -1051,7 +1051,7 @@ def activate_event_based_component(self, """ return super().new_api_call_builder.request( - RequestBuilder().server(Server.DEFAULT) + RequestBuilder().server(Server.PRODUCTION) .path('/event_based_billing/subscriptions/{subscription_id}/components/{component_id}/activate.json') .http_method(HttpMethodEnum.POST) .template_param(Parameter() @@ -1098,7 +1098,7 @@ def deactivate_event_based_component(self, """ return super().new_api_call_builder.request( - RequestBuilder().server(Server.DEFAULT) + RequestBuilder().server(Server.PRODUCTION) .path('/event_based_billing/subscriptions/{subscription_id}/components/{component_id}/deactivate.json') .http_method(HttpMethodEnum.POST) .template_param(Parameter() @@ -1115,11 +1115,10 @@ def deactivate_event_based_component(self, ).execute() def record_event(self, - subdomain, api_handle, store_uid=None, body=None): - """Does a POST request to /{subdomain}/events/{api_handle}.json. + """Does a POST request to /events/{api_handle}.json. ## Documentation Events-Based Billing is an evolved form of metered billing that is @@ -1144,7 +1143,6 @@ def record_event(self, ``` Args: - subdomain (str): Your site's subdomain api_handle (str): Identifies the Stream for which the event should be published. store_uid (str, optional): If you've attached your own Keen @@ -1164,14 +1162,9 @@ def record_event(self, """ return super().new_api_call_builder.request( - RequestBuilder().server(Server.DEFAULT) - .path('/{subdomain}/events/{api_handle}.json') + RequestBuilder().server(Server.EBB) + .path('/events/{api_handle}.json') .http_method(HttpMethodEnum.POST) - .template_param(Parameter() - .key('subdomain') - .value(subdomain) - .is_required(True) - .should_encode(True)) .template_param(Parameter() .key('api_handle') .value(api_handle) @@ -1190,11 +1183,10 @@ def record_event(self, ).execute() def bulk_record_events(self, - subdomain, api_handle, store_uid=None, body=None): - """Does a POST request to /{subdomain}/events/{api_handle}/bulk.json. + """Does 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 @@ -1204,7 +1196,6 @@ def bulk_record_events(self, will be returned if this limit is exceeded. Args: - subdomain (str): Your site's subdomain api_handle (str): Identifies the Stream for which the events should be published. store_uid (str, optional): If you've attached your own Keen @@ -1224,14 +1215,9 @@ def bulk_record_events(self, """ return super().new_api_call_builder.request( - RequestBuilder().server(Server.DEFAULT) - .path('/{subdomain}/events/{api_handle}/bulk.json') + RequestBuilder().server(Server.EBB) + .path('/events/{api_handle}/bulk.json') .http_method(HttpMethodEnum.POST) - .template_param(Parameter() - .key('subdomain') - .value(subdomain) - .is_required(True) - .should_encode(True)) .template_param(Parameter() .key('api_handle') .value(api_handle) @@ -1340,7 +1326,7 @@ def list_subscription_components_for_site(self, """ return super().new_api_call_builder.request( - RequestBuilder().server(Server.DEFAULT) + RequestBuilder().server(Server.PRODUCTION) .path('/subscriptions_components.json') .http_method(HttpMethodEnum.GET) .query_param(Parameter() diff --git a/advancedbilling/controllers/subscription_group_invoice_account_controller.py b/advancedbilling/controllers/subscription_group_invoice_account_controller.py index a24ccad5..c180e825 100644 --- a/advancedbilling/controllers/subscription_group_invoice_account_controller.py +++ b/advancedbilling/controllers/subscription_group_invoice_account_controller.py @@ -57,7 +57,7 @@ def create_subscription_group_prepayment(self, """ return super().new_api_call_builder.request( - RequestBuilder().server(Server.DEFAULT) + RequestBuilder().server(Server.PRODUCTION) .path('/subscription_groups/{uid}/prepayments.json') .http_method(HttpMethodEnum.POST) .template_param(Parameter() @@ -125,7 +125,7 @@ def list_prepayments_for_subscription_group(self, """ return super().new_api_call_builder.request( - RequestBuilder().server(Server.DEFAULT) + RequestBuilder().server(Server.PRODUCTION) .path('/subscription_groups/{uid}/prepayments.json') .http_method(HttpMethodEnum.GET) .template_param(Parameter() @@ -181,7 +181,7 @@ def issue_subscription_group_service_credit(self, """ return super().new_api_call_builder.request( - RequestBuilder().server(Server.DEFAULT) + RequestBuilder().server(Server.PRODUCTION) .path('/subscription_groups/{uid}/service_credits.json') .http_method(HttpMethodEnum.POST) .template_param(Parameter() @@ -232,7 +232,7 @@ def deduct_subscription_group_service_credit(self, """ return super().new_api_call_builder.request( - RequestBuilder().server(Server.DEFAULT) + RequestBuilder().server(Server.PRODUCTION) .path('/subscription_groups/{uid}/service_credit_deductions.json') .http_method(HttpMethodEnum.POST) .template_param(Parameter() diff --git a/advancedbilling/controllers/subscription_group_status_controller.py b/advancedbilling/controllers/subscription_group_status_controller.py index 64be3388..245aff3d 100644 --- a/advancedbilling/controllers/subscription_group_status_controller.py +++ b/advancedbilling/controllers/subscription_group_status_controller.py @@ -56,7 +56,7 @@ def cancel_subscriptions_in_group(self, """ return super().new_api_call_builder.request( - RequestBuilder().server(Server.DEFAULT) + RequestBuilder().server(Server.PRODUCTION) .path('/subscription_groups/{uid}/cancel.json') .http_method(HttpMethodEnum.POST) .template_param(Parameter() @@ -99,7 +99,7 @@ def initiate_delayed_cancellation_for_group(self, """ return super().new_api_call_builder.request( - RequestBuilder().server(Server.DEFAULT) + RequestBuilder().server(Server.PRODUCTION) .path('/subscription_groups/{uid}/delayed_cancel.json') .http_method(HttpMethodEnum.POST) .template_param(Parameter() @@ -134,7 +134,7 @@ def cancel_delayed_cancellation_for_group(self, """ return super().new_api_call_builder.request( - RequestBuilder().server(Server.DEFAULT) + RequestBuilder().server(Server.PRODUCTION) .path('/subscription_groups/{uid}/delayed_cancel.json') .http_method(HttpMethodEnum.DELETE) .template_param(Parameter() @@ -204,7 +204,7 @@ def reactivate_subscription_group(self, """ return super().new_api_call_builder.request( - RequestBuilder().server(Server.DEFAULT) + RequestBuilder().server(Server.PRODUCTION) .path('/subscription_groups/{uid}/reactivate.json') .http_method(HttpMethodEnum.POST) .template_param(Parameter() diff --git a/advancedbilling/controllers/subscription_groups_controller.py b/advancedbilling/controllers/subscription_groups_controller.py index d1cc6398..b74f35a6 100644 --- a/advancedbilling/controllers/subscription_groups_controller.py +++ b/advancedbilling/controllers/subscription_groups_controller.py @@ -68,7 +68,7 @@ def signup_with_subscription_group(self, """ return super().new_api_call_builder.request( - RequestBuilder().server(Server.DEFAULT) + RequestBuilder().server(Server.PRODUCTION) .path('/subscription_groups/signup.json') .http_method(HttpMethodEnum.POST) .header_param(Parameter() @@ -110,7 +110,7 @@ def create_subscription_group(self, """ return super().new_api_call_builder.request( - RequestBuilder().server(Server.DEFAULT) + RequestBuilder().server(Server.PRODUCTION) .path('/subscription_groups.json') .http_method(HttpMethodEnum.POST) .header_param(Parameter() @@ -182,7 +182,7 @@ def list_subscription_groups(self, """ return super().new_api_call_builder.request( - RequestBuilder().server(Server.DEFAULT) + RequestBuilder().server(Server.PRODUCTION) .path('/subscription_groups.json') .http_method(HttpMethodEnum.GET) .query_param(Parameter() @@ -235,7 +235,7 @@ def read_subscription_group(self, """ return super().new_api_call_builder.request( - RequestBuilder().server(Server.DEFAULT) + RequestBuilder().server(Server.PRODUCTION) .path('/subscription_groups/{uid}.json') .http_method(HttpMethodEnum.GET) .template_param(Parameter() @@ -285,7 +285,7 @@ def update_subscription_group_members(self, """ return super().new_api_call_builder.request( - RequestBuilder().server(Server.DEFAULT) + RequestBuilder().server(Server.PRODUCTION) .path('/subscription_groups/{uid}.json') .http_method(HttpMethodEnum.PUT) .template_param(Parameter() @@ -332,7 +332,7 @@ def delete_subscription_group(self, """ return super().new_api_call_builder.request( - RequestBuilder().server(Server.DEFAULT) + RequestBuilder().server(Server.PRODUCTION) .path('/subscription_groups/{uid}.json') .http_method(HttpMethodEnum.DELETE) .template_param(Parameter() @@ -375,7 +375,7 @@ def find_subscription_group(self, """ return super().new_api_call_builder.request( - RequestBuilder().server(Server.DEFAULT) + RequestBuilder().server(Server.PRODUCTION) .path('/subscription_groups/lookup.json') .http_method(HttpMethodEnum.GET) .query_param(Parameter() @@ -446,7 +446,7 @@ def add_subscription_to_group(self, """ return super().new_api_call_builder.request( - RequestBuilder().server(Server.DEFAULT) + RequestBuilder().server(Server.PRODUCTION) .path('/subscriptions/{subscription_id}/group.json') .http_method(HttpMethodEnum.POST) .template_param(Parameter() @@ -496,7 +496,7 @@ def remove_subscription_from_group(self, """ return super().new_api_call_builder.request( - RequestBuilder().server(Server.DEFAULT) + RequestBuilder().server(Server.PRODUCTION) .path('/subscriptions/{subscription_id}/group.json') .http_method(HttpMethodEnum.DELETE) .template_param(Parameter() diff --git a/advancedbilling/controllers/subscription_invoice_account_controller.py b/advancedbilling/controllers/subscription_invoice_account_controller.py index 36157f70..8c942543 100644 --- a/advancedbilling/controllers/subscription_invoice_account_controller.py +++ b/advancedbilling/controllers/subscription_invoice_account_controller.py @@ -54,7 +54,7 @@ def read_account_balances(self, """ return super().new_api_call_builder.request( - RequestBuilder().server(Server.DEFAULT) + RequestBuilder().server(Server.PRODUCTION) .path('/subscriptions/{subscription_id}/account_balances.json') .http_method(HttpMethodEnum.GET) .template_param(Parameter() @@ -103,7 +103,7 @@ def create_prepayment(self, """ return super().new_api_call_builder.request( - RequestBuilder().server(Server.DEFAULT) + RequestBuilder().server(Server.PRODUCTION) .path('/subscriptions/{subscription_id}/prepayments.json') .http_method(HttpMethodEnum.POST) .template_param(Parameter() @@ -172,7 +172,7 @@ def list_prepayments(self, """ return super().new_api_call_builder.request( - RequestBuilder().server(Server.DEFAULT) + RequestBuilder().server(Server.PRODUCTION) .path('/subscriptions/{subscription_id}/prepayments.json') .http_method(HttpMethodEnum.GET) .template_param(Parameter() @@ -227,7 +227,7 @@ def issue_service_credit(self, """ return super().new_api_call_builder.request( - RequestBuilder().server(Server.DEFAULT) + RequestBuilder().server(Server.PRODUCTION) .path('/subscriptions/{subscription_id}/service_credits.json') .http_method(HttpMethodEnum.POST) .template_param(Parameter() @@ -278,7 +278,7 @@ def deduct_service_credit(self, """ return super().new_api_call_builder.request( - RequestBuilder().server(Server.DEFAULT) + RequestBuilder().server(Server.PRODUCTION) .path('/subscriptions/{subscription_id}/service_credit_deductions.json') .http_method(HttpMethodEnum.POST) .template_param(Parameter() @@ -326,7 +326,7 @@ def refund_prepayment(self, """ return super().new_api_call_builder.request( - RequestBuilder().server(Server.DEFAULT) + RequestBuilder().server(Server.PRODUCTION) .path('/subscriptions/{subscription_id}/prepayments/{prepayment_id}/refunds.json') .http_method(HttpMethodEnum.POST) .template_param(Parameter() diff --git a/advancedbilling/controllers/subscription_notes_controller.py b/advancedbilling/controllers/subscription_notes_controller.py index bb2265ed..3a6e179a 100644 --- a/advancedbilling/controllers/subscription_notes_controller.py +++ b/advancedbilling/controllers/subscription_notes_controller.py @@ -16,6 +16,7 @@ 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 class SubscriptionNotesController(BaseController): @@ -57,7 +58,7 @@ def create_subscription_note(self, """ return super().new_api_call_builder.request( - RequestBuilder().server(Server.DEFAULT) + RequestBuilder().server(Server.PRODUCTION) .path('/subscriptions/{subscription_id}/notes.json') .http_method(HttpMethodEnum.POST) .template_param(Parameter() @@ -79,6 +80,7 @@ def create_subscription_note(self, 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) ).execute() def list_subscription_notes(self, @@ -124,7 +126,7 @@ def list_subscription_notes(self, """ return super().new_api_call_builder.request( - RequestBuilder().server(Server.DEFAULT) + RequestBuilder().server(Server.PRODUCTION) .path('/subscriptions/{subscription_id}/notes.json') .http_method(HttpMethodEnum.GET) .template_param(Parameter() @@ -146,6 +148,7 @@ def list_subscription_notes(self, 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) ).execute() def read_subscription_note(self, @@ -172,7 +175,7 @@ def read_subscription_note(self, """ return super().new_api_call_builder.request( - RequestBuilder().server(Server.DEFAULT) + RequestBuilder().server(Server.PRODUCTION) .path('/subscriptions/{subscription_id}/notes/{note_id}.json') .http_method(HttpMethodEnum.GET) .template_param(Parameter() @@ -221,7 +224,7 @@ def update_subscription_note(self, """ return super().new_api_call_builder.request( - RequestBuilder().server(Server.DEFAULT) + RequestBuilder().server(Server.PRODUCTION) .path('/subscriptions/{subscription_id}/notes/{note_id}.json') .http_method(HttpMethodEnum.PUT) .template_param(Parameter() @@ -248,6 +251,7 @@ def update_subscription_note(self, 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) ).execute() def delete_subscription_note(self, @@ -273,7 +277,7 @@ def delete_subscription_note(self, """ return super().new_api_call_builder.request( - RequestBuilder().server(Server.DEFAULT) + RequestBuilder().server(Server.PRODUCTION) .path('/subscriptions/{subscription_id}/notes/{note_id}.json') .http_method(HttpMethodEnum.DELETE) .template_param(Parameter() diff --git a/advancedbilling/controllers/subscription_products_controller.py b/advancedbilling/controllers/subscription_products_controller.py index 2718fd41..a28089d5 100644 --- a/advancedbilling/controllers/subscription_products_controller.py +++ b/advancedbilling/controllers/subscription_products_controller.py @@ -144,7 +144,7 @@ def migrate_subscription_product(self, """ return super().new_api_call_builder.request( - RequestBuilder().server(Server.DEFAULT) + RequestBuilder().server(Server.PRODUCTION) .path('/subscriptions/{subscription_id}/migrations.json') .http_method(HttpMethodEnum.POST) .template_param(Parameter() @@ -200,7 +200,7 @@ def preview_subscription_product_migration(self, """ return super().new_api_call_builder.request( - RequestBuilder().server(Server.DEFAULT) + RequestBuilder().server(Server.PRODUCTION) .path('/subscriptions/{subscription_id}/migrations/preview.json') .http_method(HttpMethodEnum.POST) .template_param(Parameter() diff --git a/advancedbilling/controllers/subscription_status_controller.py b/advancedbilling/controllers/subscription_status_controller.py index 19d0f2ff..7a92c564 100644 --- a/advancedbilling/controllers/subscription_status_controller.py +++ b/advancedbilling/controllers/subscription_status_controller.py @@ -55,7 +55,7 @@ def retry_subscription(self, """ return super().new_api_call_builder.request( - RequestBuilder().server(Server.DEFAULT) + RequestBuilder().server(Server.PRODUCTION) .path('/subscriptions/{subscription_id}/retry.json') .http_method(HttpMethodEnum.PUT) .template_param(Parameter() @@ -98,7 +98,7 @@ def cancel_subscription(self, """ return super().new_api_call_builder.request( - RequestBuilder().server(Server.DEFAULT) + RequestBuilder().server(Server.PRODUCTION) .path('/subscriptions/{subscription_id}.json') .http_method(HttpMethodEnum.DELETE) .template_param(Parameter() @@ -152,7 +152,7 @@ def resume_subscription(self, """ return super().new_api_call_builder.request( - RequestBuilder().server(Server.DEFAULT) + RequestBuilder().server(Server.PRODUCTION) .path('/subscriptions/{subscription_id}/resume.json') .http_method(HttpMethodEnum.POST) .template_param(Parameter() @@ -201,7 +201,7 @@ def pause_subscription(self, """ return super().new_api_call_builder.request( - RequestBuilder().server(Server.DEFAULT) + RequestBuilder().server(Server.PRODUCTION) .path('/subscriptions/{subscription_id}/hold.json') .http_method(HttpMethodEnum.POST) .template_param(Parameter() @@ -255,7 +255,7 @@ def update_automatic_subscription_resumption(self, """ return super().new_api_call_builder.request( - RequestBuilder().server(Server.DEFAULT) + RequestBuilder().server(Server.PRODUCTION) .path('/subscriptions/{subscription_id}/hold.json') .http_method(HttpMethodEnum.PUT) .template_param(Parameter() @@ -443,7 +443,7 @@ def reactivate_subscription(self, """ return super().new_api_call_builder.request( - RequestBuilder().server(Server.DEFAULT) + RequestBuilder().server(Server.PRODUCTION) .path('/subscriptions/{subscription_id}/reactivate.json') .http_method(HttpMethodEnum.PUT) .template_param(Parameter() @@ -497,7 +497,7 @@ def initiate_delayed_cancellation(self, """ return super().new_api_call_builder.request( - RequestBuilder().server(Server.DEFAULT) + RequestBuilder().server(Server.PRODUCTION) .path('/subscriptions/{subscription_id}/delayed_cancel.json') .http_method(HttpMethodEnum.POST) .template_param(Parameter() @@ -520,6 +520,7 @@ def initiate_delayed_cancellation(self, .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) ).execute() def cancel_delayed_cancellation(self, @@ -548,7 +549,7 @@ def cancel_delayed_cancellation(self, """ return super().new_api_call_builder.request( - RequestBuilder().server(Server.DEFAULT) + RequestBuilder().server(Server.PRODUCTION) .path('/subscriptions/{subscription_id}/delayed_cancel.json') .http_method(HttpMethodEnum.DELETE) .template_param(Parameter() @@ -589,7 +590,7 @@ def cancel_dunning(self, """ return super().new_api_call_builder.request( - RequestBuilder().server(Server.DEFAULT) + RequestBuilder().server(Server.PRODUCTION) .path('/subscriptions/{subscription_id}/cancel_dunning.json') .http_method(HttpMethodEnum.POST) .template_param(Parameter() @@ -605,6 +606,7 @@ def cancel_dunning(self, 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) ).execute() def preview_renewal(self, @@ -662,7 +664,7 @@ def preview_renewal(self, """ return super().new_api_call_builder.request( - RequestBuilder().server(Server.DEFAULT) + RequestBuilder().server(Server.PRODUCTION) .path('/subscriptions/{subscription_id}/renewals/preview.json') .http_method(HttpMethodEnum.POST) .template_param(Parameter() diff --git a/advancedbilling/controllers/subscriptions_controller.py b/advancedbilling/controllers/subscriptions_controller.py index 7dd7461b..3b9a37c2 100644 --- a/advancedbilling/controllers/subscriptions_controller.py +++ b/advancedbilling/controllers/subscriptions_controller.py @@ -21,6 +21,8 @@ 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 @@ -76,6 +78,17 @@ def create_subscription(self, `bank_account_attributes` for ACH and Direct Debit. That said, when you read the subscription after creation, we return the profile details under `credit_card` or `bank_account`. + ## Bulk creation of subscriptions + Bulk creation of subscriptions is currently not supported. For + scenarios where multiple subscriptions must be added, particularly + when assigning to the same subscription group, it is essential to + switch to a single-threaded approach. + To avoid data conflicts or inaccuracies, incorporate a sleep interval + between requests. + While this single-threaded approach may impact performance, it ensures + data consistency and accuracy in cases where concurrent creation + attempts could otherwise lead to issues with subscription alignment + and integrity. ## Taxable Subscriptions If your intent is to charge your subscribers tax via [Avalara Taxes](https://maxio.zendesk.com/hc/en-us/articles/24287043035661-Avala @@ -863,7 +876,7 @@ def create_subscription(self, """ return super().new_api_call_builder.request( - RequestBuilder().server(Server.DEFAULT) + RequestBuilder().server(Server.PRODUCTION) .path('/subscriptions.json') .http_method(HttpMethodEnum.POST) .header_param(Parameter() @@ -985,7 +998,7 @@ def list_subscriptions(self, """ return super().new_api_call_builder.request( - RequestBuilder().server(Server.DEFAULT) + RequestBuilder().server(Server.PRODUCTION) .path('/subscriptions.json') .http_method(HttpMethodEnum.GET) .query_param(Parameter() @@ -1132,7 +1145,7 @@ def update_subscription(self, """ return super().new_api_call_builder.request( - RequestBuilder().server(Server.DEFAULT) + RequestBuilder().server(Server.PRODUCTION) .path('/subscriptions/{subscription_id}.json') .http_method(HttpMethodEnum.PUT) .template_param(Parameter() @@ -1187,7 +1200,7 @@ def read_subscription(self, """ return super().new_api_call_builder.request( - RequestBuilder().server(Server.DEFAULT) + RequestBuilder().server(Server.PRODUCTION) .path('/subscriptions/{subscription_id}.json') .http_method(HttpMethodEnum.GET) .template_param(Parameter() @@ -1266,7 +1279,7 @@ def override_subscription(self, """ return super().new_api_call_builder.request( - RequestBuilder().server(Server.DEFAULT) + RequestBuilder().server(Server.PRODUCTION) .path('/subscriptions/{subscription_id}/override.json') .http_method(HttpMethodEnum.PUT) .template_param(Parameter() @@ -1304,7 +1317,7 @@ def find_subscription(self, """ return super().new_api_call_builder.request( - RequestBuilder().server(Server.DEFAULT) + RequestBuilder().server(Server.PRODUCTION) .path('/subscriptions/lookup.json') .http_method(HttpMethodEnum.GET) .query_param(Parameter() @@ -1318,6 +1331,7 @@ def find_subscription(self, ResponseHandler() .deserializer(APIHelper.json_deserialize) .deserialize_into(SubscriptionResponse.from_dictionary) + .local_error_template('404', 'Not Found:\'{$response.body}\'', APIException) ).execute() def purge_subscription(self, @@ -1346,7 +1360,7 @@ def purge_subscription(self, `cascade[]=customer&cascade[]=payment_profile`. Returns: - void: Response from the API. OK + SubscriptionResponse: Response from the API. OK Raises: APIException: When an error occurs while fetching the data from @@ -1357,7 +1371,7 @@ def purge_subscription(self, """ return super().new_api_call_builder.request( - RequestBuilder().server(Server.DEFAULT) + RequestBuilder().server(Server.PRODUCTION) .path('/subscriptions/{subscription_id}/purge.json') .http_method(HttpMethodEnum.POST) .template_param(Parameter() @@ -1372,8 +1386,16 @@ def purge_subscription(self, .query_param(Parameter() .key('cascade') .value(cascade)) - .array_serialization_format(SerializationFormats.CSV) + .header_param(Parameter() + .key('accept') + .value('application/json')) + .array_serialization_format(SerializationFormats.UN_INDEXED) .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) ).execute() def update_prepaid_subscription_configuration(self, @@ -1400,7 +1422,7 @@ def update_prepaid_subscription_configuration(self, """ return super().new_api_call_builder.request( - RequestBuilder().server(Server.DEFAULT) + RequestBuilder().server(Server.PRODUCTION) .path('/subscriptions/{subscription_id}/prepaid_configurations.json') .http_method(HttpMethodEnum.POST) .template_param(Parameter() @@ -1422,6 +1444,7 @@ def update_prepaid_subscription_configuration(self, 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) ).execute() def preview_subscription(self, @@ -1481,7 +1504,7 @@ def preview_subscription(self, """ return super().new_api_call_builder.request( - RequestBuilder().server(Server.DEFAULT) + RequestBuilder().server(Server.PRODUCTION) .path('/subscriptions/preview.json') .http_method(HttpMethodEnum.POST) .header_param(Parameter() @@ -1539,7 +1562,7 @@ def apply_coupons_to_subscription(self, """ return super().new_api_call_builder.request( - RequestBuilder().server(Server.DEFAULT) + RequestBuilder().server(Server.PRODUCTION) .path('/subscriptions/{subscription_id}/add_coupon.json') .http_method(HttpMethodEnum.POST) .template_param(Parameter() @@ -1594,7 +1617,7 @@ def remove_coupon_from_subscription(self, """ return super().new_api_call_builder.request( - RequestBuilder().server(Server.DEFAULT) + RequestBuilder().server(Server.PRODUCTION) .path('/subscriptions/{subscription_id}/remove_coupon.json') .http_method(HttpMethodEnum.DELETE) .template_param(Parameter() @@ -1686,7 +1709,7 @@ def activate_subscription(self, """ return super().new_api_call_builder.request( - RequestBuilder().server(Server.DEFAULT) + RequestBuilder().server(Server.PRODUCTION) .path('/subscriptions/{subscription_id}/activate.json') .http_method(HttpMethodEnum.PUT) .template_param(Parameter() diff --git a/advancedbilling/controllers/webhooks_controller.py b/advancedbilling/controllers/webhooks_controller.py index 80239d48..9c8af226 100644 --- a/advancedbilling/controllers/webhooks_controller.py +++ b/advancedbilling/controllers/webhooks_controller.py @@ -106,7 +106,7 @@ def list_webhooks(self, """ return super().new_api_call_builder.request( - RequestBuilder().server(Server.DEFAULT) + RequestBuilder().server(Server.PRODUCTION) .path('/webhooks.json') .http_method(HttpMethodEnum.GET) .query_param(Parameter() @@ -162,7 +162,7 @@ def enable_webhooks(self, """ return super().new_api_call_builder.request( - RequestBuilder().server(Server.DEFAULT) + RequestBuilder().server(Server.PRODUCTION) .path('/webhooks/settings.json') .http_method(HttpMethodEnum.PUT) .header_param(Parameter() @@ -207,7 +207,7 @@ def replay_webhooks(self, """ return super().new_api_call_builder.request( - RequestBuilder().server(Server.DEFAULT) + RequestBuilder().server(Server.PRODUCTION) .path('/webhooks/replay.json') .http_method(HttpMethodEnum.POST) .header_param(Parameter() @@ -253,7 +253,7 @@ def create_endpoint(self, """ return super().new_api_call_builder.request( - RequestBuilder().server(Server.DEFAULT) + RequestBuilder().server(Server.PRODUCTION) .path('/endpoints.json') .http_method(HttpMethodEnum.POST) .header_param(Parameter() @@ -290,7 +290,7 @@ def list_endpoints(self): """ return super().new_api_call_builder.request( - RequestBuilder().server(Server.DEFAULT) + RequestBuilder().server(Server.PRODUCTION) .path('/endpoints.json') .http_method(HttpMethodEnum.GET) .header_param(Parameter() @@ -339,7 +339,7 @@ def update_endpoint(self, """ return super().new_api_call_builder.request( - RequestBuilder().server(Server.DEFAULT) + RequestBuilder().server(Server.PRODUCTION) .path('/endpoints/{endpoint_id}.json') .http_method(HttpMethodEnum.PUT) .template_param(Parameter() diff --git a/advancedbilling/exceptions/__init__.py b/advancedbilling/exceptions/__init__.py index f57f6d63..0cf80bb3 100644 --- a/advancedbilling/exceptions/__init__.py +++ b/advancedbilling/exceptions/__init__.py @@ -20,6 +20,7 @@ '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/subscription_response_error_exception.py b/advancedbilling/exceptions/subscription_response_error_exception.py new file mode 100644 index 00000000..702a4d3a --- /dev/null +++ b/advancedbilling/exceptions/subscription_response_error_exception.py @@ -0,0 +1,39 @@ +# -*- coding: utf-8 -*- + +""" +advanced_billing + +This file was automatically generated for Maxio by APIMATIC v3.0 ( + https://www.apimatic.io ). +""" + +from advancedbilling.api_helper import APIHelper +import advancedbilling.exceptions.api_exception +from advancedbilling.models.subscription import Subscription + + +class SubscriptionResponseErrorException(advancedbilling.exceptions.api_exception.APIException): + def __init__(self, reason, response): + """Constructor for the SubscriptionResponseErrorException class + + Args: + reason (string): The reason (or error message) for the Exception + to be raised. + response (HttpResponse): The HttpResponse of the API call. + + """ + super(SubscriptionResponseErrorException, 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. + + 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. + + """ + self.subscription = Subscription.from_dictionary(dictionary.get('subscription')) if 'subscription' in dictionary.keys() else None diff --git a/advancedbilling/models/__init__.py b/advancedbilling/models/__init__.py index 82bfa158..90c12941 100644 --- a/advancedbilling/models/__init__.py +++ b/advancedbilling/models/__init__.py @@ -96,6 +96,8 @@ 'coupon_currency', 'coupon_currency_request', 'coupon_currency_response', + 'coupon_payload', + 'coupon_request', 'coupon_response', 'coupon_restriction', 'coupon_subcodes', @@ -130,11 +132,8 @@ 'create_offer_component', 'create_offer_request', 'create_on_off_component', - 'create_or_update_coupon', 'create_or_update_endpoint', 'create_or_update_endpoint_request', - 'create_or_update_flat_amount_coupon', - 'create_or_update_percentage_coupon', 'create_or_update_product', 'create_or_update_product_request', 'create_or_update_segment_price', @@ -210,10 +209,12 @@ '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', @@ -291,6 +292,7 @@ 'offer_item', 'offer_response', 'offer_signup_page', + 'ok_response', 'on_off_component', 'organization_address', 'origin_invoice', @@ -309,7 +311,6 @@ 'payment_related_events', 'pending_cancellation_change', 'portal_management_link', - 'prepaid_component_price_point', 'prepaid_configuration', 'prepaid_configuration_response', 'prepaid_product_price_point_filter', @@ -347,7 +348,6 @@ 'reactivation_billing', 'reason_code', 'reason_code_response', - 'reason_codes_json_response', 'record_payment_request', 'record_payment_response', 'referral_code', @@ -401,7 +401,6 @@ 'subscription_group_credit_card', 'subscription_group_customer', 'subscription_group_item', - 'subscription_group_member_error', 'subscription_group_members_array_error', 'subscription_group_payment_profile', 'subscription_group_prepayment', @@ -411,13 +410,11 @@ 'subscription_group_signup', 'subscription_group_signup_component', 'subscription_group_signup_error', - 'subscription_group_signup_failure', + 'subscription_group_signup_event_data', 'subscription_group_signup_failure_data', 'subscription_group_signup_item', 'subscription_group_signup_request', 'subscription_group_signup_response', - 'subscription_group_signup_success', - 'subscription_group_signup_success_data', 'subscription_group_single_error', 'subscription_group_subscription_error', 'subscription_group_update_error', @@ -510,7 +507,7 @@ 'debit_note_status', 'direction', 'discount_type', - 'event_type', + 'event_key', 'expiration_interval_unit', 'failed_payment_action', 'first_charge_type', diff --git a/advancedbilling/models/account_balance.py b/advancedbilling/models/account_balance.py index 89069dff..2c496e7b 100644 --- a/advancedbilling/models/account_balance.py +++ b/advancedbilling/models/account_balance.py @@ -20,6 +20,8 @@ class AccountBalance(object): automatic_balance_in_cents (long|int): The automatic balance in cents. remittance_balance_in_cents (long|int): The remittance balance in cents. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -45,7 +47,7 @@ def __init__(self, balance_in_cents=APIHelper.SKIP, automatic_balance_in_cents=APIHelper.SKIP, remittance_balance_in_cents=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the AccountBalance class""" # Initialize members of the class @@ -57,6 +59,8 @@ def __init__(self, self.remittance_balance_in_cents = remittance_balance_in_cents # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -74,7 +78,7 @@ def from_dictionary(cls, """ - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -82,11 +86,9 @@ def from_dictionary(cls, 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 - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, remittance_balance_in_cents, - dictionary) + additional_properties) diff --git a/advancedbilling/models/account_balances.py b/advancedbilling/models/account_balances.py index f558cb5a..e3889d21 100644 --- a/advancedbilling/models/account_balances.py +++ b/advancedbilling/models/account_balances.py @@ -27,6 +27,8 @@ class AccountBalances(object): 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. """ @@ -53,7 +55,7 @@ def __init__(self, pending_discounts=APIHelper.SKIP, service_credits=APIHelper.SKIP, prepayments=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the AccountBalances class""" # Initialize members of the class @@ -69,6 +71,8 @@ def __init__(self, self.prepayments = prepayments # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -86,7 +90,7 @@ def from_dictionary(cls, """ - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -96,13 +100,11 @@ def from_dictionary(cls, 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 - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, pending_discounts, service_credits, prepayments, - dictionary) + additional_properties) diff --git a/advancedbilling/models/ach_agreement.py b/advancedbilling/models/ach_agreement.py index 8bea6d93..7fd0cdbf 100644 --- a/advancedbilling/models/ach_agreement.py +++ b/advancedbilling/models/ach_agreement.py @@ -25,6 +25,8 @@ class ACHAgreement(object): 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. """ @@ -48,7 +50,7 @@ def __init__(self, authorizer_first_name=APIHelper.SKIP, authorizer_last_name=APIHelper.SKIP, ip_address=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the ACHAgreement class""" # Initialize members of the class @@ -62,6 +64,8 @@ def __init__(self, self.ip_address = ip_address # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -79,7 +83,7 @@ def from_dictionary(cls, """ - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -88,15 +92,13 @@ def from_dictionary(cls, 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 - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, authorizer_last_name, ip_address, - dictionary) + additional_properties) @classmethod def validate(cls, dictionary): diff --git a/advancedbilling/models/activate_event_based_component.py b/advancedbilling/models/activate_event_based_component.py index fb561c7d..3b5da93f 100644 --- a/advancedbilling/models/activate_event_based_component.py +++ b/advancedbilling/models/activate_event_based_component.py @@ -25,6 +25,8 @@ class ActivateEventBasedComponent(object): note 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. """ @@ -45,7 +47,7 @@ def __init__(self, price_point_id=APIHelper.SKIP, billing_schedule=APIHelper.SKIP, custom_price=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the ActivateEventBasedComponent class""" # Initialize members of the class @@ -57,6 +59,8 @@ def __init__(self, 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 @@ -74,7 +78,7 @@ def from_dictionary(cls, """ - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -82,11 +86,9 @@ def from_dictionary(cls, 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 - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, custom_price, - dictionary) + additional_properties) diff --git a/advancedbilling/models/activate_subscription_request.py b/advancedbilling/models/activate_subscription_request.py index 2b5f0f28..6abd026e 100644 --- a/advancedbilling/models/activate_subscription_request.py +++ b/advancedbilling/models/activate_subscription_request.py @@ -22,6 +22,8 @@ class ActivateSubscriptionRequest(object): 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. """ @@ -40,7 +42,7 @@ class ActivateSubscriptionRequest(object): def __init__(self, revert_on_failure=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the ActivateSubscriptionRequest class""" # Initialize members of the class @@ -48,6 +50,8 @@ def __init__(self, self.revert_on_failure = revert_on_failure # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -65,15 +69,13 @@ def from_dictionary(cls, """ - if dictionary is None: + 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 # Clean out expected properties from dictionary - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, - dictionary) + additional_properties) diff --git a/advancedbilling/models/add_coupons_request.py b/advancedbilling/models/add_coupons_request.py index c5d552e2..5fd3828d 100644 --- a/advancedbilling/models/add_coupons_request.py +++ b/advancedbilling/models/add_coupons_request.py @@ -17,6 +17,8 @@ class AddCouponsRequest(object): Attributes: codes (List[str]): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -31,7 +33,7 @@ class AddCouponsRequest(object): def __init__(self, codes=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the AddCouponsRequest class""" # Initialize members of the class @@ -39,6 +41,8 @@ def __init__(self, self.codes = codes # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -56,15 +60,13 @@ def from_dictionary(cls, """ - if dictionary is None: + 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 # Clean out expected properties from dictionary - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, - dictionary) + additional_properties) diff --git a/advancedbilling/models/add_subscription_to_a_group.py b/advancedbilling/models/add_subscription_to_a_group.py index ca8d37f0..561e6c64 100644 --- a/advancedbilling/models/add_subscription_to_a_group.py +++ b/advancedbilling/models/add_subscription_to_a_group.py @@ -7,6 +7,7 @@ https://www.apimatic.io ). """ from advancedbilling.api_helper import APIHelper +from advancedbilling.models.group_settings import GroupSettings class AddSubscriptionToAGroup(object): @@ -16,7 +17,9 @@ class AddSubscriptionToAGroup(object): TODO: type model description here. Attributes: - group (GroupSettings | bool | None): TODO: type description here. + group (GroupSettings): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -31,7 +34,7 @@ class AddSubscriptionToAGroup(object): def __init__(self, group=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the AddSubscriptionToAGroup class""" # Initialize members of the class @@ -39,6 +42,8 @@ def __init__(self, self.group = group # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -55,17 +60,14 @@ def from_dictionary(cls, object: An instance of this structure class. """ - from advancedbilling.utilities.union_type_lookup import UnionTypeLookUp - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - group = APIHelper.deserialize_union_type(UnionTypeLookUp.get('AddSubscriptionToAGroupGroup'), dictionary.get('group'), False) if dictionary.get('group') is not None else APIHelper.SKIP + group = GroupSettings.from_dictionary(dictionary.get('group')) if 'group' in dictionary.keys() else APIHelper.SKIP # Clean out expected properties from dictionary - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, - dictionary) + additional_properties) diff --git a/advancedbilling/models/address_change.py b/advancedbilling/models/address_change.py index 97caeeb4..0e1a9c5d 100644 --- a/advancedbilling/models/address_change.py +++ b/advancedbilling/models/address_change.py @@ -18,6 +18,8 @@ class AddressChange(object): Attributes: before (InvoiceAddress): TODO: type description here. after (InvoiceAddress): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -30,7 +32,7 @@ class AddressChange(object): def __init__(self, before=None, after=None, - additional_properties={}): + additional_properties=None): """Constructor for the AddressChange class""" # Initialize members of the class @@ -38,6 +40,8 @@ def __init__(self, self.after = after # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -55,17 +59,15 @@ def from_dictionary(cls, """ - if dictionary is None: + 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 # Clean out expected properties from dictionary - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, - dictionary) + additional_properties) diff --git a/advancedbilling/models/agreement_acceptance.py b/advancedbilling/models/agreement_acceptance.py index 9de8fcc5..bf31b206 100644 --- a/advancedbilling/models/agreement_acceptance.py +++ b/advancedbilling/models/agreement_acceptance.py @@ -24,6 +24,8 @@ class AgreementAcceptance(object): return_refund_policy_url (str): TODO: type description here. delivery_policy_url (str): TODO: type description here. secure_checkout_policy_url (str): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -53,7 +55,7 @@ def __init__(self, return_refund_policy_url=APIHelper.SKIP, delivery_policy_url=APIHelper.SKIP, secure_checkout_policy_url=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the AgreementAcceptance class""" # Initialize members of the class @@ -71,6 +73,8 @@ def __init__(self, self.secure_checkout_policy_url = secure_checkout_policy_url # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -88,7 +92,7 @@ def from_dictionary(cls, """ - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -99,9 +103,7 @@ def from_dictionary(cls, 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 - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, @@ -109,7 +111,7 @@ def from_dictionary(cls, return_refund_policy_url, delivery_policy_url, secure_checkout_policy_url, - dictionary) + additional_properties) @classmethod def validate(cls, dictionary): diff --git a/advancedbilling/models/all_vaults.py b/advancedbilling/models/all_vaults.py index a7bdb15a..a25bc470 100644 --- a/advancedbilling/models/all_vaults.py +++ b/advancedbilling/models/all_vaults.py @@ -50,6 +50,8 @@ class AllVaults(object): TRUST_COMMERCE: TODO: type description here. UNIPAAS: TODO: type description here. WIRECARD: TODO: type description here. + 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'] diff --git a/advancedbilling/models/allocate_components.py b/advancedbilling/models/allocate_components.py index b29a35e3..ecd80deb 100644 --- a/advancedbilling/models/allocate_components.py +++ b/advancedbilling/models/allocate_components.py @@ -35,6 +35,8 @@ class AllocateComponents(object): 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. """ @@ -75,7 +77,7 @@ def __init__(self, downgrade_credit=APIHelper.SKIP, payment_collection_method=APIHelper.SKIP, initiate_dunning=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the AllocateComponents class""" # Initialize members of the class @@ -97,6 +99,8 @@ def __init__(self, self.initiate_dunning = initiate_dunning # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -114,7 +118,7 @@ def from_dictionary(cls, """ - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -131,9 +135,7 @@ def from_dictionary(cls, 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 - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, @@ -143,4 +145,4 @@ def from_dictionary(cls, downgrade_credit, payment_collection_method, initiate_dunning, - dictionary) + additional_properties) diff --git a/advancedbilling/models/allocation.py b/advancedbilling/models/allocation.py index e0fb1b13..6cd0deb5 100644 --- a/advancedbilling/models/allocation.py +++ b/advancedbilling/models/allocation.py @@ -70,6 +70,8 @@ class Allocation(object): expires_at (datetime): TODO: type description here. used_quantity (long|int): TODO: type description here. charge_id (long|int): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -165,7 +167,7 @@ def __init__(self, expires_at=APIHelper.SKIP, used_quantity=APIHelper.SKIP, charge_id=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the Allocation class""" # Initialize members of the class @@ -221,6 +223,8 @@ def __init__(self, self.charge_id = charge_id # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -239,7 +243,7 @@ def from_dictionary(cls, """ from advancedbilling.utilities.union_type_lookup import UnionTypeLookUp - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -272,9 +276,7 @@ def from_dictionary(cls, 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 - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, @@ -301,4 +303,4 @@ def from_dictionary(cls, expires_at, used_quantity, charge_id, - dictionary) + additional_properties) diff --git a/advancedbilling/models/allocation_expiration_date.py b/advancedbilling/models/allocation_expiration_date.py index caadb3df..af3d8d57 100644 --- a/advancedbilling/models/allocation_expiration_date.py +++ b/advancedbilling/models/allocation_expiration_date.py @@ -17,6 +17,8 @@ class AllocationExpirationDate(object): Attributes: expires_at (datetime): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -31,7 +33,7 @@ class AllocationExpirationDate(object): def __init__(self, expires_at=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the AllocationExpirationDate class""" # Initialize members of the class @@ -39,6 +41,8 @@ def __init__(self, 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: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -56,15 +60,13 @@ def from_dictionary(cls, """ - if dictionary is None: + 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 # Clean out expected properties from dictionary - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, - dictionary) + additional_properties) diff --git a/advancedbilling/models/allocation_preview.py b/advancedbilling/models/allocation_preview.py index 8fd813e3..e258a736 100644 --- a/advancedbilling/models/allocation_preview.py +++ b/advancedbilling/models/allocation_preview.py @@ -33,6 +33,8 @@ class AllocationPreview(object): period_type (str): TODO: type description here. existing_balance_in_cents (long|int): An integer representing the amount of the subscription's current balance + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -83,7 +85,7 @@ def __init__(self, allocations=APIHelper.SKIP, period_type=APIHelper.SKIP, existing_balance_in_cents=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the AllocationPreview class""" # Initialize members of the class @@ -115,6 +117,8 @@ def __init__(self, self.existing_balance_in_cents = existing_balance_in_cents # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -132,7 +136,7 @@ def from_dictionary(cls, """ - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -158,9 +162,7 @@ def from_dictionary(cls, 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 - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, @@ -175,4 +177,4 @@ def from_dictionary(cls, allocations, period_type, existing_balance_in_cents, - dictionary) + additional_properties) diff --git a/advancedbilling/models/allocation_preview_direction.py b/advancedbilling/models/allocation_preview_direction.py index ad8c1a67..c4ba5d8a 100644 --- a/advancedbilling/models/allocation_preview_direction.py +++ b/advancedbilling/models/allocation_preview_direction.py @@ -17,6 +17,8 @@ class AllocationPreviewDirection(object): Attributes: UPGRADE: TODO: type description here. DOWNGRADE: TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ UPGRADE = 'upgrade' diff --git a/advancedbilling/models/allocation_preview_item.py b/advancedbilling/models/allocation_preview_item.py index 107d345b..14e77e5a 100644 --- a/advancedbilling/models/allocation_preview_item.py +++ b/advancedbilling/models/allocation_preview_item.py @@ -45,6 +45,8 @@ class AllocationPreviewItem(object): price_point_handle (str): TODO: type description here. price_point_name (str): TODO: type description here. component_handle (str): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -119,7 +121,7 @@ def __init__(self, price_point_handle=APIHelper.SKIP, price_point_name=APIHelper.SKIP, component_handle=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the AllocationPreviewItem class""" # Initialize members of the class @@ -161,6 +163,8 @@ def __init__(self, self.component_handle = component_handle # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -179,7 +183,7 @@ def from_dictionary(cls, """ from advancedbilling.utilities.union_type_lookup import UnionTypeLookUp - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -202,9 +206,7 @@ def from_dictionary(cls, 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 - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, @@ -224,4 +226,4 @@ def from_dictionary(cls, price_point_handle, price_point_name, component_handle, - dictionary) + additional_properties) diff --git a/advancedbilling/models/allocation_preview_line_item.py b/advancedbilling/models/allocation_preview_line_item.py index 3878109b..bff2d4c9 100644 --- a/advancedbilling/models/allocation_preview_line_item.py +++ b/advancedbilling/models/allocation_preview_line_item.py @@ -28,6 +28,8 @@ class AllocationPreviewLineItem(object): component_handle (str): TODO: type description here. direction (AllocationPreviewDirection): Visible when using Fine-grained Component Control + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -66,7 +68,7 @@ def __init__(self, component_id=APIHelper.SKIP, component_handle=APIHelper.SKIP, direction=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the AllocationPreviewLineItem class""" # Initialize members of the class @@ -90,6 +92,8 @@ def __init__(self, self.direction = direction # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -107,7 +111,7 @@ def from_dictionary(cls, """ - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -121,9 +125,7 @@ def from_dictionary(cls, 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 - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, @@ -134,4 +136,4 @@ def from_dictionary(cls, component_id, component_handle, direction, - dictionary) + additional_properties) diff --git a/advancedbilling/models/allocation_preview_line_item_kind.py b/advancedbilling/models/allocation_preview_line_item_kind.py index 3b169dff..a9e56732 100644 --- a/advancedbilling/models/allocation_preview_line_item_kind.py +++ b/advancedbilling/models/allocation_preview_line_item_kind.py @@ -19,6 +19,8 @@ class AllocationPreviewLineItemKind(object): ON_OFF_COMPONENT: TODO: type description here. COUPON: TODO: type description here. TAX: TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ QUANTITY_BASED_COMPONENT = 'quantity_based_component' diff --git a/advancedbilling/models/allocation_preview_response.py b/advancedbilling/models/allocation_preview_response.py index 17b294a0..eafdee9a 100644 --- a/advancedbilling/models/allocation_preview_response.py +++ b/advancedbilling/models/allocation_preview_response.py @@ -17,6 +17,8 @@ class AllocationPreviewResponse(object): Attributes: allocation_preview (AllocationPreview): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -27,13 +29,15 @@ class AllocationPreviewResponse(object): def __init__(self, allocation_preview=None, - additional_properties={}): + additional_properties=None): """Constructor for the AllocationPreviewResponse class""" # Initialize members of the class self.allocation_preview = allocation_preview # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -51,15 +55,13 @@ def from_dictionary(cls, """ - if dictionary is None: + 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 # Clean out expected properties from dictionary - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, - dictionary) + additional_properties) diff --git a/advancedbilling/models/allocation_response.py b/advancedbilling/models/allocation_response.py index f87cf0da..dd7d0db7 100644 --- a/advancedbilling/models/allocation_response.py +++ b/advancedbilling/models/allocation_response.py @@ -18,6 +18,8 @@ class AllocationResponse(object): Attributes: allocation (Allocation): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -32,7 +34,7 @@ class AllocationResponse(object): def __init__(self, allocation=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the AllocationResponse class""" # Initialize members of the class @@ -40,6 +42,8 @@ def __init__(self, self.allocation = allocation # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -57,15 +61,13 @@ def from_dictionary(cls, """ - if dictionary is None: + 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 # Clean out expected properties from dictionary - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, - dictionary) + additional_properties) diff --git a/advancedbilling/models/allocation_settings.py b/advancedbilling/models/allocation_settings.py index bc68d1e8..a51c0622 100644 --- a/advancedbilling/models/allocation_settings.py +++ b/advancedbilling/models/allocation_settings.py @@ -25,6 +25,8 @@ class AllocationSettings(object): setting if one is not provided. Available values: `full`, `prorated`, `none`. accrue_charge (str): Either "true" or "false". + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -50,7 +52,7 @@ def __init__(self, upgrade_charge=APIHelper.SKIP, downgrade_credit=APIHelper.SKIP, accrue_charge=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the AllocationSettings class""" # Initialize members of the class @@ -62,6 +64,8 @@ def __init__(self, self.accrue_charge = accrue_charge # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -79,7 +83,7 @@ def from_dictionary(cls, """ - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -87,11 +91,9 @@ def from_dictionary(cls, 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 - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, accrue_charge, - dictionary) + additional_properties) diff --git a/advancedbilling/models/apple_pay_payment_profile.py b/advancedbilling/models/apple_pay_payment_profile.py index d2e7c6ea..bdbf4e0f 100644 --- a/advancedbilling/models/apple_pay_payment_profile.py +++ b/advancedbilling/models/apple_pay_payment_profile.py @@ -42,6 +42,8 @@ class ApplePayPaymentProfile(object): payment_type (PaymentType): TODO: type description here. site_gateway_setting_id (int): TODO: type description here. gateway_handle (str): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -112,7 +114,7 @@ def __init__(self, billing_address_2=APIHelper.SKIP, site_gateway_setting_id=APIHelper.SKIP, gateway_handle=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the ApplePayPaymentProfile class""" # Initialize members of the class @@ -149,6 +151,8 @@ def __init__(self, self.gateway_handle = gateway_handle # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -166,7 +170,7 @@ def from_dictionary(cls, """ - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -187,9 +191,7 @@ def from_dictionary(cls, 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 # Clean out expected properties from dictionary - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, @@ -207,7 +209,7 @@ def from_dictionary(cls, billing_address_2, site_gateway_setting_id, gateway_handle, - dictionary) + additional_properties) @classmethod def validate(cls, dictionary): diff --git a/advancedbilling/models/apple_pay_vault.py b/advancedbilling/models/apple_pay_vault.py index e67f519d..3ab1b62a 100644 --- a/advancedbilling/models/apple_pay_vault.py +++ b/advancedbilling/models/apple_pay_vault.py @@ -16,6 +16,8 @@ class ApplePayVault(object): Attributes: BRAINTREE_BLUE: TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ _all_values = ['braintree_blue'] diff --git a/advancedbilling/models/applied_credit_note_data.py b/advancedbilling/models/applied_credit_note_data.py index 805ca5c8..caf52787 100644 --- a/advancedbilling/models/applied_credit_note_data.py +++ b/advancedbilling/models/applied_credit_note_data.py @@ -18,6 +18,8 @@ class AppliedCreditNoteData(object): 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. """ @@ -35,7 +37,7 @@ class AppliedCreditNoteData(object): def __init__(self, uid=APIHelper.SKIP, number=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the AppliedCreditNoteData class""" # Initialize members of the class @@ -45,6 +47,8 @@ def __init__(self, self.number = number # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -62,20 +66,18 @@ def from_dictionary(cls, """ - if dictionary is None: + 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 # Clean out expected properties from dictionary - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, - dictionary) + additional_properties) @classmethod def validate(cls, dictionary): diff --git a/advancedbilling/models/apply_credit_note_event.py b/advancedbilling/models/apply_credit_note_event.py index 407cd59f..bbab878c 100644 --- a/advancedbilling/models/apply_credit_note_event.py +++ b/advancedbilling/models/apply_credit_note_event.py @@ -25,6 +25,8 @@ class ApplyCreditNoteEvent(object): event_type (InvoiceEventType): TODO: type description here. event_data (ApplyCreditNoteEventData): Example schema for an `apply_credit_note` event + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -43,7 +45,7 @@ def __init__(self, invoice=None, event_type='apply_credit_note', event_data=None, - additional_properties={}): + additional_properties=None): """Constructor for the ApplyCreditNoteEvent class""" # Initialize members of the class @@ -54,6 +56,8 @@ def __init__(self, self.event_data = event_data # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -71,7 +75,7 @@ def from_dictionary(cls, """ - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -81,16 +85,14 @@ def from_dictionary(cls, 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 - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, invoice, event_type, event_data, - dictionary) + additional_properties) @classmethod def validate(cls, dictionary): diff --git a/advancedbilling/models/apply_credit_note_event_data.py b/advancedbilling/models/apply_credit_note_event_data.py index 66f11d55..8ed2f4d8 100644 --- a/advancedbilling/models/apply_credit_note_event_data.py +++ b/advancedbilling/models/apply_credit_note_event_data.py @@ -35,6 +35,8 @@ class ApplyCreditNoteEventData(object): 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. """ @@ -75,7 +77,7 @@ def __init__(self, role=APIHelper.SKIP, consolidated_invoice=APIHelper.SKIP, applied_credit_notes=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the ApplyCreditNoteEventData class""" # Initialize members of the class @@ -96,6 +98,8 @@ def __init__(self, self.applied_credit_notes = applied_credit_notes # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -113,7 +117,7 @@ def from_dictionary(cls, """ - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -132,9 +136,7 @@ def from_dictionary(cls, else: applied_credit_notes = APIHelper.SKIP # Clean out expected properties from dictionary - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, @@ -146,7 +148,7 @@ def from_dictionary(cls, role, consolidated_invoice, applied_credit_notes, - dictionary) + additional_properties) @classmethod def validate(cls, dictionary): diff --git a/advancedbilling/models/apply_debit_note_event.py b/advancedbilling/models/apply_debit_note_event.py index 3205c1ae..582e3c80 100644 --- a/advancedbilling/models/apply_debit_note_event.py +++ b/advancedbilling/models/apply_debit_note_event.py @@ -25,6 +25,8 @@ class ApplyDebitNoteEvent(object): event_type (InvoiceEventType): TODO: type description here. event_data (ApplyDebitNoteEventData): Example schema for an `apply_debit_note` event + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -43,7 +45,7 @@ def __init__(self, invoice=None, event_type='apply_debit_note', event_data=None, - additional_properties={}): + additional_properties=None): """Constructor for the ApplyDebitNoteEvent class""" # Initialize members of the class @@ -54,6 +56,8 @@ def __init__(self, self.event_data = event_data # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -71,7 +75,7 @@ def from_dictionary(cls, """ - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -81,16 +85,14 @@ def from_dictionary(cls, 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 - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, invoice, event_type, event_data, - dictionary) + additional_properties) @classmethod def validate(cls, dictionary): diff --git a/advancedbilling/models/apply_debit_note_event_data.py b/advancedbilling/models/apply_debit_note_event_data.py index 020c7d35..4008ca91 100644 --- a/advancedbilling/models/apply_debit_note_event_data.py +++ b/advancedbilling/models/apply_debit_note_event_data.py @@ -26,6 +26,8 @@ class ApplyDebitNoteEventData(object): 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. """ @@ -56,7 +58,7 @@ def __init__(self, applied_amount=None, memo=APIHelper.SKIP, transaction_time=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the ApplyDebitNoteEventData class""" # Initialize members of the class @@ -70,6 +72,8 @@ def __init__(self, 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: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -87,7 +91,7 @@ def from_dictionary(cls, """ - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -101,9 +105,7 @@ def from_dictionary(cls, else: transaction_time = APIHelper.SKIP # Clean out expected properties from dictionary - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, @@ -111,7 +113,7 @@ def from_dictionary(cls, applied_amount, memo, transaction_time, - dictionary) + additional_properties) @classmethod def validate(cls, dictionary): diff --git a/advancedbilling/models/apply_payment_event.py b/advancedbilling/models/apply_payment_event.py index a3743fcf..d664f7d3 100644 --- a/advancedbilling/models/apply_payment_event.py +++ b/advancedbilling/models/apply_payment_event.py @@ -25,6 +25,8 @@ class ApplyPaymentEvent(object): event_type (InvoiceEventType): TODO: type description here. event_data (ApplyPaymentEventData): Example schema for an `apply_payment` event + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -43,7 +45,7 @@ def __init__(self, invoice=None, event_type='apply_payment', event_data=None, - additional_properties={}): + additional_properties=None): """Constructor for the ApplyPaymentEvent class""" # Initialize members of the class @@ -54,6 +56,8 @@ def __init__(self, self.event_data = event_data # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -71,7 +75,7 @@ def from_dictionary(cls, """ - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -81,16 +85,14 @@ def from_dictionary(cls, 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 - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, invoice, event_type, event_data, - dictionary) + additional_properties) @classmethod def validate(cls, dictionary): diff --git a/advancedbilling/models/apply_payment_event_data.py b/advancedbilling/models/apply_payment_event_data.py index 4709c8df..9036a978 100644 --- a/advancedbilling/models/apply_payment_event_data.py +++ b/advancedbilling/models/apply_payment_event_data.py @@ -43,6 +43,8 @@ class ApplyPaymentEventData(object): remaining_prepayment_amount (str): TODO: type description here. prepayment (bool): TODO: type description here. external (bool): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -86,7 +88,7 @@ def __init__(self, remaining_prepayment_amount=APIHelper.SKIP, prepayment=APIHelper.SKIP, external=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the ApplyPaymentEventData class""" # Initialize members of the class @@ -108,6 +110,8 @@ def __init__(self, self.external = external # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -126,7 +130,7 @@ def from_dictionary(cls, """ from advancedbilling.utilities.union_type_lookup import UnionTypeLookUp - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -142,9 +146,7 @@ def from_dictionary(cls, 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 - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, @@ -157,7 +159,7 @@ def from_dictionary(cls, remaining_prepayment_amount, prepayment, external, - dictionary) + additional_properties) @classmethod def validate(cls, dictionary): diff --git a/advancedbilling/models/attribute_error.py b/advancedbilling/models/attribute_error.py index 3f5a52e0..35606562 100644 --- a/advancedbilling/models/attribute_error.py +++ b/advancedbilling/models/attribute_error.py @@ -16,6 +16,8 @@ class AttributeError(object): Attributes: attribute (List[str]): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -26,13 +28,15 @@ class AttributeError(object): def __init__(self, attribute=None, - additional_properties={}): + additional_properties=None): """Constructor for the AttributeError class""" # Initialize members of the class self.attribute = attribute # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -50,15 +54,13 @@ def from_dictionary(cls, """ - if dictionary is None: + 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 # Clean out expected properties from dictionary - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, - dictionary) + additional_properties) diff --git a/advancedbilling/models/auto_invite.py b/advancedbilling/models/auto_invite.py index c3a23f1e..638ed6ab 100644 --- a/advancedbilling/models/auto_invite.py +++ b/advancedbilling/models/auto_invite.py @@ -17,6 +17,8 @@ class AutoInvite(object): 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. """ NO = 0 diff --git a/advancedbilling/models/auto_resume.py b/advancedbilling/models/auto_resume.py index cb16ecad..9deaddd4 100644 --- a/advancedbilling/models/auto_resume.py +++ b/advancedbilling/models/auto_resume.py @@ -17,6 +17,8 @@ class AutoResume(object): Attributes: automatically_resume_at (datetime): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -35,7 +37,7 @@ class AutoResume(object): def __init__(self, automatically_resume_at=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the AutoResume class""" # Initialize members of the class @@ -43,6 +45,8 @@ def __init__(self, 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: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -60,7 +64,7 @@ def from_dictionary(cls, """ - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -69,9 +73,7 @@ def from_dictionary(cls, else: automatically_resume_at = APIHelper.SKIP # Clean out expected properties from dictionary - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, - dictionary) + additional_properties) diff --git a/advancedbilling/models/backport_invoice_event.py b/advancedbilling/models/backport_invoice_event.py index 101bc8b6..c6f782ff 100644 --- a/advancedbilling/models/backport_invoice_event.py +++ b/advancedbilling/models/backport_invoice_event.py @@ -23,6 +23,8 @@ class BackportInvoiceEvent(object): invoice (Invoice): TODO: type description here. event_type (InvoiceEventType): TODO: type description here. event_data (Invoice): Example schema for an `backport_invoice` event + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -41,7 +43,7 @@ def __init__(self, invoice=None, event_type='backport_invoice', event_data=None, - additional_properties={}): + additional_properties=None): """Constructor for the BackportInvoiceEvent class""" # Initialize members of the class @@ -52,6 +54,8 @@ def __init__(self, self.event_data = event_data # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -69,7 +73,7 @@ def from_dictionary(cls, """ - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -79,16 +83,14 @@ def from_dictionary(cls, 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 - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, invoice, event_type, event_data, - dictionary) + additional_properties) @classmethod def validate(cls, dictionary): diff --git a/advancedbilling/models/bank_account_attributes.py b/advancedbilling/models/bank_account_attributes.py index c8027a6f..8df760d6 100644 --- a/advancedbilling/models/bank_account_attributes.py +++ b/advancedbilling/models/bank_account_attributes.py @@ -41,6 +41,8 @@ class BankAccountAttributes(object): 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. """ @@ -88,7 +90,7 @@ def __init__(self, current_vault=APIHelper.SKIP, vault_token=APIHelper.SKIP, customer_vault_token=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the BankAccountAttributes class""" # Initialize members of the class @@ -118,6 +120,8 @@ def __init__(self, self.customer_vault_token = customer_vault_token # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -135,7 +139,7 @@ def from_dictionary(cls, """ - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -152,9 +156,7 @@ def from_dictionary(cls, 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 - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, @@ -168,7 +170,7 @@ def from_dictionary(cls, current_vault, vault_token, customer_vault_token, - dictionary) + additional_properties) @classmethod def validate(cls, dictionary): diff --git a/advancedbilling/models/bank_account_holder_type.py b/advancedbilling/models/bank_account_holder_type.py index d51e7cbb..07c124f2 100644 --- a/advancedbilling/models/bank_account_holder_type.py +++ b/advancedbilling/models/bank_account_holder_type.py @@ -17,6 +17,8 @@ class BankAccountHolderType(object): Attributes: PERSONAL: TODO: type description here. BUSINESS: TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ _all_values = ['personal', 'business'] diff --git a/advancedbilling/models/bank_account_payment_profile.py b/advancedbilling/models/bank_account_payment_profile.py index f8d1480b..6f0e532d 100644 --- a/advancedbilling/models/bank_account_payment_profile.py +++ b/advancedbilling/models/bank_account_payment_profile.py @@ -58,6 +58,8 @@ class BankAccountPaymentProfile(object): providing the amounts of two small deposits made into the account site_gateway_setting_id (int): TODO: type description here. gateway_handle (str): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -145,7 +147,7 @@ def __init__(self, verified=False, site_gateway_setting_id=APIHelper.SKIP, gateway_handle=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the BankAccountPaymentProfile class""" # Initialize members of the class @@ -192,6 +194,8 @@ def __init__(self, self.gateway_handle = gateway_handle # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -209,7 +213,7 @@ def from_dictionary(cls, """ - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -236,9 +240,7 @@ def from_dictionary(cls, 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 # Clean out expected properties from dictionary - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, @@ -262,7 +264,7 @@ def from_dictionary(cls, verified, site_gateway_setting_id, gateway_handle, - dictionary) + additional_properties) @classmethod def validate(cls, dictionary): diff --git a/advancedbilling/models/bank_account_response.py b/advancedbilling/models/bank_account_response.py index 7720521b..1b60e54c 100644 --- a/advancedbilling/models/bank_account_response.py +++ b/advancedbilling/models/bank_account_response.py @@ -18,6 +18,8 @@ class BankAccountResponse(object): Attributes: payment_profile (BankAccountPaymentProfile): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -28,13 +30,15 @@ class BankAccountResponse(object): def __init__(self, payment_profile=None, - additional_properties={}): + additional_properties=None): """Constructor for the BankAccountResponse class""" # Initialize members of the class self.payment_profile = payment_profile # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -52,15 +56,13 @@ def from_dictionary(cls, """ - if dictionary is None: + 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 # Clean out expected properties from dictionary - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, - dictionary) + additional_properties) diff --git a/advancedbilling/models/bank_account_type.py b/advancedbilling/models/bank_account_type.py index 3d7b9d53..509c4c33 100644 --- a/advancedbilling/models/bank_account_type.py +++ b/advancedbilling/models/bank_account_type.py @@ -17,6 +17,8 @@ class BankAccountType(object): Attributes: CHECKING: TODO: type description here. SAVINGS: TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ _all_values = ['checking', 'savings'] diff --git a/advancedbilling/models/bank_account_vault.py b/advancedbilling/models/bank_account_vault.py index 9eeb9bcd..bd6c51dc 100644 --- a/advancedbilling/models/bank_account_vault.py +++ b/advancedbilling/models/bank_account_vault.py @@ -24,6 +24,8 @@ class BankAccountVault(object): MAXIO_PAYMENTS: TODO: type description here. MAXP: TODO: type description here. STRIPE_CONNECT: TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ _all_values = ['authorizenet', 'blue_snap', 'bogus', 'forte', 'gocardless', 'maxio_payments', 'maxp', 'stripe_connect'] diff --git a/advancedbilling/models/bank_account_verification.py b/advancedbilling/models/bank_account_verification.py index 3dec3fcb..9e004d84 100644 --- a/advancedbilling/models/bank_account_verification.py +++ b/advancedbilling/models/bank_account_verification.py @@ -18,6 +18,8 @@ class BankAccountVerification(object): Attributes: deposit_1_in_cents (long|int): TODO: type description here. deposit_2_in_cents (long|int): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -35,7 +37,7 @@ class BankAccountVerification(object): def __init__(self, deposit_1_in_cents=APIHelper.SKIP, deposit_2_in_cents=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the BankAccountVerification class""" # Initialize members of the class @@ -45,6 +47,8 @@ def __init__(self, self.deposit_2_in_cents = deposit_2_in_cents # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -62,17 +66,15 @@ def from_dictionary(cls, """ - if dictionary is None: + 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 # Clean out expected properties from dictionary - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, - dictionary) + additional_properties) diff --git a/advancedbilling/models/bank_account_verification_request.py b/advancedbilling/models/bank_account_verification_request.py index 36d9d72e..41b395a5 100644 --- a/advancedbilling/models/bank_account_verification_request.py +++ b/advancedbilling/models/bank_account_verification_request.py @@ -18,6 +18,8 @@ class BankAccountVerificationRequest(object): Attributes: bank_account_verification (BankAccountVerification): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -28,13 +30,15 @@ class BankAccountVerificationRequest(object): def __init__(self, bank_account_verification=None, - additional_properties={}): + additional_properties=None): """Constructor for the BankAccountVerificationRequest class""" # Initialize members of the class self.bank_account_verification = bank_account_verification # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -52,15 +56,13 @@ def from_dictionary(cls, """ - if dictionary is None: + 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 # Clean out expected properties from dictionary - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, - dictionary) + additional_properties) diff --git a/advancedbilling/models/base_refund_error.py b/advancedbilling/models/base_refund_error.py index d5df0497..93d4ebb7 100644 --- a/advancedbilling/models/base_refund_error.py +++ b/advancedbilling/models/base_refund_error.py @@ -17,6 +17,8 @@ class BaseRefundError(object): Attributes: base (List[object]): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -31,7 +33,7 @@ class BaseRefundError(object): def __init__(self, base=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the BaseRefundError class""" # Initialize members of the class @@ -39,6 +41,8 @@ def __init__(self, self.base = base # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -56,15 +60,13 @@ def from_dictionary(cls, """ - if dictionary is None: + 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 # Clean out expected properties from dictionary - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, - dictionary) + additional_properties) diff --git a/advancedbilling/models/base_string_error.py b/advancedbilling/models/base_string_error.py index b722f28c..3903dbb8 100644 --- a/advancedbilling/models/base_string_error.py +++ b/advancedbilling/models/base_string_error.py @@ -17,6 +17,8 @@ class BaseStringError(object): Attributes: base (List[str]): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -31,7 +33,7 @@ class BaseStringError(object): def __init__(self, base=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the BaseStringError class""" # Initialize members of the class @@ -39,6 +41,8 @@ def __init__(self, self.base = base # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -56,15 +60,13 @@ def from_dictionary(cls, """ - if dictionary is None: + 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 # Clean out expected properties from dictionary - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, - dictionary) + additional_properties) diff --git a/advancedbilling/models/basic_date_field.py b/advancedbilling/models/basic_date_field.py index d0314c12..7189c0d7 100644 --- a/advancedbilling/models/basic_date_field.py +++ b/advancedbilling/models/basic_date_field.py @@ -17,6 +17,8 @@ class BasicDateField(object): Attributes: UPDATED_AT: TODO: type description here. CREATED_AT: TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ UPDATED_AT = 'updated_at' diff --git a/advancedbilling/models/batch_job.py b/advancedbilling/models/batch_job.py index 8cf525dd..adda9a31 100644 --- a/advancedbilling/models/batch_job.py +++ b/advancedbilling/models/batch_job.py @@ -21,6 +21,8 @@ class BatchJob(object): row_count (int): TODO: type description here. created_at (datetime): TODO: type description here. completed (str): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -53,7 +55,7 @@ def __init__(self, row_count=APIHelper.SKIP, created_at=APIHelper.SKIP, completed=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the BatchJob class""" # Initialize members of the class @@ -69,6 +71,8 @@ def __init__(self, self.completed = completed # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -86,7 +90,7 @@ def from_dictionary(cls, """ - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -102,13 +106,11 @@ def from_dictionary(cls, created_at = APIHelper.SKIP completed = dictionary.get("completed") if dictionary.get("completed") else APIHelper.SKIP # Clean out expected properties from dictionary - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, row_count, created_at, completed, - dictionary) + additional_properties) diff --git a/advancedbilling/models/batch_job_response.py b/advancedbilling/models/batch_job_response.py index daf0cb59..18ceb301 100644 --- a/advancedbilling/models/batch_job_response.py +++ b/advancedbilling/models/batch_job_response.py @@ -17,6 +17,8 @@ class BatchJobResponse(object): Attributes: batchjob (BatchJob): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -27,13 +29,15 @@ class BatchJobResponse(object): def __init__(self, batchjob=None, - additional_properties={}): + additional_properties=None): """Constructor for the BatchJobResponse class""" # Initialize members of the class self.batchjob = batchjob # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -51,15 +55,13 @@ def from_dictionary(cls, """ - if dictionary is None: + 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 # Clean out expected properties from dictionary - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, - dictionary) + additional_properties) diff --git a/advancedbilling/models/billing_manifest.py b/advancedbilling/models/billing_manifest.py index cd05e3c0..3097b9c4 100644 --- a/advancedbilling/models/billing_manifest.py +++ b/advancedbilling/models/billing_manifest.py @@ -26,6 +26,8 @@ class BillingManifest(object): end_date (datetime): TODO: type description here. period_type (str): TODO: type description here. existing_balance_in_cents (long|int): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -70,7 +72,7 @@ def __init__(self, end_date=APIHelper.SKIP, period_type=APIHelper.SKIP, existing_balance_in_cents=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the BillingManifest class""" # Initialize members of the class @@ -94,6 +96,8 @@ def __init__(self, self.existing_balance_in_cents = existing_balance_in_cents # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -111,7 +115,7 @@ def from_dictionary(cls, """ - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -135,9 +139,7 @@ def from_dictionary(cls, 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 - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, @@ -148,4 +150,4 @@ def from_dictionary(cls, end_date, period_type, existing_balance_in_cents, - dictionary) + additional_properties) diff --git a/advancedbilling/models/billing_manifest_item.py b/advancedbilling/models/billing_manifest_item.py index 03323988..254e5e3f 100644 --- a/advancedbilling/models/billing_manifest_item.py +++ b/advancedbilling/models/billing_manifest_item.py @@ -32,6 +32,8 @@ class BillingManifestItem(object): product_name (str): TODO: type description here. period_range_start (str): TODO: type description here. period_range_end (str): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -85,7 +87,7 @@ def __init__(self, product_name=APIHelper.SKIP, period_range_start=APIHelper.SKIP, period_range_end=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the BillingManifestItem class""" # Initialize members of the class @@ -119,6 +121,8 @@ def __init__(self, self.period_range_end = period_range_end # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -136,7 +140,7 @@ def from_dictionary(cls, """ - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -155,9 +159,7 @@ def from_dictionary(cls, 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 - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, @@ -173,4 +175,4 @@ def from_dictionary(cls, product_name, period_range_start, period_range_end, - dictionary) + additional_properties) diff --git a/advancedbilling/models/billing_manifest_line_item_kind.py b/advancedbilling/models/billing_manifest_line_item_kind.py index 00a43157..5d086a28 100644 --- a/advancedbilling/models/billing_manifest_line_item_kind.py +++ b/advancedbilling/models/billing_manifest_line_item_kind.py @@ -21,6 +21,8 @@ class BillingManifestLineItemKind(object): COUPON: TODO: type description here. COMPONENT: TODO: type description here. TAX: TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ BASELINE = 'baseline' diff --git a/advancedbilling/models/billing_schedule.py b/advancedbilling/models/billing_schedule.py index c990a480..991db937 100644 --- a/advancedbilling/models/billing_schedule.py +++ b/advancedbilling/models/billing_schedule.py @@ -25,6 +25,8 @@ class BillingSchedule(object): 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. """ @@ -39,7 +41,7 @@ class BillingSchedule(object): def __init__(self, initial_billing_at=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the BillingSchedule class""" # Initialize members of the class @@ -47,6 +49,8 @@ def __init__(self, self.initial_billing_at = initial_billing_at # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -64,18 +68,16 @@ def from_dictionary(cls, """ - if dictionary is None: + 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 # Clean out expected properties from dictionary - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, - dictionary) + additional_properties) @classmethod def validate(cls, dictionary): diff --git a/advancedbilling/models/breakouts.py b/advancedbilling/models/breakouts.py index 996b23da..276aeea5 100644 --- a/advancedbilling/models/breakouts.py +++ b/advancedbilling/models/breakouts.py @@ -20,6 +20,8 @@ class Breakouts(object): plan_amount_formatted (str): TODO: type description here. usage_amount_in_cents (long|int): TODO: type description here. usage_amount_formatted (str): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -43,7 +45,7 @@ def __init__(self, plan_amount_formatted=APIHelper.SKIP, usage_amount_in_cents=APIHelper.SKIP, usage_amount_formatted=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the Breakouts class""" # Initialize members of the class @@ -57,6 +59,8 @@ def __init__(self, self.usage_amount_formatted = usage_amount_formatted # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -74,7 +78,7 @@ def from_dictionary(cls, """ - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -83,12 +87,10 @@ def from_dictionary(cls, 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 - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, usage_amount_in_cents, usage_amount_formatted, - dictionary) + additional_properties) diff --git a/advancedbilling/models/bulk_components_price_point_assignment.py b/advancedbilling/models/bulk_components_price_point_assignment.py index bc95ce71..740e4c2e 100644 --- a/advancedbilling/models/bulk_components_price_point_assignment.py +++ b/advancedbilling/models/bulk_components_price_point_assignment.py @@ -19,6 +19,8 @@ class BulkComponentsPricePointAssignment(object): Attributes: components (List[ComponentPricePointAssignment]): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -33,7 +35,7 @@ class BulkComponentsPricePointAssignment(object): def __init__(self, components=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the BulkComponentsPricePointAssignment class""" # Initialize members of the class @@ -41,6 +43,8 @@ def __init__(self, self.components = components # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -58,7 +62,7 @@ def from_dictionary(cls, """ - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -68,9 +72,7 @@ def from_dictionary(cls, else: components = APIHelper.SKIP # Clean out expected properties from dictionary - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, - dictionary) + additional_properties) diff --git a/advancedbilling/models/bulk_create_product_price_points_request.py b/advancedbilling/models/bulk_create_product_price_points_request.py index 98462909..9454581c 100644 --- a/advancedbilling/models/bulk_create_product_price_points_request.py +++ b/advancedbilling/models/bulk_create_product_price_points_request.py @@ -18,6 +18,8 @@ class BulkCreateProductPricePointsRequest(object): Attributes: price_points (List[CreateProductPricePoint]): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -28,13 +30,15 @@ class BulkCreateProductPricePointsRequest(object): def __init__(self, price_points=None, - additional_properties={}): + additional_properties=None): """Constructor for the BulkCreateProductPricePointsRequest class""" # Initialize members of the class self.price_points = price_points # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -52,7 +56,7 @@ def from_dictionary(cls, """ - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -60,9 +64,7 @@ def from_dictionary(cls, 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 - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, - dictionary) + additional_properties) diff --git a/advancedbilling/models/bulk_create_product_price_points_response.py b/advancedbilling/models/bulk_create_product_price_points_response.py index 96775a65..e717a700 100644 --- a/advancedbilling/models/bulk_create_product_price_points_response.py +++ b/advancedbilling/models/bulk_create_product_price_points_response.py @@ -18,6 +18,8 @@ class BulkCreateProductPricePointsResponse(object): Attributes: price_points (List[ProductPricePoint]): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -32,7 +34,7 @@ class BulkCreateProductPricePointsResponse(object): def __init__(self, price_points=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the BulkCreateProductPricePointsResponse class""" # Initialize members of the class @@ -40,6 +42,8 @@ def __init__(self, self.price_points = price_points # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -57,7 +61,7 @@ def from_dictionary(cls, """ - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -67,9 +71,7 @@ def from_dictionary(cls, else: price_points = APIHelper.SKIP # Clean out expected properties from dictionary - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, - dictionary) + additional_properties) diff --git a/advancedbilling/models/bulk_create_segments.py b/advancedbilling/models/bulk_create_segments.py index 29bf2434..0328a383 100644 --- a/advancedbilling/models/bulk_create_segments.py +++ b/advancedbilling/models/bulk_create_segments.py @@ -18,6 +18,8 @@ class BulkCreateSegments(object): Attributes: segments (List[CreateSegment]): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -32,7 +34,7 @@ class BulkCreateSegments(object): def __init__(self, segments=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the BulkCreateSegments class""" # Initialize members of the class @@ -40,6 +42,8 @@ def __init__(self, self.segments = segments # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -57,7 +61,7 @@ def from_dictionary(cls, """ - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -67,9 +71,7 @@ def from_dictionary(cls, else: segments = APIHelper.SKIP # Clean out expected properties from dictionary - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, - dictionary) + additional_properties) diff --git a/advancedbilling/models/bulk_update_segments.py b/advancedbilling/models/bulk_update_segments.py index 1ae9d41f..9ea36748 100644 --- a/advancedbilling/models/bulk_update_segments.py +++ b/advancedbilling/models/bulk_update_segments.py @@ -18,6 +18,8 @@ class BulkUpdateSegments(object): Attributes: segments (List[BulkUpdateSegmentsItem]): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -32,7 +34,7 @@ class BulkUpdateSegments(object): def __init__(self, segments=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the BulkUpdateSegments class""" # Initialize members of the class @@ -40,6 +42,8 @@ def __init__(self, self.segments = segments # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -57,7 +61,7 @@ def from_dictionary(cls, """ - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -67,9 +71,7 @@ def from_dictionary(cls, else: segments = APIHelper.SKIP # Clean out expected properties from dictionary - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, - dictionary) + additional_properties) diff --git a/advancedbilling/models/bulk_update_segments_item.py b/advancedbilling/models/bulk_update_segments_item.py index d42812ec..858f4e27 100644 --- a/advancedbilling/models/bulk_update_segments_item.py +++ b/advancedbilling/models/bulk_update_segments_item.py @@ -22,6 +22,8 @@ class BulkUpdateSegmentsItem(object): Components](https://help.chargify.com/products/product-components.h tml) for an overview of pricing schemes. prices (List[CreateOrUpdateSegmentPrice]): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -36,7 +38,7 @@ def __init__(self, id=None, pricing_scheme=None, prices=None, - additional_properties={}): + additional_properties=None): """Constructor for the BulkUpdateSegmentsItem class""" # Initialize members of the class @@ -45,6 +47,8 @@ def __init__(self, self.prices = prices # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -62,7 +66,7 @@ def from_dictionary(cls, """ - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -72,11 +76,9 @@ def from_dictionary(cls, if dictionary.get('prices') is not None: prices = [CreateOrUpdateSegmentPrice.from_dictionary(x) for x in dictionary.get('prices')] # Clean out expected properties from dictionary - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, prices, - dictionary) + additional_properties) diff --git a/advancedbilling/models/calendar_billing.py b/advancedbilling/models/calendar_billing.py index 3e863b28..f304a983 100644 --- a/advancedbilling/models/calendar_billing.py +++ b/advancedbilling/models/calendar_billing.py @@ -20,6 +20,8 @@ class CalendarBilling(object): processed on. Can be 1 up to 28 or 'end'. calendar_billing_first_charge (FirstChargeType): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -37,7 +39,7 @@ class CalendarBilling(object): def __init__(self, snap_day=APIHelper.SKIP, calendar_billing_first_charge=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the CalendarBilling class""" # Initialize members of the class @@ -47,6 +49,8 @@ def __init__(self, self.calendar_billing_first_charge = calendar_billing_first_charge # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -65,20 +69,18 @@ def from_dictionary(cls, """ from advancedbilling.utilities.union_type_lookup import UnionTypeLookUp - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary snap_day = APIHelper.deserialize_union_type(UnionTypeLookUp.get('CalendarBillingSnapDay'), dictionary.get('snap_day'), False) if dictionary.get('snap_day') is not None 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 - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, - dictionary) + additional_properties) @classmethod def validate(cls, dictionary): diff --git a/advancedbilling/models/cancel_grouped_subscriptions_request.py b/advancedbilling/models/cancel_grouped_subscriptions_request.py index edbed73c..189c2ac0 100644 --- a/advancedbilling/models/cancel_grouped_subscriptions_request.py +++ b/advancedbilling/models/cancel_grouped_subscriptions_request.py @@ -17,6 +17,8 @@ class CancelGroupedSubscriptionsRequest(object): Attributes: charge_unbilled_usage (bool): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -31,7 +33,7 @@ class CancelGroupedSubscriptionsRequest(object): def __init__(self, charge_unbilled_usage=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the CancelGroupedSubscriptionsRequest class""" # Initialize members of the class @@ -39,6 +41,8 @@ def __init__(self, self.charge_unbilled_usage = charge_unbilled_usage # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -56,15 +60,13 @@ def from_dictionary(cls, """ - if dictionary is None: + 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 # Clean out expected properties from dictionary - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, - dictionary) + additional_properties) diff --git a/advancedbilling/models/cancellation_method.py b/advancedbilling/models/cancellation_method.py index 91eed11f..835a6587 100644 --- a/advancedbilling/models/cancellation_method.py +++ b/advancedbilling/models/cancellation_method.py @@ -22,6 +22,8 @@ class CancellationMethod(object): BILLING_PORTAL: TODO: type description here. UNKNOWN: TODO: type description here. IMPORTED: TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ MERCHANT_UI = 'merchant_ui' diff --git a/advancedbilling/models/cancellation_options.py b/advancedbilling/models/cancellation_options.py index 7ed5f4a0..ff76d665 100644 --- a/advancedbilling/models/cancellation_options.py +++ b/advancedbilling/models/cancellation_options.py @@ -20,6 +20,8 @@ class CancellationOptions(object): 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. """ @@ -37,7 +39,7 @@ class CancellationOptions(object): def __init__(self, cancellation_message=APIHelper.SKIP, reason_code=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the CancellationOptions class""" # Initialize members of the class @@ -47,6 +49,8 @@ def __init__(self, self.reason_code = reason_code # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -64,17 +68,15 @@ def from_dictionary(cls, """ - if dictionary is None: + 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 # Clean out expected properties from dictionary - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, - dictionary) + additional_properties) diff --git a/advancedbilling/models/cancellation_request.py b/advancedbilling/models/cancellation_request.py index 061acd72..cca0bc8f 100644 --- a/advancedbilling/models/cancellation_request.py +++ b/advancedbilling/models/cancellation_request.py @@ -17,6 +17,8 @@ class CancellationRequest(object): Attributes: subscription (CancellationOptions): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -27,13 +29,15 @@ class CancellationRequest(object): def __init__(self, subscription=None, - additional_properties={}): + additional_properties=None): """Constructor for the CancellationRequest class""" # Initialize members of the class self.subscription = subscription # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -51,15 +55,13 @@ def from_dictionary(cls, """ - if dictionary is None: + 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 # Clean out expected properties from dictionary - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, - dictionary) + additional_properties) diff --git a/advancedbilling/models/card_type.py b/advancedbilling/models/card_type.py index e970948e..fa2318a5 100644 --- a/advancedbilling/models/card_type.py +++ b/advancedbilling/models/card_type.py @@ -51,6 +51,8 @@ class CardType(object): SWITCH: TODO: type description here. SOLO: TODO: type description here. LASER: TODO: type description here. + 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'] diff --git a/advancedbilling/models/change_chargeback_status_event.py b/advancedbilling/models/change_chargeback_status_event.py index 881f60bc..7c1e5473 100644 --- a/advancedbilling/models/change_chargeback_status_event.py +++ b/advancedbilling/models/change_chargeback_status_event.py @@ -25,6 +25,8 @@ class ChangeChargebackStatusEvent(object): event_type (InvoiceEventType): TODO: type description here. event_data (ChangeChargebackStatusEventData): Example schema for an `change_chargeback_status` event + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -43,7 +45,7 @@ def __init__(self, invoice=None, event_type='change_chargeback_status', event_data=None, - additional_properties={}): + additional_properties=None): """Constructor for the ChangeChargebackStatusEvent class""" # Initialize members of the class @@ -54,6 +56,8 @@ def __init__(self, self.event_data = event_data # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -71,7 +75,7 @@ def from_dictionary(cls, """ - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -81,16 +85,14 @@ def from_dictionary(cls, 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 - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, invoice, event_type, event_data, - dictionary) + additional_properties) @classmethod def validate(cls, dictionary): diff --git a/advancedbilling/models/change_chargeback_status_event_data.py b/advancedbilling/models/change_chargeback_status_event_data.py index 0c2635be..9984584f 100644 --- a/advancedbilling/models/change_chargeback_status_event_data.py +++ b/advancedbilling/models/change_chargeback_status_event_data.py @@ -18,6 +18,8 @@ class ChangeChargebackStatusEventData(object): Attributes: chargeback_status (ChargebackStatus): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -28,13 +30,15 @@ class ChangeChargebackStatusEventData(object): def __init__(self, chargeback_status=None, - additional_properties={}): + additional_properties=None): """Constructor for the ChangeChargebackStatusEventData class""" # Initialize members of the class self.chargeback_status = chargeback_status # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -52,18 +56,16 @@ def from_dictionary(cls, """ - if dictionary is None: + 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 # Clean out expected properties from dictionary - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, - dictionary) + additional_properties) @classmethod def validate(cls, dictionary): diff --git a/advancedbilling/models/change_invoice_collection_method_event.py b/advancedbilling/models/change_invoice_collection_method_event.py index 96c213ef..d391a7a0 100644 --- a/advancedbilling/models/change_invoice_collection_method_event.py +++ b/advancedbilling/models/change_invoice_collection_method_event.py @@ -25,6 +25,8 @@ class ChangeInvoiceCollectionMethodEvent(object): event_type (InvoiceEventType): TODO: type description here. event_data (ChangeInvoiceCollectionMethodEventData): Example schema for an `change_invoice_collection_method` event + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -43,7 +45,7 @@ def __init__(self, invoice=None, event_type='change_invoice_collection_method', event_data=None, - additional_properties={}): + additional_properties=None): """Constructor for the ChangeInvoiceCollectionMethodEvent class""" # Initialize members of the class @@ -54,6 +56,8 @@ def __init__(self, self.event_data = event_data # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -71,7 +75,7 @@ def from_dictionary(cls, """ - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -81,16 +85,14 @@ def from_dictionary(cls, 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 - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, invoice, event_type, event_data, - dictionary) + additional_properties) @classmethod def validate(cls, dictionary): diff --git a/advancedbilling/models/change_invoice_collection_method_event_data.py b/advancedbilling/models/change_invoice_collection_method_event_data.py index dc6704dd..b62ff796 100644 --- a/advancedbilling/models/change_invoice_collection_method_event_data.py +++ b/advancedbilling/models/change_invoice_collection_method_event_data.py @@ -19,6 +19,8 @@ class ChangeInvoiceCollectionMethodEventData(object): 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. """ @@ -31,7 +33,7 @@ class ChangeInvoiceCollectionMethodEventData(object): def __init__(self, from_collection_method=None, to_collection_method=None, - additional_properties={}): + additional_properties=None): """Constructor for the ChangeInvoiceCollectionMethodEventData class""" # Initialize members of the class @@ -39,6 +41,8 @@ def __init__(self, self.to_collection_method = to_collection_method # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -56,20 +60,18 @@ def from_dictionary(cls, """ - if dictionary is None: + 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 # Clean out expected properties from dictionary - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, - dictionary) + additional_properties) @classmethod def validate(cls, dictionary): diff --git a/advancedbilling/models/change_invoice_status_event.py b/advancedbilling/models/change_invoice_status_event.py index 77131eca..8cd65a00 100644 --- a/advancedbilling/models/change_invoice_status_event.py +++ b/advancedbilling/models/change_invoice_status_event.py @@ -25,6 +25,8 @@ class ChangeInvoiceStatusEvent(object): event_type (InvoiceEventType): TODO: type description here. event_data (ChangeInvoiceStatusEventData): Example schema for an `change_invoice_status` event + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -43,7 +45,7 @@ def __init__(self, invoice=None, event_type='change_invoice_status', event_data=None, - additional_properties={}): + additional_properties=None): """Constructor for the ChangeInvoiceStatusEvent class""" # Initialize members of the class @@ -54,6 +56,8 @@ def __init__(self, self.event_data = event_data # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -71,7 +75,7 @@ def from_dictionary(cls, """ - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -81,16 +85,14 @@ def from_dictionary(cls, 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 - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, invoice, event_type, event_data, - dictionary) + additional_properties) @classmethod def validate(cls, dictionary): diff --git a/advancedbilling/models/change_invoice_status_event_data.py b/advancedbilling/models/change_invoice_status_event_data.py index 04b4daaf..9c0f2b15 100644 --- a/advancedbilling/models/change_invoice_status_event_data.py +++ b/advancedbilling/models/change_invoice_status_event_data.py @@ -31,6 +31,8 @@ class ChangeInvoiceStatusEventData(object): 5-Advanced-Billing-Invoices-Overview#invoice-statuses) for more. consolidation_level (InvoiceConsolidationLevel): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -55,7 +57,7 @@ def __init__(self, gateway_trans_id=APIHelper.SKIP, amount=APIHelper.SKIP, consolidation_level=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the ChangeInvoiceStatusEventData class""" # Initialize members of the class @@ -69,6 +71,8 @@ def __init__(self, self.consolidation_level = consolidation_level # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -86,7 +90,7 @@ def from_dictionary(cls, """ - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -96,16 +100,14 @@ def from_dictionary(cls, 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 - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, gateway_trans_id, amount, consolidation_level, - dictionary) + additional_properties) @classmethod def validate(cls, dictionary): diff --git a/advancedbilling/models/chargeback_status.py b/advancedbilling/models/chargeback_status.py index 5bacab3e..98dfe9b4 100644 --- a/advancedbilling/models/chargeback_status.py +++ b/advancedbilling/models/chargeback_status.py @@ -19,6 +19,8 @@ class ChargebackStatus(object): LOST: TODO: type description here. WON: TODO: type description here. CLOSED: TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ _all_values = ['open', 'lost', 'won', 'closed'] diff --git a/advancedbilling/models/chargify_ebb.py b/advancedbilling/models/chargify_ebb.py index bcf7419f..fcc9d8b4 100644 --- a/advancedbilling/models/chargify_ebb.py +++ b/advancedbilling/models/chargify_ebb.py @@ -39,6 +39,8 @@ class ChargifyEBB(object): `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. """ @@ -68,7 +70,7 @@ def __init__(self, uniqueness_token=APIHelper.SKIP, subscription_id=APIHelper.SKIP, subscription_reference=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the ChargifyEBB class""" # Initialize members of the class @@ -86,6 +88,8 @@ def __init__(self, self.subscription_reference = subscription_reference # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -103,7 +107,7 @@ def from_dictionary(cls, """ - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -114,9 +118,7 @@ def from_dictionary(cls, 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 - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, @@ -124,4 +126,4 @@ def from_dictionary(cls, uniqueness_token, subscription_id, subscription_reference, - dictionary) + additional_properties) diff --git a/advancedbilling/models/cleanup_scope.py b/advancedbilling/models/cleanup_scope.py index 51966435..65bdc2ad 100644 --- a/advancedbilling/models/cleanup_scope.py +++ b/advancedbilling/models/cleanup_scope.py @@ -20,6 +20,8 @@ class CleanupScope(object): Attributes: ALL: TODO: type description here. CUSTOMERS: TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ ALL = 'all' diff --git a/advancedbilling/models/collection_method.py b/advancedbilling/models/collection_method.py index 8334809c..1378c2ef 100644 --- a/advancedbilling/models/collection_method.py +++ b/advancedbilling/models/collection_method.py @@ -22,6 +22,8 @@ class CollectionMethod(object): REMITTANCE: TODO: type description here. PREPAID: TODO: type description here. INVOICE: TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ _all_values = ['automatic', 'remittance', 'prepaid', 'invoice'] diff --git a/advancedbilling/models/component.py b/advancedbilling/models/component.py index 499b2c4b..e61ca58b 100644 --- a/advancedbilling/models/component.py +++ b/advancedbilling/models/component.py @@ -40,9 +40,8 @@ class Component(object): or not. description (str): The description of the component. default_price_point_id (int): TODO: type description here. - overage_prices (List[ComponentPrice]): An array of price brackets. If - the component uses the ‘per_unit’ pricing scheme, this array will - be empty. + 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. @@ -89,6 +88,8 @@ class Component(object): 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. """ @@ -222,7 +223,7 @@ def __init__(self, event_based_billing_metric_id=APIHelper.SKIP, interval=APIHelper.SKIP, interval_unit=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the Component class""" # Initialize members of the class @@ -296,6 +297,8 @@ def __init__(self, self.interval_unit = interval_unit # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -313,7 +316,7 @@ def from_dictionary(cls, """ - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -361,9 +364,7 @@ def from_dictionary(cls, 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 - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, @@ -399,4 +400,4 @@ def from_dictionary(cls, event_based_billing_metric_id, interval, interval_unit, - dictionary) + additional_properties) diff --git a/advancedbilling/models/component_allocation_change.py b/advancedbilling/models/component_allocation_change.py index c6e8c8f2..4e60bd34 100644 --- a/advancedbilling/models/component_allocation_change.py +++ b/advancedbilling/models/component_allocation_change.py @@ -23,6 +23,8 @@ class ComponentAllocationChange(object): memo (str): TODO: type description here. allocation_id (int): TODO: type description here. allocated_quantity (int | str | None): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -49,7 +51,7 @@ def __init__(self, memo=None, allocation_id=None, allocated_quantity=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the ComponentAllocationChange class""" # Initialize members of the class @@ -63,6 +65,8 @@ def __init__(self, self.allocated_quantity = allocated_quantity # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -81,7 +85,7 @@ def from_dictionary(cls, """ from advancedbilling.utilities.union_type_lookup import UnionTypeLookUp - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -93,9 +97,7 @@ def from_dictionary(cls, 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 - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, @@ -104,7 +106,7 @@ def from_dictionary(cls, memo, allocation_id, allocated_quantity, - dictionary) + additional_properties) @classmethod def validate(cls, dictionary): diff --git a/advancedbilling/models/component_allocation_error_item.py b/advancedbilling/models/component_allocation_error_item.py index 1fdb2df7..fc2bb6dd 100644 --- a/advancedbilling/models/component_allocation_error_item.py +++ b/advancedbilling/models/component_allocation_error_item.py @@ -20,6 +20,8 @@ class ComponentAllocationErrorItem(object): message (str): TODO: type description here. kind (str): TODO: type description here. on (str): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -43,7 +45,7 @@ def __init__(self, message=APIHelper.SKIP, kind=APIHelper.SKIP, on=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the ComponentAllocationErrorItem class""" # Initialize members of the class @@ -57,6 +59,8 @@ def __init__(self, self.on = on # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -74,7 +78,7 @@ def from_dictionary(cls, """ - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -83,12 +87,10 @@ def from_dictionary(cls, 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 - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, kind, on, - dictionary) + additional_properties) diff --git a/advancedbilling/models/component_cost_data.py b/advancedbilling/models/component_cost_data.py index 704cbdca..95383147 100644 --- a/advancedbilling/models/component_cost_data.py +++ b/advancedbilling/models/component_cost_data.py @@ -27,6 +27,8 @@ class ComponentCostData(object): Components](https://help.chargify.com/products/product-components.h tml) for an overview of pricing schemes. tiers (List[ComponentCostDataRateTier]): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -63,7 +65,7 @@ def __init__(self, amount=APIHelper.SKIP, pricing_scheme=APIHelper.SKIP, tiers=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the ComponentCostData class""" # Initialize members of the class @@ -83,6 +85,8 @@ def __init__(self, self.tiers = tiers # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -100,7 +104,7 @@ def from_dictionary(cls, """ - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -116,9 +120,7 @@ def from_dictionary(cls, else: tiers = APIHelper.SKIP # Clean out expected properties from dictionary - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, @@ -127,7 +129,7 @@ def from_dictionary(cls, amount, pricing_scheme, tiers, - dictionary) + additional_properties) @classmethod def validate(cls, dictionary): diff --git a/advancedbilling/models/component_cost_data_rate_tier.py b/advancedbilling/models/component_cost_data_rate_tier.py index c2e3c4ee..edda0fd8 100644 --- a/advancedbilling/models/component_cost_data_rate_tier.py +++ b/advancedbilling/models/component_cost_data_rate_tier.py @@ -21,6 +21,8 @@ class ComponentCostDataRateTier(object): quantity (str): TODO: type description here. unit_price (str): TODO: type description here. amount (str): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -51,7 +53,7 @@ def __init__(self, quantity=APIHelper.SKIP, unit_price=APIHelper.SKIP, amount=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the ComponentCostDataRateTier class""" # Initialize members of the class @@ -67,6 +69,8 @@ def __init__(self, self.amount = amount # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -84,7 +88,7 @@ def from_dictionary(cls, """ - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -94,16 +98,14 @@ def from_dictionary(cls, 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 - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, quantity, unit_price, amount, - dictionary) + additional_properties) @classmethod def validate(cls, dictionary): diff --git a/advancedbilling/models/component_currency_price.py b/advancedbilling/models/component_currency_price.py index 45368a9d..d3536723 100644 --- a/advancedbilling/models/component_currency_price.py +++ b/advancedbilling/models/component_currency_price.py @@ -22,6 +22,8 @@ class ComponentCurrencyPrice(object): formatted_price (str): TODO: type description here. price_id (int): TODO: type description here. price_point_id (int): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -51,7 +53,7 @@ def __init__(self, formatted_price=APIHelper.SKIP, price_id=APIHelper.SKIP, price_point_id=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the ComponentCurrencyPrice class""" # Initialize members of the class @@ -69,6 +71,8 @@ def __init__(self, self.price_point_id = price_point_id # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -86,7 +90,7 @@ def from_dictionary(cls, """ - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -97,9 +101,7 @@ def from_dictionary(cls, 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 - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, @@ -107,4 +109,4 @@ def from_dictionary(cls, formatted_price, price_id, price_point_id, - dictionary) + additional_properties) diff --git a/advancedbilling/models/component_currency_prices_response.py b/advancedbilling/models/component_currency_prices_response.py index 2cc501f2..a3ab46bf 100644 --- a/advancedbilling/models/component_currency_prices_response.py +++ b/advancedbilling/models/component_currency_prices_response.py @@ -18,6 +18,8 @@ class ComponentCurrencyPricesResponse(object): Attributes: currency_prices (List[ComponentCurrencyPrice]): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -28,13 +30,15 @@ class ComponentCurrencyPricesResponse(object): def __init__(self, currency_prices=None, - additional_properties={}): + additional_properties=None): """Constructor for the ComponentCurrencyPricesResponse class""" # Initialize members of the class self.currency_prices = currency_prices # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -52,7 +56,7 @@ def from_dictionary(cls, """ - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -60,9 +64,7 @@ def from_dictionary(cls, 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 - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, - dictionary) + additional_properties) diff --git a/advancedbilling/models/component_custom_price.py b/advancedbilling/models/component_custom_price.py index 64077096..deefe27f 100644 --- a/advancedbilling/models/component_custom_price.py +++ b/advancedbilling/models/component_custom_price.py @@ -29,6 +29,8 @@ class ComponentCustomPrice(object): is only available for sites with Multifrequency enabled. 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. """ @@ -58,7 +60,7 @@ def __init__(self, pricing_scheme=APIHelper.SKIP, interval=APIHelper.SKIP, interval_unit=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the ComponentCustomPrice class""" # Initialize members of the class @@ -73,6 +75,8 @@ def __init__(self, self.prices = prices # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -90,7 +94,7 @@ def from_dictionary(cls, """ - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -102,16 +106,14 @@ def from_dictionary(cls, 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 - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, - dictionary) + additional_properties) @classmethod def validate(cls, dictionary): diff --git a/advancedbilling/models/component_kind.py b/advancedbilling/models/component_kind.py index a63967f9..2658b8c6 100644 --- a/advancedbilling/models/component_kind.py +++ b/advancedbilling/models/component_kind.py @@ -20,6 +20,8 @@ class ComponentKind(object): ON_OFF_COMPONENT: TODO: type description here. PREPAID_USAGE_COMPONENT: TODO: type description here. EVENT_BASED_COMPONENT: TODO: type description here. + 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'] diff --git a/advancedbilling/models/component_price.py b/advancedbilling/models/component_price.py index 794dd55f..3837214f 100644 --- a/advancedbilling/models/component_price.py +++ b/advancedbilling/models/component_price.py @@ -24,6 +24,8 @@ class ComponentPrice(object): price_point_id (int): TODO: type description here. formatted_unit_price (str): TODO: type description here. segment_id (int): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -64,7 +66,7 @@ def __init__(self, price_point_id=APIHelper.SKIP, formatted_unit_price=APIHelper.SKIP, segment_id=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the ComponentPrice class""" # Initialize members of the class @@ -86,6 +88,8 @@ def __init__(self, self.segment_id = segment_id # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -103,7 +107,7 @@ def from_dictionary(cls, """ - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -116,9 +120,7 @@ def from_dictionary(cls, 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 - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, @@ -128,4 +130,4 @@ def from_dictionary(cls, price_point_id, formatted_unit_price, segment_id, - dictionary) + additional_properties) diff --git a/advancedbilling/models/component_price_point.py b/advancedbilling/models/component_price_point.py index 44d04f67..d12387a3 100644 --- a/advancedbilling/models/component_price_point.py +++ b/advancedbilling/models/component_price_point.py @@ -57,6 +57,26 @@ class ComponentPricePoint(object): 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. + 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. """ @@ -78,7 +98,13 @@ class ComponentPricePoint(object): "tax_included": 'tax_included', "interval": 'interval', "interval_unit": 'interval_unit', - "currency_prices": 'currency_prices' + "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 = [ @@ -99,6 +125,12 @@ class ComponentPricePoint(object): 'interval', 'interval_unit', 'currency_prices', + 'overage_prices', + 'overage_pricing_scheme', + 'renew_prepaid_allocation', + 'rollover_prepaid_remainder', + 'expiration_interval', + 'expiration_interval_unit', ] _nullables = [ @@ -106,6 +138,8 @@ class ComponentPricePoint(object): 'archived_at', 'interval', 'interval_unit', + 'expiration_interval', + 'expiration_interval_unit', ] def __init__(self, @@ -126,7 +160,13 @@ def __init__(self, interval=APIHelper.SKIP, interval_unit=APIHelper.SKIP, currency_prices=APIHelper.SKIP, - additional_properties={}): + 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""" # Initialize members of the class @@ -164,8 +204,22 @@ def __init__(self, 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 # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -183,7 +237,7 @@ def from_dictionary(cls, """ - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -215,10 +269,18 @@ def from_dictionary(cls, 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 # Clean out expected properties from dictionary - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, @@ -237,4 +299,10 @@ def from_dictionary(cls, interval, interval_unit, currency_prices, - dictionary) + overage_prices, + overage_pricing_scheme, + renew_prepaid_allocation, + rollover_prepaid_remainder, + expiration_interval, + expiration_interval_unit, + additional_properties) diff --git a/advancedbilling/models/component_price_point_assignment.py b/advancedbilling/models/component_price_point_assignment.py index e05b8828..ff7690b5 100644 --- a/advancedbilling/models/component_price_point_assignment.py +++ b/advancedbilling/models/component_price_point_assignment.py @@ -18,6 +18,8 @@ class ComponentPricePointAssignment(object): Attributes: component_id (int): TODO: type description here. price_point (str | int | None): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -35,7 +37,7 @@ class ComponentPricePointAssignment(object): def __init__(self, component_id=APIHelper.SKIP, price_point=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the ComponentPricePointAssignment class""" # Initialize members of the class @@ -45,6 +47,8 @@ def __init__(self, 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 @@ -63,17 +67,15 @@ def from_dictionary(cls, """ from advancedbilling.utilities.union_type_lookup import UnionTypeLookUp - if dictionary is None: + 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 # Clean out expected properties from dictionary - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, - dictionary) + additional_properties) diff --git a/advancedbilling/models/component_price_point_error_item.py b/advancedbilling/models/component_price_point_error_item.py index a0f1864c..f7c7946d 100644 --- a/advancedbilling/models/component_price_point_error_item.py +++ b/advancedbilling/models/component_price_point_error_item.py @@ -19,6 +19,8 @@ class ComponentPricePointErrorItem(object): component_id (int): TODO: type description here. message (str): TODO: type description here. price_point (int): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -39,7 +41,7 @@ def __init__(self, component_id=APIHelper.SKIP, message=APIHelper.SKIP, price_point=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the ComponentPricePointErrorItem class""" # Initialize members of the class @@ -51,6 +53,8 @@ def __init__(self, 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 @@ -68,7 +72,7 @@ def from_dictionary(cls, """ - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -76,11 +80,9 @@ def from_dictionary(cls, 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 - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, price_point, - dictionary) + additional_properties) diff --git a/advancedbilling/models/component_price_point_item.py b/advancedbilling/models/component_price_point_item.py index 3ce92b4b..82d067bd 100644 --- a/advancedbilling/models/component_price_point_item.py +++ b/advancedbilling/models/component_price_point_item.py @@ -31,6 +31,8 @@ class ComponentPricePointItem(object): for this component price point, either month or day. This property is only available for sites with Multifrequency enabled. prices (List[Price]): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -64,7 +66,7 @@ def __init__(self, interval=APIHelper.SKIP, interval_unit=APIHelper.SKIP, prices=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the ComponentPricePointItem class""" # Initialize members of the class @@ -82,6 +84,8 @@ def __init__(self, self.prices = prices # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -99,7 +103,7 @@ def from_dictionary(cls, """ - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -114,9 +118,7 @@ def from_dictionary(cls, else: prices = APIHelper.SKIP # Clean out expected properties from dictionary - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, @@ -124,7 +126,7 @@ def from_dictionary(cls, interval, interval_unit, prices, - dictionary) + additional_properties) @classmethod def validate(cls, dictionary): diff --git a/advancedbilling/models/component_price_point_response.py b/advancedbilling/models/component_price_point_response.py index a2101f58..3e107729 100644 --- a/advancedbilling/models/component_price_point_response.py +++ b/advancedbilling/models/component_price_point_response.py @@ -17,6 +17,8 @@ class ComponentPricePointResponse(object): Attributes: price_point (ComponentPricePoint): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -27,13 +29,15 @@ class ComponentPricePointResponse(object): def __init__(self, price_point=None, - additional_properties={}): + additional_properties=None): """Constructor for the ComponentPricePointResponse class""" # 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 @@ -51,15 +55,13 @@ def from_dictionary(cls, """ - if dictionary is None: + 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 # Clean out expected properties from dictionary - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, - dictionary) + additional_properties) diff --git a/advancedbilling/models/component_price_points_response.py b/advancedbilling/models/component_price_points_response.py index 12942349..57ec015e 100644 --- a/advancedbilling/models/component_price_points_response.py +++ b/advancedbilling/models/component_price_points_response.py @@ -20,6 +20,8 @@ class ComponentPricePointsResponse(object): Attributes: price_points (List[ComponentPricePoint]): TODO: type description here. meta (ListPublicKeysMeta): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -37,7 +39,7 @@ class ComponentPricePointsResponse(object): def __init__(self, price_points=APIHelper.SKIP, meta=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the ComponentPricePointsResponse class""" # Initialize members of the class @@ -47,6 +49,8 @@ def __init__(self, self.meta = meta # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -64,7 +68,7 @@ def from_dictionary(cls, """ - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -75,10 +79,8 @@ def from_dictionary(cls, price_points = APIHelper.SKIP meta = ListPublicKeysMeta.from_dictionary(dictionary.get('meta')) if 'meta' in dictionary.keys() else APIHelper.SKIP # Clean out expected properties from dictionary - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, - dictionary) + additional_properties) diff --git a/advancedbilling/models/component_response.py b/advancedbilling/models/component_response.py index 574097fa..b096da4c 100644 --- a/advancedbilling/models/component_response.py +++ b/advancedbilling/models/component_response.py @@ -17,6 +17,8 @@ class ComponentResponse(object): Attributes: component (Component): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -27,13 +29,15 @@ class ComponentResponse(object): def __init__(self, component=None, - additional_properties={}): + additional_properties=None): """Constructor for the ComponentResponse class""" # Initialize members of the class self.component = component # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -51,15 +55,13 @@ def from_dictionary(cls, """ - if dictionary is None: + 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 # Clean out expected properties from dictionary - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, - dictionary) + additional_properties) diff --git a/advancedbilling/models/compounding_strategy.py b/advancedbilling/models/compounding_strategy.py index bcf0804c..fa3b6a7d 100644 --- a/advancedbilling/models/compounding_strategy.py +++ b/advancedbilling/models/compounding_strategy.py @@ -12,11 +12,17 @@ class CompoundingStrategy(object): """Implementation of the 'Compounding Strategy' enum. - TODO: type enum description here. + 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: TODO: type description here. FULLPRICE: TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ _all_values = ['compound', 'full-price'] diff --git a/advancedbilling/models/consolidated_invoice.py b/advancedbilling/models/consolidated_invoice.py index 25faa338..7d5335fc 100644 --- a/advancedbilling/models/consolidated_invoice.py +++ b/advancedbilling/models/consolidated_invoice.py @@ -18,6 +18,8 @@ class ConsolidatedInvoice(object): Attributes: invoices (List[Invoice]): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -32,7 +34,7 @@ class ConsolidatedInvoice(object): def __init__(self, invoices=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the ConsolidatedInvoice class""" # Initialize members of the class @@ -40,6 +42,8 @@ def __init__(self, self.invoices = invoices # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -57,7 +61,7 @@ def from_dictionary(cls, """ - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -67,9 +71,7 @@ def from_dictionary(cls, else: invoices = APIHelper.SKIP # Clean out expected properties from dictionary - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, - dictionary) + additional_properties) diff --git a/advancedbilling/models/count_response.py b/advancedbilling/models/count_response.py index 1be10833..4720bbb1 100644 --- a/advancedbilling/models/count_response.py +++ b/advancedbilling/models/count_response.py @@ -17,6 +17,8 @@ class CountResponse(object): Attributes: count (int): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -31,7 +33,7 @@ class CountResponse(object): def __init__(self, count=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the CountResponse class""" # Initialize members of the class @@ -39,6 +41,8 @@ def __init__(self, self.count = count # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -56,15 +60,13 @@ def from_dictionary(cls, """ - if dictionary is None: + 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 # Clean out expected properties from dictionary - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, - dictionary) + additional_properties) diff --git a/advancedbilling/models/coupon.py b/advancedbilling/models/coupon.py index d148a0f2..98264d94 100644 --- a/advancedbilling/models/coupon.py +++ b/advancedbilling/models/coupon.py @@ -7,6 +7,7 @@ https://www.apimatic.io ). """ from advancedbilling.api_helper import APIHelper +from advancedbilling.models.coupon_currency import CouponCurrency from advancedbilling.models.coupon_restriction import CouponRestriction @@ -22,11 +23,13 @@ class Coupon(object): code (str): TODO: type description here. description (str): TODO: type description here. amount (float): TODO: type description here. - amount_in_cents (int): TODO: type description here. + amount_in_cents (long|int): TODO: type description here. product_family_id (int): TODO: type description here. product_family_name (str): TODO: type description here. start_date (datetime): TODO: type description here. - end_date (datetime): TODO: type description here. + 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): TODO: type description here. recurring (bool): TODO: type description here. recurring_scheme (RecurringScheme): TODO: type description here. @@ -34,12 +37,18 @@ class Coupon(object): duration_interval (int): TODO: type description here. duration_interval_unit (str): TODO: type description here. duration_interval_span (str): TODO: type description here. - allow_negative_balance (bool): TODO: type description here. + allow_negative_balance (bool): If set to true, discount is not limited + (credits will carry forward to next billing). archived_at (datetime): TODO: type description here. conversion_limit (str): TODO: type description here. - stackable (bool): TODO: type description here. - compounding_strategy (CompoundingStrategy): TODO: type description - here. + 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): TODO: type description here. created_at (datetime): TODO: type description here. updated_at (datetime): TODO: type description here. @@ -49,6 +58,10 @@ class Coupon(object): apply_on_subscription_expiration (bool): TODO: type description here. coupon_restrictions (List[CouponRestriction]): TODO: type description here. + 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. """ @@ -83,7 +96,8 @@ class Coupon(object): "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' + "coupon_restrictions": 'coupon_restrictions', + "currency_prices": 'currency_prices' } _optionals = [ @@ -117,6 +131,7 @@ class Coupon(object): 'apply_on_cancel_at_end_of_period', 'apply_on_subscription_expiration', 'coupon_restrictions', + 'currency_prices', ] _nullables = [ @@ -165,7 +180,8 @@ def __init__(self, apply_on_cancel_at_end_of_period=APIHelper.SKIP, apply_on_subscription_expiration=APIHelper.SKIP, coupon_restrictions=APIHelper.SKIP, - additional_properties={}): + currency_prices=APIHelper.SKIP, + additional_properties=None): """Constructor for the Coupon class""" # Initialize members of the class @@ -229,8 +245,12 @@ def __init__(self, self.apply_on_subscription_expiration = apply_on_subscription_expiration if coupon_restrictions is not APIHelper.SKIP: self.coupon_restrictions = coupon_restrictions + if currency_prices is not APIHelper.SKIP: + self.currency_prices = currency_prices # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -248,7 +268,7 @@ def from_dictionary(cls, """ - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -292,10 +312,13 @@ def from_dictionary(cls, 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')] + else: + currency_prices = APIHelper.SKIP # Clean out expected properties from dictionary - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, @@ -327,4 +350,5 @@ def from_dictionary(cls, apply_on_cancel_at_end_of_period, apply_on_subscription_expiration, coupon_restrictions, - dictionary) + currency_prices, + additional_properties) diff --git a/advancedbilling/models/coupon_currency.py b/advancedbilling/models/coupon_currency.py index 6e03aec6..e1d9c50b 100644 --- a/advancedbilling/models/coupon_currency.py +++ b/advancedbilling/models/coupon_currency.py @@ -18,8 +18,10 @@ class CouponCurrency(object): Attributes: id (int): TODO: type description here. currency (str): TODO: type description here. - price (int): TODO: type description here. + price (float): TODO: type description here. coupon_id (int): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -38,12 +40,17 @@ class CouponCurrency(object): 'coupon_id', ] + _nullables = [ + 'id', + 'price', + ] + def __init__(self, id=APIHelper.SKIP, currency=APIHelper.SKIP, price=APIHelper.SKIP, coupon_id=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the CouponCurrency class""" # Initialize members of the class @@ -57,6 +64,8 @@ def __init__(self, self.coupon_id = coupon_id # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -74,21 +83,19 @@ def from_dictionary(cls, """ - if dictionary is None: + 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 + 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 dictionary.get("price") 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 - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, price, coupon_id, - dictionary) + additional_properties) diff --git a/advancedbilling/models/coupon_currency_request.py b/advancedbilling/models/coupon_currency_request.py index 193dc51b..8165e11e 100644 --- a/advancedbilling/models/coupon_currency_request.py +++ b/advancedbilling/models/coupon_currency_request.py @@ -18,6 +18,8 @@ class CouponCurrencyRequest(object): Attributes: currency_prices (List[UpdateCouponCurrency]): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -28,13 +30,15 @@ class CouponCurrencyRequest(object): def __init__(self, currency_prices=None, - additional_properties={}): + additional_properties=None): """Constructor for the CouponCurrencyRequest class""" # Initialize members of the class self.currency_prices = currency_prices # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -52,7 +56,7 @@ def from_dictionary(cls, """ - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -60,9 +64,7 @@ def from_dictionary(cls, 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 - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, - dictionary) + additional_properties) diff --git a/advancedbilling/models/coupon_currency_response.py b/advancedbilling/models/coupon_currency_response.py index a61b2385..fb645964 100644 --- a/advancedbilling/models/coupon_currency_response.py +++ b/advancedbilling/models/coupon_currency_response.py @@ -18,6 +18,8 @@ class CouponCurrencyResponse(object): Attributes: currency_prices (List[CouponCurrency]): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -32,7 +34,7 @@ class CouponCurrencyResponse(object): def __init__(self, currency_prices=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the CouponCurrencyResponse class""" # Initialize members of the class @@ -40,6 +42,8 @@ def __init__(self, self.currency_prices = currency_prices # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -57,7 +61,7 @@ def from_dictionary(cls, """ - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -67,9 +71,7 @@ def from_dictionary(cls, else: currency_prices = APIHelper.SKIP # Clean out expected properties from dictionary - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, - dictionary) + additional_properties) diff --git a/advancedbilling/models/create_or_update_percentage_coupon.py b/advancedbilling/models/coupon_payload.py similarity index 62% rename from advancedbilling/models/create_or_update_percentage_coupon.py rename to advancedbilling/models/coupon_payload.py index 0b0fac39..c817d51b 100644 --- a/advancedbilling/models/create_or_update_percentage_coupon.py +++ b/advancedbilling/models/coupon_payload.py @@ -6,32 +6,53 @@ This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). """ +import dateutil.parser + from advancedbilling.api_helper import APIHelper -class CreateOrUpdatePercentageCoupon(object): +class CouponPayload(object): - """Implementation of the 'Create or Update Percentage Coupon' model. + """Implementation of the 'Coupon Payload' model. TODO: type model description here. Attributes: - name (str): the name of the coupon - code (str): may contain uppercase alphanumeric characters and these - special characters (which allow for email addresses to be used): - “%”, “@”, “+”, “-”, “_”, and “.” - description (str): TODO: type description here. - percentage (str | float): TODO: type description here. - allow_negative_balance (bool): TODO: type description here. + 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 (long|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. recurring (bool): TODO: type description here. - end_date (datetime): TODO: type description here. + 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): TODO: type description here. - stackable (bool): TODO: type description here. - compounding_strategy (CompoundingStrategy): TODO: type description - here. + 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): TODO: type description here. apply_on_cancel_at_end_of_period (bool): TODO: type description here. apply_on_subscription_expiration (bool): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -39,8 +60,9 @@ class CreateOrUpdatePercentageCoupon(object): _names = { "name": 'name', "code": 'code', - "percentage": 'percentage', "description": 'description', + "percentage": 'percentage', + "amount_in_cents": 'amount_in_cents', "allow_negative_balance": 'allow_negative_balance', "recurring": 'recurring', "end_date": 'end_date', @@ -53,7 +75,11 @@ class CreateOrUpdatePercentageCoupon(object): } _optionals = [ + 'name', + 'code', 'description', + 'percentage', + 'amount_in_cents', 'allow_negative_balance', 'recurring', 'end_date', @@ -66,10 +92,11 @@ class CreateOrUpdatePercentageCoupon(object): ] def __init__(self, - name=None, - code=None, - percentage=None, + 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, @@ -79,21 +106,26 @@ def __init__(self, exclude_mid_period_allocations=APIHelper.SKIP, apply_on_cancel_at_end_of_period=APIHelper.SKIP, apply_on_subscription_expiration=APIHelper.SKIP, - additional_properties={}): - """Constructor for the CreateOrUpdatePercentageCoupon class""" + additional_properties=None): + """Constructor for the CouponPayload class""" # Initialize members of the class - self.name = name - self.code = code + if name is not APIHelper.SKIP: + self.name = name + if code is not APIHelper.SKIP: + self.code = code if description is not APIHelper.SKIP: self.description = description - self.percentage = percentage + if percentage is not APIHelper.SKIP: + self.percentage = percentage + if amount_in_cents is not APIHelper.SKIP: + self.amount_in_cents = amount_in_cents if allow_negative_balance is not APIHelper.SKIP: self.allow_negative_balance = allow_negative_balance if recurring is not APIHelper.SKIP: self.recurring = recurring 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 = end_date if product_family_id is not APIHelper.SKIP: self.product_family_id = product_family_id if stackable is not APIHelper.SKIP: @@ -108,6 +140,8 @@ def __init__(self, self.apply_on_subscription_expiration = apply_on_subscription_expiration # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -126,17 +160,18 @@ def from_dictionary(cls, """ from advancedbilling.utilities.union_type_lookup import UnionTypeLookUp - if dictionary is None: + 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 - code = dictionary.get("code") if dictionary.get("code") else None - percentage = APIHelper.deserialize_union_type(UnionTypeLookUp.get('CreateOrUpdatePercentageCouponPercentage'), dictionary.get('percentage'), False) if dictionary.get('percentage') is not None else None + 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 = APIHelper.RFC3339DateTime.from_value(dictionary.get("end_date")).datetime if dictionary.get("end_date") 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 @@ -144,14 +179,13 @@ def from_dictionary(cls, 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 - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, - percentage, description, + percentage, + amount_in_cents, allow_negative_balance, recurring, end_date, @@ -161,35 +195,4 @@ def from_dictionary(cls, exclude_mid_period_allocations, apply_on_cancel_at_end_of_period, apply_on_subscription_expiration, - dictionary) - - @classmethod - def validate(cls, dictionary): - """Validates 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 APIHelper.is_valid_type(value=dictionary.name, - type_callable=lambda value: isinstance(value, str)) \ - and APIHelper.is_valid_type(value=dictionary.code, - type_callable=lambda value: isinstance(value, str)) \ - and UnionTypeLookUp.get('CreateOrUpdatePercentageCouponPercentage').validate(dictionary.percentage).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 APIHelper.is_valid_type(value=dictionary.get('code'), - type_callable=lambda value: isinstance(value, str)) \ - and UnionTypeLookUp.get('CreateOrUpdatePercentageCouponPercentage').validate(dictionary.get('percentage')).is_valid + additional_properties) diff --git a/advancedbilling/models/create_or_update_coupon.py b/advancedbilling/models/coupon_request.py similarity index 76% rename from advancedbilling/models/create_or_update_coupon.py rename to advancedbilling/models/coupon_request.py index a891fd70..ce4b3fc4 100644 --- a/advancedbilling/models/create_or_update_coupon.py +++ b/advancedbilling/models/coupon_request.py @@ -7,24 +7,25 @@ https://www.apimatic.io ). """ from advancedbilling.api_helper import APIHelper +from advancedbilling.models.coupon_payload import CouponPayload -class CreateOrUpdateCoupon(object): +class CouponRequest(object): - """Implementation of the 'Create or Update Coupon' model. + """Implementation of the 'Coupon Request' model. TODO: type model description here. Attributes: - coupon (CreateOrUpdatePercentageCoupon | - CreateOrUpdateFlatAmountCoupon | None): TODO: type description - here. + coupon (CouponPayload): TODO: type description here. restricted_products (Dict[str, bool]): An object where the keys are product_ids 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 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. """ @@ -45,8 +46,8 @@ def __init__(self, coupon=APIHelper.SKIP, restricted_products=APIHelper.SKIP, restricted_components=APIHelper.SKIP, - additional_properties={}): - """Constructor for the CreateOrUpdateCoupon class""" + additional_properties=None): + """Constructor for the CouponRequest class""" # Initialize members of the class if coupon is not APIHelper.SKIP: @@ -57,6 +58,8 @@ def __init__(self, self.restricted_components = restricted_components # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -73,21 +76,18 @@ def from_dictionary(cls, object: An instance of this structure class. """ - from advancedbilling.utilities.union_type_lookup import UnionTypeLookUp - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - coupon = APIHelper.deserialize_union_type(UnionTypeLookUp.get('CreateOrUpdateCouponCoupon'), dictionary.get('coupon'), False) if dictionary.get('coupon') is not None 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 - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, restricted_components, - dictionary) + additional_properties) diff --git a/advancedbilling/models/coupon_response.py b/advancedbilling/models/coupon_response.py index 04e1b7f7..f5fea960 100644 --- a/advancedbilling/models/coupon_response.py +++ b/advancedbilling/models/coupon_response.py @@ -18,6 +18,8 @@ class CouponResponse(object): Attributes: coupon (Coupon): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -32,7 +34,7 @@ class CouponResponse(object): def __init__(self, coupon=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the CouponResponse class""" # Initialize members of the class @@ -40,6 +42,8 @@ def __init__(self, self.coupon = coupon # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -57,15 +61,13 @@ def from_dictionary(cls, """ - if dictionary is None: + 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 # Clean out expected properties from dictionary - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, - dictionary) + additional_properties) diff --git a/advancedbilling/models/coupon_restriction.py b/advancedbilling/models/coupon_restriction.py index 217020ee..7b23f7d6 100644 --- a/advancedbilling/models/coupon_restriction.py +++ b/advancedbilling/models/coupon_restriction.py @@ -21,6 +21,8 @@ class CouponRestriction(object): item_id (int): TODO: type description here. name (str): TODO: type description here. handle (str): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -51,7 +53,7 @@ def __init__(self, item_id=APIHelper.SKIP, name=APIHelper.SKIP, handle=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the CouponRestriction class""" # Initialize members of the class @@ -67,6 +69,8 @@ def __init__(self, self.handle = handle # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -84,7 +88,7 @@ def from_dictionary(cls, """ - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -94,13 +98,11 @@ def from_dictionary(cls, 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 - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, item_id, name, handle, - dictionary) + additional_properties) diff --git a/advancedbilling/models/coupon_subcodes.py b/advancedbilling/models/coupon_subcodes.py index b121e291..34680081 100644 --- a/advancedbilling/models/coupon_subcodes.py +++ b/advancedbilling/models/coupon_subcodes.py @@ -17,6 +17,8 @@ class CouponSubcodes(object): Attributes: codes (List[str]): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -31,7 +33,7 @@ class CouponSubcodes(object): def __init__(self, codes=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the CouponSubcodes class""" # Initialize members of the class @@ -39,6 +41,8 @@ def __init__(self, self.codes = codes # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -56,15 +60,13 @@ def from_dictionary(cls, """ - if dictionary is None: + 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 # Clean out expected properties from dictionary - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, - dictionary) + additional_properties) diff --git a/advancedbilling/models/coupon_subcodes_response.py b/advancedbilling/models/coupon_subcodes_response.py index 59e8f5e8..7455b3ed 100644 --- a/advancedbilling/models/coupon_subcodes_response.py +++ b/advancedbilling/models/coupon_subcodes_response.py @@ -19,6 +19,8 @@ class CouponSubcodesResponse(object): created_codes (List[str]): TODO: type description here. duplicate_codes (List[str]): TODO: type description here. invalid_codes (List[str]): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -39,7 +41,7 @@ def __init__(self, created_codes=APIHelper.SKIP, duplicate_codes=APIHelper.SKIP, invalid_codes=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the CouponSubcodesResponse class""" # Initialize members of the class @@ -51,6 +53,8 @@ def __init__(self, self.invalid_codes = invalid_codes # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -68,7 +72,7 @@ def from_dictionary(cls, """ - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -76,11 +80,9 @@ def from_dictionary(cls, 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 - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, invalid_codes, - dictionary) + additional_properties) diff --git a/advancedbilling/models/coupon_usage.py b/advancedbilling/models/coupon_usage.py index b9289255..71c15dc2 100644 --- a/advancedbilling/models/coupon_usage.py +++ b/advancedbilling/models/coupon_usage.py @@ -27,6 +27,8 @@ class CouponUsage(object): received a discount from this coupon. revenue_in_cents (long|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. """ @@ -65,7 +67,7 @@ def __init__(self, savings_in_cents=APIHelper.SKIP, revenue=APIHelper.SKIP, revenue_in_cents=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the CouponUsage class""" # Initialize members of the class @@ -85,6 +87,8 @@ def __init__(self, self.revenue_in_cents = revenue_in_cents # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -102,7 +106,7 @@ def from_dictionary(cls, """ - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -114,9 +118,7 @@ def from_dictionary(cls, 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 - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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,4 +127,4 @@ def from_dictionary(cls, savings_in_cents, revenue, revenue_in_cents, - dictionary) + additional_properties) diff --git a/advancedbilling/models/create_allocation.py b/advancedbilling/models/create_allocation.py index b2a002e0..7343e745 100644 --- a/advancedbilling/models/create_allocation.py +++ b/advancedbilling/models/create_allocation.py @@ -53,6 +53,8 @@ class CreateAllocation(object): useful when you need to align billing events for different components on distinct schedules within a subscription. Please note this only works for site with Multifrequency enabled + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -102,7 +104,7 @@ def __init__(self, initiate_dunning=APIHelper.SKIP, price_point_id=APIHelper.SKIP, billing_schedule=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the CreateAllocation class""" # Initialize members of the class @@ -129,6 +131,8 @@ def __init__(self, self.billing_schedule = billing_schedule # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -147,7 +151,7 @@ def from_dictionary(cls, """ from advancedbilling.utilities.union_type_lookup import UnionTypeLookUp - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -166,9 +170,7 @@ def from_dictionary(cls, price_point_id = APIHelper.SKIP billing_schedule = BillingSchedule.from_dictionary(dictionary.get('billing_schedule')) if 'billing_schedule' in dictionary.keys() else APIHelper.SKIP # Clean out expected properties from dictionary - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, component_id, @@ -181,4 +183,4 @@ def from_dictionary(cls, initiate_dunning, price_point_id, billing_schedule, - dictionary) + additional_properties) diff --git a/advancedbilling/models/create_allocation_request.py b/advancedbilling/models/create_allocation_request.py index 1252de1e..eea50d1a 100644 --- a/advancedbilling/models/create_allocation_request.py +++ b/advancedbilling/models/create_allocation_request.py @@ -17,6 +17,8 @@ class CreateAllocationRequest(object): Attributes: allocation (CreateAllocation): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -27,13 +29,15 @@ class CreateAllocationRequest(object): def __init__(self, allocation=None, - additional_properties={}): + additional_properties=None): """Constructor for the CreateAllocationRequest class""" # Initialize members of the class self.allocation = allocation # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -51,15 +55,13 @@ def from_dictionary(cls, """ - if dictionary is None: + 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 # Clean out expected properties from dictionary - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, - dictionary) + additional_properties) diff --git a/advancedbilling/models/create_component_price_point.py b/advancedbilling/models/create_component_price_point.py index 95182d20..2f078fb8 100644 --- a/advancedbilling/models/create_component_price_point.py +++ b/advancedbilling/models/create_component_price_point.py @@ -27,8 +27,10 @@ class CreateComponentPricePoint(object): prices (List[Price]): TODO: type description here. 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 + 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 @@ -36,6 +38,8 @@ class CreateComponentPricePoint(object): 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. """ @@ -72,7 +76,7 @@ def __init__(self, tax_included=APIHelper.SKIP, interval=APIHelper.SKIP, interval_unit=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the CreateComponentPricePoint class""" # Initialize members of the class @@ -90,6 +94,8 @@ def __init__(self, self.interval_unit = interval_unit # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -107,7 +113,7 @@ def from_dictionary(cls, """ - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -122,9 +128,7 @@ def from_dictionary(cls, 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 - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, @@ -134,7 +138,7 @@ def from_dictionary(cls, tax_included, interval, interval_unit, - dictionary) + additional_properties) @classmethod def validate(cls, dictionary): diff --git a/advancedbilling/models/create_component_price_point_request.py b/advancedbilling/models/create_component_price_point_request.py index e20a2125..216e256c 100644 --- a/advancedbilling/models/create_component_price_point_request.py +++ b/advancedbilling/models/create_component_price_point_request.py @@ -19,6 +19,8 @@ class CreateComponentPricePointRequest(object): price_point (CreateComponentPricePoint | CreatePrepaidUsageComponentPricePoint): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -29,13 +31,15 @@ class CreateComponentPricePointRequest(object): def __init__(self, price_point=None, - additional_properties={}): + additional_properties=None): """Constructor for the CreateComponentPricePointRequest class""" # 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 @@ -54,18 +58,16 @@ def from_dictionary(cls, """ from advancedbilling.utilities.union_type_lookup import UnionTypeLookUp - if dictionary is None: + 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 # Clean out expected properties from dictionary - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, - dictionary) + additional_properties) @classmethod def validate(cls, dictionary): diff --git a/advancedbilling/models/create_component_price_points_request.py b/advancedbilling/models/create_component_price_points_request.py index d848d324..61636cfe 100644 --- a/advancedbilling/models/create_component_price_points_request.py +++ b/advancedbilling/models/create_component_price_points_request.py @@ -19,6 +19,8 @@ class CreateComponentPricePointsRequest(object): price_points (List[CreateComponentPricePoint | CreatePrepaidUsageComponentPricePoint]): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -29,13 +31,15 @@ class CreateComponentPricePointsRequest(object): def __init__(self, price_points=None, - additional_properties={}): + additional_properties=None): """Constructor for the CreateComponentPricePointsRequest class""" # Initialize members of the class self.price_points = price_points # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -54,18 +58,16 @@ def from_dictionary(cls, """ from advancedbilling.utilities.union_type_lookup import UnionTypeLookUp - if dictionary is None: + 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 # Clean out expected properties from dictionary - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, - dictionary) + additional_properties) @classmethod def validate(cls, dictionary): diff --git a/advancedbilling/models/create_credit_note_event.py b/advancedbilling/models/create_credit_note_event.py index cc81d048..28d372f1 100644 --- a/advancedbilling/models/create_credit_note_event.py +++ b/advancedbilling/models/create_credit_note_event.py @@ -25,6 +25,8 @@ class CreateCreditNoteEvent(object): event_type (InvoiceEventType): TODO: type description here. event_data (CreditNote): Example schema for an `create_credit_note` event + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -43,7 +45,7 @@ def __init__(self, invoice=None, event_type='create_credit_note', event_data=None, - additional_properties={}): + additional_properties=None): """Constructor for the CreateCreditNoteEvent class""" # Initialize members of the class @@ -54,6 +56,8 @@ def __init__(self, self.event_data = event_data # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -71,7 +75,7 @@ def from_dictionary(cls, """ - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -81,16 +85,14 @@ def from_dictionary(cls, 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 - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, invoice, event_type, event_data, - dictionary) + additional_properties) @classmethod def validate(cls, dictionary): diff --git a/advancedbilling/models/create_currency_price.py b/advancedbilling/models/create_currency_price.py index 49da2598..5233dc80 100644 --- a/advancedbilling/models/create_currency_price.py +++ b/advancedbilling/models/create_currency_price.py @@ -19,6 +19,8 @@ class CreateCurrencyPrice(object): 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. """ @@ -39,7 +41,7 @@ def __init__(self, currency=APIHelper.SKIP, price=APIHelper.SKIP, price_id=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the CreateCurrencyPrice class""" # Initialize members of the class @@ -51,6 +53,8 @@ def __init__(self, self.price_id = price_id # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -68,7 +72,7 @@ def from_dictionary(cls, """ - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -76,11 +80,9 @@ def from_dictionary(cls, 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 - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, price_id, - dictionary) + additional_properties) diff --git a/advancedbilling/models/create_currency_prices_request.py b/advancedbilling/models/create_currency_prices_request.py index fb90457c..499d4933 100644 --- a/advancedbilling/models/create_currency_prices_request.py +++ b/advancedbilling/models/create_currency_prices_request.py @@ -18,6 +18,8 @@ class CreateCurrencyPricesRequest(object): Attributes: currency_prices (List[CreateCurrencyPrice]): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -28,13 +30,15 @@ class CreateCurrencyPricesRequest(object): def __init__(self, currency_prices=None, - additional_properties={}): + additional_properties=None): """Constructor for the CreateCurrencyPricesRequest class""" # Initialize members of the class self.currency_prices = currency_prices # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -52,7 +56,7 @@ def from_dictionary(cls, """ - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -60,9 +64,7 @@ def from_dictionary(cls, 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 - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, - dictionary) + additional_properties) diff --git a/advancedbilling/models/create_customer.py b/advancedbilling/models/create_customer.py index f39f3e7b..b0314689 100644 --- a/advancedbilling/models/create_customer.py +++ b/advancedbilling/models/create_customer.py @@ -36,6 +36,8 @@ class CreateCustomer(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. """ @@ -106,7 +108,7 @@ def __init__(self, tax_exempt_reason=APIHelper.SKIP, parent_id=APIHelper.SKIP, salesforce_id=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the CreateCustomer class""" # Initialize members of the class @@ -147,6 +149,8 @@ def __init__(self, self.salesforce_id = salesforce_id # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -164,7 +168,7 @@ def from_dictionary(cls, """ - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -188,9 +192,7 @@ def from_dictionary(cls, 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 - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, @@ -211,4 +213,4 @@ def from_dictionary(cls, tax_exempt_reason, parent_id, salesforce_id, - dictionary) + additional_properties) diff --git a/advancedbilling/models/create_customer_request.py b/advancedbilling/models/create_customer_request.py index 3f1a5a1b..05e89158 100644 --- a/advancedbilling/models/create_customer_request.py +++ b/advancedbilling/models/create_customer_request.py @@ -17,6 +17,8 @@ class CreateCustomerRequest(object): Attributes: customer (CreateCustomer): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -27,13 +29,15 @@ class CreateCustomerRequest(object): def __init__(self, customer=None, - additional_properties={}): + additional_properties=None): """Constructor for the CreateCustomerRequest class""" # Initialize members of the class self.customer = customer # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -51,15 +55,13 @@ def from_dictionary(cls, """ - if dictionary is None: + 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 # Clean out expected properties from dictionary - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, - dictionary) + additional_properties) diff --git a/advancedbilling/models/create_debit_note_event.py b/advancedbilling/models/create_debit_note_event.py index 1d628252..a9991c63 100644 --- a/advancedbilling/models/create_debit_note_event.py +++ b/advancedbilling/models/create_debit_note_event.py @@ -24,6 +24,8 @@ class CreateDebitNoteEvent(object): invoice (Invoice): TODO: type description here. event_type (InvoiceEventType): TODO: type description here. event_data (DebitNote): Example schema for an `create_debit_note` event + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -42,7 +44,7 @@ def __init__(self, invoice=None, event_type='create_debit_note', event_data=None, - additional_properties={}): + additional_properties=None): """Constructor for the CreateDebitNoteEvent class""" # Initialize members of the class @@ -53,6 +55,8 @@ def __init__(self, self.event_data = event_data # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -70,7 +74,7 @@ def from_dictionary(cls, """ - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -80,16 +84,14 @@ def from_dictionary(cls, 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 - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, invoice, event_type, event_data, - dictionary) + additional_properties) @classmethod def validate(cls, dictionary): diff --git a/advancedbilling/models/create_ebb_component.py b/advancedbilling/models/create_ebb_component.py index e18f207c..ebeb3d54 100644 --- a/advancedbilling/models/create_ebb_component.py +++ b/advancedbilling/models/create_ebb_component.py @@ -17,6 +17,8 @@ class CreateEBBComponent(object): Attributes: event_based_component (EBBComponent): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -27,13 +29,15 @@ class CreateEBBComponent(object): def __init__(self, event_based_component=None, - additional_properties={}): + additional_properties=None): """Constructor for the CreateEBBComponent class""" # Initialize members of the class self.event_based_component = event_based_component # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -51,15 +55,13 @@ def from_dictionary(cls, """ - if dictionary is None: + 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 # Clean out expected properties from dictionary - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, - dictionary) + additional_properties) diff --git a/advancedbilling/models/create_invoice.py b/advancedbilling/models/create_invoice.py index 82f1f7f6..7deb59c9 100644 --- a/advancedbilling/models/create_invoice.py +++ b/advancedbilling/models/create_invoice.py @@ -37,6 +37,8 @@ class CreateInvoice(object): customer coupons (List[CreateInvoiceCoupon]): TODO: type description here. status (CreateInvoiceStatus): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -78,7 +80,7 @@ def __init__(self, shipping_address=APIHelper.SKIP, coupons=APIHelper.SKIP, status='open', - additional_properties={}): + additional_properties=None): """Constructor for the CreateInvoice class""" # Initialize members of the class @@ -103,6 +105,8 @@ def __init__(self, self.status = status # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -120,7 +124,7 @@ def from_dictionary(cls, """ - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -143,9 +147,7 @@ def from_dictionary(cls, coupons = APIHelper.SKIP status = dictionary.get("status") if dictionary.get("status") else 'open' # Clean out expected properties from dictionary - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, @@ -157,4 +159,4 @@ def from_dictionary(cls, shipping_address, coupons, status, - dictionary) + additional_properties) diff --git a/advancedbilling/models/create_invoice_address.py b/advancedbilling/models/create_invoice_address.py index 96e1cb80..27bbf67b 100644 --- a/advancedbilling/models/create_invoice_address.py +++ b/advancedbilling/models/create_invoice_address.py @@ -25,6 +25,8 @@ class CreateInvoiceAddress(object): state (str): TODO: type description here. zip (str): TODO: type description here. country (str): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -63,7 +65,7 @@ def __init__(self, state=APIHelper.SKIP, zip=APIHelper.SKIP, country=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the CreateInvoiceAddress class""" # Initialize members of the class @@ -87,6 +89,8 @@ def __init__(self, self.country = country # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -104,7 +108,7 @@ def from_dictionary(cls, """ - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -118,9 +122,7 @@ def from_dictionary(cls, 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 - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, @@ -131,4 +133,4 @@ def from_dictionary(cls, state, zip, country, - dictionary) + additional_properties) diff --git a/advancedbilling/models/create_invoice_coupon.py b/advancedbilling/models/create_invoice_coupon.py index 87a8f62f..2e7f475d 100644 --- a/advancedbilling/models/create_invoice_coupon.py +++ b/advancedbilling/models/create_invoice_coupon.py @@ -21,8 +21,14 @@ class CreateInvoiceCoupon(object): amount (str | float | None): TODO: type description here. description (str): TODO: type description here. product_family_id (str | int | None): TODO: type description here. - compounding_strategy (CompoundingStrategy): TODO: type description - here. + 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. """ @@ -52,7 +58,7 @@ def __init__(self, description=APIHelper.SKIP, product_family_id=APIHelper.SKIP, compounding_strategy=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the CreateInvoiceCoupon class""" # Initialize members of the class @@ -70,6 +76,8 @@ def __init__(self, self.compounding_strategy = compounding_strategy # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -88,7 +96,7 @@ def from_dictionary(cls, """ from advancedbilling.utilities.union_type_lookup import UnionTypeLookUp - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -99,9 +107,7 @@ def from_dictionary(cls, 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 - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, percentage, @@ -109,4 +115,4 @@ def from_dictionary(cls, description, product_family_id, compounding_strategy, - dictionary) + additional_properties) diff --git a/advancedbilling/models/create_invoice_item.py b/advancedbilling/models/create_invoice_item.py index 4d045a60..c251a8ef 100644 --- a/advancedbilling/models/create_invoice_item.py +++ b/advancedbilling/models/create_invoice_item.py @@ -37,6 +37,8 @@ class CreateInvoiceItem(object): component. product_price_point_id (str | int | None): TODO: type description here. description (str): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -84,7 +86,7 @@ def __init__(self, price_point_id=APIHelper.SKIP, product_price_point_id=APIHelper.SKIP, description=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the CreateInvoiceItem class""" # Initialize members of the class @@ -114,6 +116,8 @@ def __init__(self, self.description = description # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -132,7 +136,7 @@ def from_dictionary(cls, """ from advancedbilling.utilities.union_type_lookup import UnionTypeLookUp - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -149,9 +153,7 @@ def from_dictionary(cls, 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 - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, @@ -165,4 +167,4 @@ def from_dictionary(cls, price_point_id, product_price_point_id, description, - dictionary) + additional_properties) diff --git a/advancedbilling/models/create_invoice_payment.py b/advancedbilling/models/create_invoice_payment.py index 275e9724..0c7d473e 100644 --- a/advancedbilling/models/create_invoice_payment.py +++ b/advancedbilling/models/create_invoice_payment.py @@ -31,6 +31,8 @@ class CreateInvoicePayment(object): 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. """ @@ -60,7 +62,7 @@ def __init__(self, details=APIHelper.SKIP, payment_profile_id=APIHelper.SKIP, received_on=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the CreateInvoicePayment class""" # Initialize members of the class @@ -78,6 +80,8 @@ def __init__(self, self.received_on = received_on # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -96,7 +100,7 @@ def from_dictionary(cls, """ from advancedbilling.utilities.union_type_lookup import UnionTypeLookUp - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -107,9 +111,7 @@ def from_dictionary(cls, 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 - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, @@ -117,4 +119,4 @@ def from_dictionary(cls, details, payment_profile_id, received_on, - dictionary) + additional_properties) diff --git a/advancedbilling/models/create_invoice_payment_application.py b/advancedbilling/models/create_invoice_payment_application.py index d07af76c..f0d6f31e 100644 --- a/advancedbilling/models/create_invoice_payment_application.py +++ b/advancedbilling/models/create_invoice_payment_application.py @@ -20,6 +20,8 @@ class CreateInvoicePaymentApplication(object): 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. """ @@ -32,7 +34,7 @@ class CreateInvoicePaymentApplication(object): def __init__(self, invoice_uid=None, amount=None, - additional_properties={}): + additional_properties=None): """Constructor for the CreateInvoicePaymentApplication class""" # Initialize members of the class @@ -40,6 +42,8 @@ def __init__(self, self.amount = amount # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -57,20 +61,18 @@ def from_dictionary(cls, """ - if dictionary is None: + 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 # Clean out expected properties from dictionary - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, - dictionary) + additional_properties) @classmethod def validate(cls, dictionary): diff --git a/advancedbilling/models/create_invoice_payment_request.py b/advancedbilling/models/create_invoice_payment_request.py index 4437c4e6..e6d0b20f 100644 --- a/advancedbilling/models/create_invoice_payment_request.py +++ b/advancedbilling/models/create_invoice_payment_request.py @@ -20,6 +20,8 @@ class CreateInvoicePaymentRequest(object): payment (CreateInvoicePayment): TODO: type description here. 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. """ @@ -36,7 +38,7 @@ class CreateInvoicePaymentRequest(object): def __init__(self, payment=None, mtype=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the CreateInvoicePaymentRequest class""" # Initialize members of the class @@ -45,6 +47,8 @@ def __init__(self, self.mtype = mtype # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -62,17 +66,15 @@ def from_dictionary(cls, """ - if dictionary is None: + 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 # Clean out expected properties from dictionary - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, - dictionary) + additional_properties) diff --git a/advancedbilling/models/create_invoice_request.py b/advancedbilling/models/create_invoice_request.py index 04fe4878..48156923 100644 --- a/advancedbilling/models/create_invoice_request.py +++ b/advancedbilling/models/create_invoice_request.py @@ -17,6 +17,8 @@ class CreateInvoiceRequest(object): Attributes: invoice (CreateInvoice): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -27,13 +29,15 @@ class CreateInvoiceRequest(object): def __init__(self, invoice=None, - additional_properties={}): + additional_properties=None): """Constructor for the CreateInvoiceRequest class""" # Initialize members of the class self.invoice = invoice # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -51,15 +55,13 @@ def from_dictionary(cls, """ - if dictionary is None: + 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 # Clean out expected properties from dictionary - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, - dictionary) + additional_properties) diff --git a/advancedbilling/models/create_invoice_status.py b/advancedbilling/models/create_invoice_status.py index bc2abec4..2f643ce7 100644 --- a/advancedbilling/models/create_invoice_status.py +++ b/advancedbilling/models/create_invoice_status.py @@ -17,6 +17,8 @@ class CreateInvoiceStatus(object): Attributes: DRAFT: TODO: type description here. OPEN: TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ DRAFT = 'draft' diff --git a/advancedbilling/models/create_metadata.py b/advancedbilling/models/create_metadata.py index f7cf8f62..019e9129 100644 --- a/advancedbilling/models/create_metadata.py +++ b/advancedbilling/models/create_metadata.py @@ -18,6 +18,8 @@ class CreateMetadata(object): Attributes: name (str): TODO: type description here. value (str): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -35,7 +37,7 @@ class CreateMetadata(object): def __init__(self, name=APIHelper.SKIP, value=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the CreateMetadata class""" # Initialize members of the class @@ -45,6 +47,8 @@ def __init__(self, self.value = value # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -62,17 +66,15 @@ def from_dictionary(cls, """ - if dictionary is None: + 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 # Clean out expected properties from dictionary - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, - dictionary) + additional_properties) diff --git a/advancedbilling/models/create_metadata_request.py b/advancedbilling/models/create_metadata_request.py index 6762c467..8986e8d7 100644 --- a/advancedbilling/models/create_metadata_request.py +++ b/advancedbilling/models/create_metadata_request.py @@ -17,6 +17,8 @@ class CreateMetadataRequest(object): Attributes: metadata (List[CreateMetadata]): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -27,13 +29,15 @@ class CreateMetadataRequest(object): def __init__(self, metadata=None, - additional_properties={}): + additional_properties=None): """Constructor for the CreateMetadataRequest class""" # Initialize members of the class self.metadata = metadata # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -51,7 +55,7 @@ def from_dictionary(cls, """ - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -59,9 +63,7 @@ def from_dictionary(cls, if dictionary.get('metadata') is not None: metadata = [CreateMetadata.from_dictionary(x) for x in dictionary.get('metadata')] # Clean out expected properties from dictionary - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, - dictionary) + additional_properties) diff --git a/advancedbilling/models/create_metafield.py b/advancedbilling/models/create_metafield.py index 8bae2b07..76965265 100644 --- a/advancedbilling/models/create_metafield.py +++ b/advancedbilling/models/create_metafield.py @@ -29,6 +29,8 @@ class CreateMetafield(object): '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. """ @@ -52,7 +54,7 @@ def __init__(self, scope=APIHelper.SKIP, input_type=APIHelper.SKIP, enum=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the CreateMetafield class""" # Initialize members of the class @@ -66,6 +68,8 @@ def __init__(self, self.enum = enum # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -83,7 +87,7 @@ def from_dictionary(cls, """ - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -92,15 +96,13 @@ def from_dictionary(cls, 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 - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, input_type, enum, - dictionary) + additional_properties) @classmethod def validate(cls, dictionary): diff --git a/advancedbilling/models/create_metafields_request.py b/advancedbilling/models/create_metafields_request.py index 89dad461..36c40407 100644 --- a/advancedbilling/models/create_metafields_request.py +++ b/advancedbilling/models/create_metafields_request.py @@ -18,6 +18,8 @@ class CreateMetafieldsRequest(object): Attributes: metafields (CreateMetafield | List[CreateMetafield]): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -28,13 +30,15 @@ class CreateMetafieldsRequest(object): def __init__(self, metafields=None, - additional_properties={}): + additional_properties=None): """Constructor for the CreateMetafieldsRequest class""" # Initialize members of the class self.metafields = metafields # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -53,18 +57,16 @@ def from_dictionary(cls, """ from advancedbilling.utilities.union_type_lookup import UnionTypeLookUp - if dictionary is None: + 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 # Clean out expected properties from dictionary - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, - dictionary) + additional_properties) @classmethod def validate(cls, dictionary): diff --git a/advancedbilling/models/create_metered_component.py b/advancedbilling/models/create_metered_component.py index 0cd9e374..378bf205 100644 --- a/advancedbilling/models/create_metered_component.py +++ b/advancedbilling/models/create_metered_component.py @@ -17,6 +17,8 @@ class CreateMeteredComponent(object): Attributes: metered_component (MeteredComponent): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -27,13 +29,15 @@ class CreateMeteredComponent(object): def __init__(self, metered_component=None, - additional_properties={}): + additional_properties=None): """Constructor for the CreateMeteredComponent class""" # Initialize members of the class self.metered_component = metered_component # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -51,15 +55,13 @@ def from_dictionary(cls, """ - if dictionary is None: + 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 # Clean out expected properties from dictionary - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, - dictionary) + additional_properties) diff --git a/advancedbilling/models/create_multi_invoice_payment.py b/advancedbilling/models/create_multi_invoice_payment.py index 2d7e7f1d..de29a890 100644 --- a/advancedbilling/models/create_multi_invoice_payment.py +++ b/advancedbilling/models/create_multi_invoice_payment.py @@ -28,6 +28,8 @@ class CreateMultiInvoicePayment(object): a customer. Must be in the past. applications (List[CreateInvoicePaymentApplication]): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -55,7 +57,7 @@ def __init__(self, details=APIHelper.SKIP, method=APIHelper.SKIP, received_on=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the CreateMultiInvoicePayment class""" # Initialize members of the class @@ -71,6 +73,8 @@ def __init__(self, self.applications = applications # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -89,7 +93,7 @@ def from_dictionary(cls, """ from advancedbilling.utilities.union_type_lookup import UnionTypeLookUp - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -102,9 +106,7 @@ def from_dictionary(cls, 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 - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, @@ -112,7 +114,7 @@ def from_dictionary(cls, details, method, received_on, - dictionary) + additional_properties) @classmethod def validate(cls, dictionary): diff --git a/advancedbilling/models/create_multi_invoice_payment_request.py b/advancedbilling/models/create_multi_invoice_payment_request.py index 9027a794..037a397c 100644 --- a/advancedbilling/models/create_multi_invoice_payment_request.py +++ b/advancedbilling/models/create_multi_invoice_payment_request.py @@ -17,6 +17,8 @@ class CreateMultiInvoicePaymentRequest(object): Attributes: payment (CreateMultiInvoicePayment): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -27,13 +29,15 @@ class CreateMultiInvoicePaymentRequest(object): def __init__(self, payment=None, - additional_properties={}): + additional_properties=None): """Constructor for the CreateMultiInvoicePaymentRequest class""" # Initialize members of the class self.payment = payment # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -51,15 +55,13 @@ def from_dictionary(cls, """ - if dictionary is None: + 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 # Clean out expected properties from dictionary - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, - dictionary) + additional_properties) diff --git a/advancedbilling/models/create_offer.py b/advancedbilling/models/create_offer.py index f9679e42..ad34a9de 100644 --- a/advancedbilling/models/create_offer.py +++ b/advancedbilling/models/create_offer.py @@ -24,6 +24,8 @@ class CreateOffer(object): product_price_point_id (int): TODO: type description here. components (List[CreateOfferComponent]): TODO: type description here. coupons (List[str]): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -53,7 +55,7 @@ def __init__(self, product_price_point_id=APIHelper.SKIP, components=APIHelper.SKIP, coupons=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the CreateOffer class""" # Initialize members of the class @@ -70,6 +72,8 @@ def __init__(self, self.coupons = coupons # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -87,7 +91,7 @@ def from_dictionary(cls, """ - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -103,9 +107,7 @@ def from_dictionary(cls, components = APIHelper.SKIP coupons = dictionary.get("coupons") if dictionary.get("coupons") else APIHelper.SKIP # Clean out expected properties from dictionary - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, @@ -114,4 +116,4 @@ def from_dictionary(cls, product_price_point_id, components, coupons, - dictionary) + additional_properties) diff --git a/advancedbilling/models/create_offer_component.py b/advancedbilling/models/create_offer_component.py index 2e4bf473..329e38d5 100644 --- a/advancedbilling/models/create_offer_component.py +++ b/advancedbilling/models/create_offer_component.py @@ -19,6 +19,8 @@ class CreateOfferComponent(object): component_id (int): TODO: type description here. price_point_id (int): TODO: type description here. starting_quantity (int): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -39,7 +41,7 @@ def __init__(self, component_id=APIHelper.SKIP, price_point_id=APIHelper.SKIP, starting_quantity=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the CreateOfferComponent class""" # Initialize members of the class @@ -51,6 +53,8 @@ def __init__(self, self.starting_quantity = starting_quantity # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -68,7 +72,7 @@ def from_dictionary(cls, """ - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -76,11 +80,9 @@ def from_dictionary(cls, 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 - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, starting_quantity, - dictionary) + additional_properties) diff --git a/advancedbilling/models/create_offer_request.py b/advancedbilling/models/create_offer_request.py index a971ddc8..1f001c20 100644 --- a/advancedbilling/models/create_offer_request.py +++ b/advancedbilling/models/create_offer_request.py @@ -17,6 +17,8 @@ class CreateOfferRequest(object): Attributes: offer (CreateOffer): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -27,13 +29,15 @@ class CreateOfferRequest(object): def __init__(self, offer=None, - additional_properties={}): + additional_properties=None): """Constructor for the CreateOfferRequest class""" # Initialize members of the class self.offer = offer # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -51,15 +55,13 @@ def from_dictionary(cls, """ - if dictionary is None: + 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 # Clean out expected properties from dictionary - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, - dictionary) + additional_properties) diff --git a/advancedbilling/models/create_on_off_component.py b/advancedbilling/models/create_on_off_component.py index 452dd6e7..891488e6 100644 --- a/advancedbilling/models/create_on_off_component.py +++ b/advancedbilling/models/create_on_off_component.py @@ -17,6 +17,8 @@ class CreateOnOffComponent(object): Attributes: on_off_component (OnOffComponent): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -27,13 +29,15 @@ class CreateOnOffComponent(object): def __init__(self, on_off_component=None, - additional_properties={}): + additional_properties=None): """Constructor for the CreateOnOffComponent class""" # Initialize members of the class self.on_off_component = on_off_component # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -51,15 +55,13 @@ def from_dictionary(cls, """ - if dictionary is None: + 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 # Clean out expected properties from dictionary - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, - dictionary) + additional_properties) diff --git a/advancedbilling/models/create_or_update_endpoint.py b/advancedbilling/models/create_or_update_endpoint.py index cfa283e6..3ebf0d6f 100644 --- a/advancedbilling/models/create_or_update_endpoint.py +++ b/advancedbilling/models/create_or_update_endpoint.py @@ -18,6 +18,8 @@ class CreateOrUpdateEndpoint(object): url (str): TODO: type description here. webhook_subscriptions (List[WebhookSubscription]): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -30,7 +32,7 @@ class CreateOrUpdateEndpoint(object): def __init__(self, url=None, webhook_subscriptions=None, - additional_properties={}): + additional_properties=None): """Constructor for the CreateOrUpdateEndpoint class""" # Initialize members of the class @@ -38,6 +40,8 @@ def __init__(self, self.webhook_subscriptions = webhook_subscriptions # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -55,17 +59,15 @@ def from_dictionary(cls, """ - if dictionary is None: + 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 # Clean out expected properties from dictionary - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, - dictionary) + additional_properties) diff --git a/advancedbilling/models/create_or_update_endpoint_request.py b/advancedbilling/models/create_or_update_endpoint_request.py index 48684103..e42e1979 100644 --- a/advancedbilling/models/create_or_update_endpoint_request.py +++ b/advancedbilling/models/create_or_update_endpoint_request.py @@ -17,6 +17,8 @@ class CreateOrUpdateEndpointRequest(object): Attributes: endpoint (CreateOrUpdateEndpoint): Used to Create or Update Endpoint + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -27,13 +29,15 @@ class CreateOrUpdateEndpointRequest(object): def __init__(self, endpoint=None, - additional_properties={}): + additional_properties=None): """Constructor for the CreateOrUpdateEndpointRequest class""" # Initialize members of the class self.endpoint = endpoint # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -51,15 +55,13 @@ def from_dictionary(cls, """ - if dictionary is None: + 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 # Clean out expected properties from dictionary - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, - dictionary) + additional_properties) diff --git a/advancedbilling/models/create_or_update_flat_amount_coupon.py b/advancedbilling/models/create_or_update_flat_amount_coupon.py deleted file mode 100644 index a8904cac..00000000 --- a/advancedbilling/models/create_or_update_flat_amount_coupon.py +++ /dev/null @@ -1,195 +0,0 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing - -This file was automatically generated for Maxio by APIMATIC v3.0 ( - https://www.apimatic.io ). -""" -from advancedbilling.api_helper import APIHelper - - -class CreateOrUpdateFlatAmountCoupon(object): - - """Implementation of the 'Create or Update Flat Amount Coupon' model. - - TODO: type model description here. - - Attributes: - name (str): the name of the coupon - code (str): may contain uppercase alphanumeric characters and these - special characters (which allow for email addresses to be used): - “%”, “@”, “+”, “-”, “_”, and “.” - description (str): TODO: type description here. - amount_in_cents (long|int): TODO: type description here. - allow_negative_balance (bool): TODO: type description here. - recurring (bool): TODO: type description here. - end_date (datetime): TODO: type description here. - product_family_id (str): TODO: type description here. - stackable (bool): TODO: type description here. - compounding_strategy (CompoundingStrategy): TODO: type description - here. - exclude_mid_period_allocations (bool): TODO: type description here. - apply_on_cancel_at_end_of_period (bool): TODO: type description here. - apply_on_subscription_expiration (bool): TODO: type description here. - - """ - - # Create a mapping from Model property names to API property names - _names = { - "name": 'name', - "code": 'code', - "amount_in_cents": 'amount_in_cents', - "description": 'description', - "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 = [ - 'description', - '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=None, - code=None, - amount_in_cents=None, - description=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={}): - """Constructor for the CreateOrUpdateFlatAmountCoupon class""" - - # Initialize members of the class - self.name = name - self.code = code - if description is not APIHelper.SKIP: - self.description = description - self.amount_in_cents = amount_in_cents - if allow_negative_balance is not APIHelper.SKIP: - self.allow_negative_balance = allow_negative_balance - if recurring is not APIHelper.SKIP: - self.recurring = recurring - if end_date is not APIHelper.SKIP: - self.end_date = APIHelper.apply_datetime_converter(end_date, APIHelper.RFC3339DateTime) if end_date else None - if product_family_id is not APIHelper.SKIP: - self.product_family_id = product_family_id - if stackable is not APIHelper.SKIP: - self.stackable = stackable - if compounding_strategy is not APIHelper.SKIP: - self.compounding_strategy = compounding_strategy - if exclude_mid_period_allocations is not APIHelper.SKIP: - 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 - if apply_on_subscription_expiration is not APIHelper.SKIP: - self.apply_on_subscription_expiration = apply_on_subscription_expiration - - # Add additional model properties to the instance - self.additional_properties = additional_properties - - @classmethod - def from_dictionary(cls, - dictionary): - """Creates 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 dictionary is None: - return None - - # Extract variables from the dictionary - name = dictionary.get("name") if dictionary.get("name") else None - code = dictionary.get("code") if dictionary.get("code") else None - amount_in_cents = dictionary.get("amount_in_cents") if dictionary.get("amount_in_cents") else None - description = dictionary.get("description") if dictionary.get("description") 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 = APIHelper.RFC3339DateTime.from_value(dictionary.get("end_date")).datetime 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 - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] - # Return an object of this model - return cls(name, - code, - amount_in_cents, - description, - 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, - dictionary) - - @classmethod - def validate(cls, dictionary): - """Validates 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.name, - type_callable=lambda value: isinstance(value, str)) \ - and APIHelper.is_valid_type(value=dictionary.code, - type_callable=lambda value: isinstance(value, str)) \ - and APIHelper.is_valid_type(value=dictionary.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('name'), - type_callable=lambda value: isinstance(value, str)) \ - and APIHelper.is_valid_type(value=dictionary.get('code'), - type_callable=lambda value: isinstance(value, str)) \ - and APIHelper.is_valid_type(value=dictionary.get('amount_in_cents'), - type_callable=lambda value: isinstance(value, int)) diff --git a/advancedbilling/models/create_or_update_product.py b/advancedbilling/models/create_or_update_product.py index 0d58f47b..7c3c4e39 100644 --- a/advancedbilling/models/create_or_update_product.py +++ b/advancedbilling/models/create_or_update_product.py @@ -49,6 +49,8 @@ class CreateOrUpdateProduct(object): product type. This is especially important when using the Avalara service to tax based on locale. This attribute has a max length of 10 characters. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -108,7 +110,7 @@ def __init__(self, expiration_interval_unit=APIHelper.SKIP, auto_create_signup_page=APIHelper.SKIP, tax_code=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the CreateOrUpdateProduct class""" # Initialize members of the class @@ -141,6 +143,8 @@ def __init__(self, self.tax_code = tax_code # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -158,7 +162,7 @@ def from_dictionary(cls, """ - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -179,9 +183,7 @@ def from_dictionary(cls, 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 - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, @@ -199,4 +201,4 @@ def from_dictionary(cls, expiration_interval_unit, auto_create_signup_page, tax_code, - dictionary) + additional_properties) diff --git a/advancedbilling/models/create_or_update_product_request.py b/advancedbilling/models/create_or_update_product_request.py index 3b2a37f0..d7949b45 100644 --- a/advancedbilling/models/create_or_update_product_request.py +++ b/advancedbilling/models/create_or_update_product_request.py @@ -17,6 +17,8 @@ class CreateOrUpdateProductRequest(object): Attributes: product (CreateOrUpdateProduct): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -27,13 +29,15 @@ class CreateOrUpdateProductRequest(object): def __init__(self, product=None, - additional_properties={}): + additional_properties=None): """Constructor for the CreateOrUpdateProductRequest class""" # Initialize members of the class self.product = product # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -51,15 +55,13 @@ def from_dictionary(cls, """ - if dictionary is None: + 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 # Clean out expected properties from dictionary - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, - dictionary) + additional_properties) diff --git a/advancedbilling/models/create_or_update_segment_price.py b/advancedbilling/models/create_or_update_segment_price.py index 3699dd56..44ba453d 100644 --- a/advancedbilling/models/create_or_update_segment_price.py +++ b/advancedbilling/models/create_or_update_segment_price.py @@ -20,6 +20,8 @@ class CreateOrUpdateSegmentPrice(object): ending_quantity (int): TODO: type description here. 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. """ @@ -39,7 +41,7 @@ def __init__(self, unit_price=None, starting_quantity=APIHelper.SKIP, ending_quantity=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the CreateOrUpdateSegmentPrice class""" # Initialize members of the class @@ -50,6 +52,8 @@ def __init__(self, self.unit_price = unit_price # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -68,7 +72,7 @@ def from_dictionary(cls, """ from advancedbilling.utilities.union_type_lookup import UnionTypeLookUp - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -76,14 +80,12 @@ def from_dictionary(cls, 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 - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, ending_quantity, - dictionary) + additional_properties) @classmethod def validate(cls, dictionary): diff --git a/advancedbilling/models/create_payment.py b/advancedbilling/models/create_payment.py index a114a20a..5ee23c6c 100644 --- a/advancedbilling/models/create_payment.py +++ b/advancedbilling/models/create_payment.py @@ -20,6 +20,8 @@ class CreatePayment(object): payment_details (str): TODO: type description here. payment_method (InvoicePaymentMethodType): The type of payment method used. Defaults to other. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -36,7 +38,7 @@ def __init__(self, memo=None, payment_details=None, payment_method=None, - additional_properties={}): + additional_properties=None): """Constructor for the CreatePayment class""" # Initialize members of the class @@ -46,6 +48,8 @@ def __init__(self, self.payment_method = payment_method # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -63,7 +67,7 @@ def from_dictionary(cls, """ - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -72,12 +76,10 @@ def from_dictionary(cls, 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 - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, payment_details, payment_method, - dictionary) + additional_properties) diff --git a/advancedbilling/models/create_payment_profile.py b/advancedbilling/models/create_payment_profile.py index cdc53a8b..67ac57c3 100644 --- a/advancedbilling/models/create_payment_profile.py +++ b/advancedbilling/models/create_payment_profile.py @@ -103,6 +103,8 @@ class CreatePaymentProfile(object): 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. """ @@ -214,7 +216,7 @@ def __init__(self, bank_account_type=APIHelper.SKIP, bank_account_holder_type=APIHelper.SKIP, last_four=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the CreatePaymentProfile class""" # Initialize members of the class @@ -284,6 +286,8 @@ def __init__(self, self.last_four = last_four # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -302,7 +306,7 @@ def from_dictionary(cls, """ from advancedbilling.utilities.union_type_lookup import UnionTypeLookUp - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -339,9 +343,7 @@ def from_dictionary(cls, 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 - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, @@ -375,4 +377,4 @@ def from_dictionary(cls, bank_account_type, bank_account_holder_type, last_four, - dictionary) + additional_properties) diff --git a/advancedbilling/models/create_payment_profile_request.py b/advancedbilling/models/create_payment_profile_request.py index f4621aa8..1544c0f7 100644 --- a/advancedbilling/models/create_payment_profile_request.py +++ b/advancedbilling/models/create_payment_profile_request.py @@ -17,6 +17,8 @@ class CreatePaymentProfileRequest(object): Attributes: payment_profile (CreatePaymentProfile): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -27,13 +29,15 @@ class CreatePaymentProfileRequest(object): def __init__(self, payment_profile=None, - additional_properties={}): + additional_properties=None): """Constructor for the CreatePaymentProfileRequest class""" # Initialize members of the class self.payment_profile = payment_profile # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -51,15 +55,13 @@ def from_dictionary(cls, """ - if dictionary is None: + 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 # Clean out expected properties from dictionary - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, - dictionary) + additional_properties) diff --git a/advancedbilling/models/create_prepaid_component.py b/advancedbilling/models/create_prepaid_component.py index ca541458..182f75a7 100644 --- a/advancedbilling/models/create_prepaid_component.py +++ b/advancedbilling/models/create_prepaid_component.py @@ -18,6 +18,8 @@ class CreatePrepaidComponent(object): Attributes: prepaid_usage_component (PrepaidUsageComponent): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -28,13 +30,15 @@ class CreatePrepaidComponent(object): def __init__(self, prepaid_usage_component=None, - additional_properties={}): + additional_properties=None): """Constructor for the CreatePrepaidComponent class""" # Initialize members of the class self.prepaid_usage_component = prepaid_usage_component # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -52,15 +56,13 @@ def from_dictionary(cls, """ - if dictionary is None: + 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 # Clean out expected properties from dictionary - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, - dictionary) + additional_properties) diff --git a/advancedbilling/models/create_prepaid_usage_component_price_point.py b/advancedbilling/models/create_prepaid_usage_component_price_point.py index 6694206d..cc3ecdc9 100644 --- a/advancedbilling/models/create_prepaid_usage_component_price_point.py +++ b/advancedbilling/models/create_prepaid_usage_component_price_point.py @@ -30,18 +30,22 @@ class CreatePrepaidUsageComponentPricePoint(object): 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): 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 + 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 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): A string - representing the expiration interval unit for this component, - either month or day + 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. """ @@ -83,7 +87,7 @@ def __init__(self, renew_prepaid_allocation=APIHelper.SKIP, expiration_interval=APIHelper.SKIP, expiration_interval_unit=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the CreatePrepaidUsageComponentPricePoint class""" # Initialize members of the class @@ -104,6 +108,8 @@ def __init__(self, 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 @@ -121,7 +127,7 @@ def from_dictionary(cls, """ - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -138,9 +144,7 @@ def from_dictionary(cls, 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 - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, @@ -152,7 +156,7 @@ def from_dictionary(cls, renew_prepaid_allocation, expiration_interval, expiration_interval_unit, - dictionary) + additional_properties) @classmethod def validate(cls, dictionary): diff --git a/advancedbilling/models/create_prepayment.py b/advancedbilling/models/create_prepayment.py index 872d5655..1000ac0d 100644 --- a/advancedbilling/models/create_prepayment.py +++ b/advancedbilling/models/create_prepayment.py @@ -25,6 +25,8 @@ class CreatePrepayment(object): prepayment account balance. This is especially useful for manual replenishment of prepaid subscriptions. payment_profile_id (int): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -47,7 +49,7 @@ def __init__(self, memo=None, method=None, payment_profile_id=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the CreatePrepayment class""" # Initialize members of the class @@ -59,6 +61,8 @@ def __init__(self, self.payment_profile_id = payment_profile_id # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -76,7 +80,7 @@ def from_dictionary(cls, """ - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -86,13 +90,11 @@ def from_dictionary(cls, 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 - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, memo, method, payment_profile_id, - dictionary) + additional_properties) diff --git a/advancedbilling/models/create_prepayment_method.py b/advancedbilling/models/create_prepayment_method.py index d0c3e6b8..1c440046 100644 --- a/advancedbilling/models/create_prepayment_method.py +++ b/advancedbilling/models/create_prepayment_method.py @@ -26,6 +26,8 @@ class CreatePrepaymentMethod(object): CREDIT_CARD: TODO: type description here. CREDIT_CARD_ON_FILE: TODO: type description here. OTHER: TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ CHECK = 'check' diff --git a/advancedbilling/models/create_prepayment_request.py b/advancedbilling/models/create_prepayment_request.py index 5220f28e..be23c31d 100644 --- a/advancedbilling/models/create_prepayment_request.py +++ b/advancedbilling/models/create_prepayment_request.py @@ -17,6 +17,8 @@ class CreatePrepaymentRequest(object): Attributes: prepayment (CreatePrepayment): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -27,13 +29,15 @@ class CreatePrepaymentRequest(object): def __init__(self, prepayment=None, - additional_properties={}): + additional_properties=None): """Constructor for the CreatePrepaymentRequest class""" # Initialize members of the class self.prepayment = prepayment # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -51,15 +55,13 @@ def from_dictionary(cls, """ - if dictionary is None: + 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 # Clean out expected properties from dictionary - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, - dictionary) + additional_properties) diff --git a/advancedbilling/models/create_prepayment_response.py b/advancedbilling/models/create_prepayment_response.py index b247ce65..581450f4 100644 --- a/advancedbilling/models/create_prepayment_response.py +++ b/advancedbilling/models/create_prepayment_response.py @@ -17,6 +17,8 @@ class CreatePrepaymentResponse(object): Attributes: prepayment (CreatedPrepayment): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -27,13 +29,15 @@ class CreatePrepaymentResponse(object): def __init__(self, prepayment=None, - additional_properties={}): + additional_properties=None): """Constructor for the CreatePrepaymentResponse class""" # Initialize members of the class self.prepayment = prepayment # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -51,15 +55,13 @@ def from_dictionary(cls, """ - if dictionary is None: + 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 # Clean out expected properties from dictionary - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, - dictionary) + additional_properties) diff --git a/advancedbilling/models/create_product_currency_price.py b/advancedbilling/models/create_product_currency_price.py index 1cf6e8a1..095cd4ba 100644 --- a/advancedbilling/models/create_product_currency_price.py +++ b/advancedbilling/models/create_product_currency_price.py @@ -18,6 +18,8 @@ class CreateProductCurrencyPrice(object): 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. """ @@ -32,7 +34,7 @@ def __init__(self, currency=None, price=None, role=None, - additional_properties={}): + additional_properties=None): """Constructor for the CreateProductCurrencyPrice class""" # Initialize members of the class @@ -41,6 +43,8 @@ def __init__(self, self.role = role # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -58,7 +62,7 @@ def from_dictionary(cls, """ - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -66,11 +70,9 @@ def from_dictionary(cls, 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 - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, role, - dictionary) + additional_properties) diff --git a/advancedbilling/models/create_product_currency_prices_request.py b/advancedbilling/models/create_product_currency_prices_request.py index 283babeb..9360ab13 100644 --- a/advancedbilling/models/create_product_currency_prices_request.py +++ b/advancedbilling/models/create_product_currency_prices_request.py @@ -18,6 +18,8 @@ class CreateProductCurrencyPricesRequest(object): Attributes: currency_prices (List[CreateProductCurrencyPrice]): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -28,13 +30,15 @@ class CreateProductCurrencyPricesRequest(object): def __init__(self, currency_prices=None, - additional_properties={}): + additional_properties=None): """Constructor for the CreateProductCurrencyPricesRequest class""" # Initialize members of the class self.currency_prices = currency_prices # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -52,7 +56,7 @@ def from_dictionary(cls, """ - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -60,9 +64,7 @@ def from_dictionary(cls, 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 - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, - dictionary) + additional_properties) diff --git a/advancedbilling/models/create_product_family.py b/advancedbilling/models/create_product_family.py index a18369ee..58a02742 100644 --- a/advancedbilling/models/create_product_family.py +++ b/advancedbilling/models/create_product_family.py @@ -19,6 +19,8 @@ class CreateProductFamily(object): name (str): TODO: type description here. handle (str): TODO: type description here. description (str): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -43,7 +45,7 @@ def __init__(self, name=None, handle=APIHelper.SKIP, description=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the CreateProductFamily class""" # Initialize members of the class @@ -54,6 +56,8 @@ def __init__(self, self.description = description # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -71,7 +75,7 @@ def from_dictionary(cls, """ - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -79,11 +83,9 @@ def from_dictionary(cls, 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 - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, description, - dictionary) + additional_properties) diff --git a/advancedbilling/models/create_product_family_request.py b/advancedbilling/models/create_product_family_request.py index f7cbe338..c2ccc32b 100644 --- a/advancedbilling/models/create_product_family_request.py +++ b/advancedbilling/models/create_product_family_request.py @@ -17,6 +17,8 @@ class CreateProductFamilyRequest(object): Attributes: product_family (CreateProductFamily): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -27,13 +29,15 @@ class CreateProductFamilyRequest(object): def __init__(self, product_family=None, - additional_properties={}): + additional_properties=None): """Constructor for the CreateProductFamilyRequest class""" # Initialize members of the class self.product_family = product_family # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -51,15 +55,13 @@ def from_dictionary(cls, """ - if dictionary is None: + 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 # Clean out expected properties from dictionary - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, - dictionary) + additional_properties) diff --git a/advancedbilling/models/create_product_price_point.py b/advancedbilling/models/create_product_price_point.py index af634ba2..2062315a 100644 --- a/advancedbilling/models/create_product_price_point.py +++ b/advancedbilling/models/create_product_price_point.py @@ -46,6 +46,8 @@ class CreateProductPricePoint(object): 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. """ @@ -99,7 +101,7 @@ def __init__(self, expiration_interval=APIHelper.SKIP, expiration_interval_unit=APIHelper.SKIP, use_site_exchange_rate=True, - additional_properties={}): + additional_properties=None): """Constructor for the CreateProductPricePoint class""" # Initialize members of the class @@ -128,6 +130,8 @@ def __init__(self, self.use_site_exchange_rate = use_site_exchange_rate # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -145,7 +149,7 @@ def from_dictionary(cls, """ - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -164,9 +168,7 @@ def from_dictionary(cls, 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 - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, @@ -182,4 +184,4 @@ def from_dictionary(cls, expiration_interval, expiration_interval_unit, use_site_exchange_rate, - dictionary) + additional_properties) diff --git a/advancedbilling/models/create_product_price_point_request.py b/advancedbilling/models/create_product_price_point_request.py index 4633dec3..7b6cfd29 100644 --- a/advancedbilling/models/create_product_price_point_request.py +++ b/advancedbilling/models/create_product_price_point_request.py @@ -17,6 +17,8 @@ class CreateProductPricePointRequest(object): Attributes: price_point (CreateProductPricePoint): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -27,13 +29,15 @@ class CreateProductPricePointRequest(object): def __init__(self, price_point=None, - additional_properties={}): + additional_properties=None): """Constructor for the CreateProductPricePointRequest class""" # 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 @@ -51,15 +55,13 @@ def from_dictionary(cls, """ - if dictionary is None: + 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 # Clean out expected properties from dictionary - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, - dictionary) + additional_properties) diff --git a/advancedbilling/models/create_quantity_based_component.py b/advancedbilling/models/create_quantity_based_component.py index 26b82385..fb93395d 100644 --- a/advancedbilling/models/create_quantity_based_component.py +++ b/advancedbilling/models/create_quantity_based_component.py @@ -18,6 +18,8 @@ class CreateQuantityBasedComponent(object): Attributes: quantity_based_component (QuantityBasedComponent): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -28,13 +30,15 @@ class CreateQuantityBasedComponent(object): def __init__(self, quantity_based_component=None, - additional_properties={}): + additional_properties=None): """Constructor for the CreateQuantityBasedComponent class""" # Initialize members of the class self.quantity_based_component = quantity_based_component # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -52,15 +56,13 @@ def from_dictionary(cls, """ - if dictionary is None: + 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 # Clean out expected properties from dictionary - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, - dictionary) + additional_properties) diff --git a/advancedbilling/models/create_reason_code.py b/advancedbilling/models/create_reason_code.py index c1f33d9b..502ac1d1 100644 --- a/advancedbilling/models/create_reason_code.py +++ b/advancedbilling/models/create_reason_code.py @@ -19,6 +19,8 @@ class CreateReasonCode(object): 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. """ @@ -37,7 +39,7 @@ def __init__(self, code=None, description=None, position=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the CreateReasonCode class""" # Initialize members of the class @@ -47,6 +49,8 @@ def __init__(self, self.position = position # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -64,7 +68,7 @@ def from_dictionary(cls, """ - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -72,11 +76,9 @@ def from_dictionary(cls, 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 - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, position, - dictionary) + additional_properties) diff --git a/advancedbilling/models/create_reason_code_request.py b/advancedbilling/models/create_reason_code_request.py index 79f93eb8..aa606589 100644 --- a/advancedbilling/models/create_reason_code_request.py +++ b/advancedbilling/models/create_reason_code_request.py @@ -17,6 +17,8 @@ class CreateReasonCodeRequest(object): Attributes: reason_code (CreateReasonCode): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -27,13 +29,15 @@ class CreateReasonCodeRequest(object): def __init__(self, reason_code=None, - additional_properties={}): + additional_properties=None): """Constructor for the CreateReasonCodeRequest class""" # Initialize members of the class self.reason_code = reason_code # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -51,15 +55,13 @@ def from_dictionary(cls, """ - if dictionary is None: + 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 # Clean out expected properties from dictionary - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, - dictionary) + additional_properties) diff --git a/advancedbilling/models/create_segment.py b/advancedbilling/models/create_segment.py index f65c5e10..b2e69901 100644 --- a/advancedbilling/models/create_segment.py +++ b/advancedbilling/models/create_segment.py @@ -38,6 +38,8 @@ class CreateSegment(object): Components](https://help.chargify.com/products/product-components.h tml) for an overview of pricing schemes. prices (List[CreateOrUpdateSegmentPrice]): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -66,7 +68,7 @@ def __init__(self, segment_property_3_value=APIHelper.SKIP, segment_property_4_value=APIHelper.SKIP, prices=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the CreateSegment class""" # Initialize members of the class @@ -83,6 +85,8 @@ def __init__(self, self.prices = prices # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -101,7 +105,7 @@ def from_dictionary(cls, """ from advancedbilling.utilities.union_type_lookup import UnionTypeLookUp - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -116,9 +120,7 @@ def from_dictionary(cls, else: prices = APIHelper.SKIP # Clean out expected properties from dictionary - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, @@ -126,4 +128,4 @@ def from_dictionary(cls, segment_property_3_value, segment_property_4_value, prices, - dictionary) + additional_properties) diff --git a/advancedbilling/models/create_segment_request.py b/advancedbilling/models/create_segment_request.py index 041991a0..fc334c88 100644 --- a/advancedbilling/models/create_segment_request.py +++ b/advancedbilling/models/create_segment_request.py @@ -17,6 +17,8 @@ class CreateSegmentRequest(object): Attributes: segment (CreateSegment): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -27,13 +29,15 @@ class CreateSegmentRequest(object): def __init__(self, segment=None, - additional_properties={}): + additional_properties=None): """Constructor for the CreateSegmentRequest class""" # Initialize members of the class self.segment = segment # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -51,15 +55,13 @@ def from_dictionary(cls, """ - if dictionary is None: + 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 # Clean out expected properties from dictionary - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, - dictionary) + additional_properties) diff --git a/advancedbilling/models/create_signup_proforma_preview_include.py b/advancedbilling/models/create_signup_proforma_preview_include.py index 2e9fc047..08de6722 100644 --- a/advancedbilling/models/create_signup_proforma_preview_include.py +++ b/advancedbilling/models/create_signup_proforma_preview_include.py @@ -16,6 +16,8 @@ class CreateSignupProformaPreviewInclude(object): Attributes: NEXT_PROFORMA_INVOICE: TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ NEXT_PROFORMA_INVOICE = 'next_proforma_invoice' diff --git a/advancedbilling/models/create_subscription.py b/advancedbilling/models/create_subscription.py index 509566e3..b41cfcff 100644 --- a/advancedbilling/models/create_subscription.py +++ b/advancedbilling/models/create_subscription.py @@ -203,6 +203,8 @@ class CreateSubscription(object): 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. """ @@ -312,7 +314,6 @@ class CreateSubscription(object): ] _nullables = [ - 'dunning_communication_delay_enabled', 'dunning_communication_delay_time_zone', ] @@ -366,7 +367,7 @@ def __init__(self, dunning_communication_delay_enabled=False, dunning_communication_delay_time_zone=APIHelper.SKIP, skip_billing_manifest_taxes=False, - additional_properties={}): + additional_properties=None): """Constructor for the CreateSubscription class""" # Initialize members of the class @@ -468,6 +469,8 @@ def __init__(self, self.skip_billing_manifest_taxes = skip_billing_manifest_taxes # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -486,7 +489,7 @@ def from_dictionary(cls, """ from advancedbilling.utilities.union_type_lookup import UnionTypeLookUp - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -544,9 +547,7 @@ def from_dictionary(cls, 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 - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, @@ -597,4 +598,4 @@ def from_dictionary(cls, dunning_communication_delay_enabled, dunning_communication_delay_time_zone, skip_billing_manifest_taxes, - dictionary) + additional_properties) diff --git a/advancedbilling/models/create_subscription_component.py b/advancedbilling/models/create_subscription_component.py index 7035d560..00d3b949 100644 --- a/advancedbilling/models/create_subscription_component.py +++ b/advancedbilling/models/create_subscription_component.py @@ -26,6 +26,8 @@ class CreateSubscriptionComponent(object): price_point_id (int | str | None): TODO: type description here. 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. """ @@ -58,7 +60,7 @@ def __init__(self, quantity=APIHelper.SKIP, price_point_id=APIHelper.SKIP, custom_price=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the CreateSubscriptionComponent class""" # Initialize members of the class @@ -78,6 +80,8 @@ def __init__(self, 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 @@ -96,7 +100,7 @@ def from_dictionary(cls, """ from advancedbilling.utilities.union_type_lookup import UnionTypeLookUp - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -108,9 +112,7 @@ def from_dictionary(cls, 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 - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, @@ -119,7 +121,7 @@ def from_dictionary(cls, quantity, price_point_id, custom_price, - dictionary) + additional_properties) @classmethod def validate(cls, dictionary): diff --git a/advancedbilling/models/create_subscription_group.py b/advancedbilling/models/create_subscription_group.py index 45af2975..861a8aa8 100644 --- a/advancedbilling/models/create_subscription_group.py +++ b/advancedbilling/models/create_subscription_group.py @@ -18,6 +18,8 @@ class CreateSubscriptionGroup(object): Attributes: subscription_id (int): TODO: type description here. member_ids (List[int]): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -34,7 +36,7 @@ class CreateSubscriptionGroup(object): def __init__(self, subscription_id=None, member_ids=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the CreateSubscriptionGroup class""" # Initialize members of the class @@ -43,6 +45,8 @@ def __init__(self, self.member_ids = member_ids # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -60,17 +64,15 @@ def from_dictionary(cls, """ - if dictionary is None: + 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 # Clean out expected properties from dictionary - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, - dictionary) + additional_properties) diff --git a/advancedbilling/models/create_subscription_group_request.py b/advancedbilling/models/create_subscription_group_request.py index 36d81371..a1941516 100644 --- a/advancedbilling/models/create_subscription_group_request.py +++ b/advancedbilling/models/create_subscription_group_request.py @@ -18,6 +18,8 @@ class CreateSubscriptionGroupRequest(object): Attributes: subscription_group (CreateSubscriptionGroup): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -28,13 +30,15 @@ class CreateSubscriptionGroupRequest(object): def __init__(self, subscription_group=None, - additional_properties={}): + additional_properties=None): """Constructor for the CreateSubscriptionGroupRequest class""" # Initialize members of the class self.subscription_group = subscription_group # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -52,15 +56,13 @@ def from_dictionary(cls, """ - if dictionary is None: + 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 # Clean out expected properties from dictionary - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, - dictionary) + additional_properties) diff --git a/advancedbilling/models/create_subscription_request.py b/advancedbilling/models/create_subscription_request.py index 282576cb..e1838595 100644 --- a/advancedbilling/models/create_subscription_request.py +++ b/advancedbilling/models/create_subscription_request.py @@ -17,6 +17,8 @@ class CreateSubscriptionRequest(object): Attributes: subscription (CreateSubscription): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -27,13 +29,15 @@ class CreateSubscriptionRequest(object): def __init__(self, subscription=None, - additional_properties={}): + additional_properties=None): """Constructor for the CreateSubscriptionRequest class""" # Initialize members of the class self.subscription = subscription # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -51,15 +55,13 @@ def from_dictionary(cls, """ - if dictionary is None: + 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 # Clean out expected properties from dictionary - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, - dictionary) + additional_properties) diff --git a/advancedbilling/models/create_usage.py b/advancedbilling/models/create_usage.py index 71b40f23..0692f20d 100644 --- a/advancedbilling/models/create_usage.py +++ b/advancedbilling/models/create_usage.py @@ -25,6 +25,8 @@ class CreateUsage(object): useful when you need to align billing events for different components on distinct schedules within a subscription. Please note this only works for site with Multifrequency enabled + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -48,7 +50,7 @@ def __init__(self, price_point_id=APIHelper.SKIP, memo=APIHelper.SKIP, billing_schedule=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the CreateUsage class""" # Initialize members of the class @@ -62,6 +64,8 @@ def __init__(self, self.billing_schedule = billing_schedule # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -79,7 +83,7 @@ def from_dictionary(cls, """ - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -88,12 +92,10 @@ def from_dictionary(cls, 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 # Clean out expected properties from dictionary - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, memo, billing_schedule, - dictionary) + additional_properties) diff --git a/advancedbilling/models/create_usage_request.py b/advancedbilling/models/create_usage_request.py index a7460279..e6f7f3e7 100644 --- a/advancedbilling/models/create_usage_request.py +++ b/advancedbilling/models/create_usage_request.py @@ -17,6 +17,8 @@ class CreateUsageRequest(object): Attributes: usage (CreateUsage): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -27,13 +29,15 @@ class CreateUsageRequest(object): def __init__(self, usage=None, - additional_properties={}): + additional_properties=None): """Constructor for the CreateUsageRequest class""" # Initialize members of the class self.usage = usage # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -51,15 +55,13 @@ def from_dictionary(cls, """ - if dictionary is None: + 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 # Clean out expected properties from dictionary - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, - dictionary) + additional_properties) diff --git a/advancedbilling/models/created_prepayment.py b/advancedbilling/models/created_prepayment.py index d959284b..d2e61287 100644 --- a/advancedbilling/models/created_prepayment.py +++ b/advancedbilling/models/created_prepayment.py @@ -23,6 +23,8 @@ class CreatedPrepayment(object): created_at (datetime): TODO: type description here. starting_balance_in_cents (long|int): TODO: type description here. ending_balance_in_cents (long|int): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -55,7 +57,7 @@ def __init__(self, created_at=APIHelper.SKIP, starting_balance_in_cents=APIHelper.SKIP, ending_balance_in_cents=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the CreatedPrepayment class""" # Initialize members of the class @@ -75,6 +77,8 @@ def __init__(self, self.ending_balance_in_cents = ending_balance_in_cents # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -92,7 +96,7 @@ def from_dictionary(cls, """ - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -104,9 +108,7 @@ def from_dictionary(cls, 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 - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, @@ -115,4 +117,4 @@ def from_dictionary(cls, created_at, starting_balance_in_cents, ending_balance_in_cents, - dictionary) + additional_properties) diff --git a/advancedbilling/models/credit_account_balance_changed.py b/advancedbilling/models/credit_account_balance_changed.py index 8282a377..827e7ae7 100644 --- a/advancedbilling/models/credit_account_balance_changed.py +++ b/advancedbilling/models/credit_account_balance_changed.py @@ -23,6 +23,8 @@ class CreditAccountBalanceChanged(object): description here. currency_code (str): TODO: type description here. at_time (datetime): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -41,7 +43,7 @@ def __init__(self, service_credit_balance_change_in_cents=None, currency_code=None, at_time=None, - additional_properties={}): + additional_properties=None): """Constructor for the CreditAccountBalanceChanged class""" # Initialize members of the class @@ -52,6 +54,8 @@ def __init__(self, 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: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -69,7 +73,7 @@ def from_dictionary(cls, """ - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -79,16 +83,14 @@ def from_dictionary(cls, 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 - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, service_credit_balance_change_in_cents, currency_code, at_time, - dictionary) + additional_properties) @classmethod def validate(cls, dictionary): diff --git a/advancedbilling/models/credit_card_attributes.py b/advancedbilling/models/credit_card_attributes.py index dfb7556c..36ed3482 100644 --- a/advancedbilling/models/credit_card_attributes.py +++ b/advancedbilling/models/credit_card_attributes.py @@ -19,6 +19,8 @@ class CreditCardAttributes(object): full_number (str): TODO: type description here. expiration_month (str): TODO: type description here. expiration_year (str): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -39,7 +41,7 @@ def __init__(self, full_number=APIHelper.SKIP, expiration_month=APIHelper.SKIP, expiration_year=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the CreditCardAttributes class""" # Initialize members of the class @@ -51,6 +53,8 @@ def __init__(self, self.expiration_year = expiration_year # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -68,7 +72,7 @@ def from_dictionary(cls, """ - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -76,14 +80,12 @@ def from_dictionary(cls, 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 - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, expiration_year, - dictionary) + additional_properties) @classmethod def validate(cls, dictionary): diff --git a/advancedbilling/models/credit_card_payment_profile.py b/advancedbilling/models/credit_card_payment_profile.py index f9fc5129..84f134f5 100644 --- a/advancedbilling/models/credit_card_payment_profile.py +++ b/advancedbilling/models/credit_card_payment_profile.py @@ -56,6 +56,8 @@ class CreditCardPaymentProfile(object): tok_9g6hw85pnpt6knmskpwp4ttt) site_gateway_setting_id (int): TODO: type description here. gateway_handle (str): An identifier of connected gateway. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -145,7 +147,7 @@ def __init__(self, chargify_token=APIHelper.SKIP, site_gateway_setting_id=APIHelper.SKIP, gateway_handle=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the CreditCardPaymentProfile class""" # Initialize members of the class @@ -194,6 +196,8 @@ def __init__(self, self.gateway_handle = gateway_handle # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -211,7 +215,7 @@ def from_dictionary(cls, """ - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -238,9 +242,7 @@ def from_dictionary(cls, 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 # Clean out expected properties from dictionary - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, @@ -264,7 +266,7 @@ def from_dictionary(cls, chargify_token, site_gateway_setting_id, gateway_handle, - dictionary) + additional_properties) @classmethod def validate(cls, dictionary): diff --git a/advancedbilling/models/credit_card_vault.py b/advancedbilling/models/credit_card_vault.py index fdc98090..38971d98 100644 --- a/advancedbilling/models/credit_card_vault.py +++ b/advancedbilling/models/credit_card_vault.py @@ -49,6 +49,8 @@ class CreditCardVault(object): TRUST_COMMERCE: TODO: type description here. UNIPAAS: TODO: type description here. WIRECARD: TODO: type description here. + 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'] diff --git a/advancedbilling/models/credit_note.py b/advancedbilling/models/credit_note.py index a5ce84cc..2be6a500 100644 --- a/advancedbilling/models/credit_note.py +++ b/advancedbilling/models/credit_note.py @@ -95,6 +95,8 @@ class CreditNote(object): 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. """ @@ -187,7 +189,7 @@ def __init__(self, applications=APIHelper.SKIP, refunds=APIHelper.SKIP, origin_invoices=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the CreditNote class""" # Initialize members of the class @@ -247,6 +249,8 @@ def __init__(self, self.origin_invoices = origin_invoices # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -264,7 +268,7 @@ def from_dictionary(cls, """ - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -320,9 +324,7 @@ def from_dictionary(cls, else: origin_invoices = APIHelper.SKIP # Clean out expected properties from dictionary - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, @@ -351,7 +353,7 @@ def from_dictionary(cls, applications, refunds, origin_invoices, - dictionary) + additional_properties) @classmethod def validate(cls, dictionary): diff --git a/advancedbilling/models/credit_note_application.py b/advancedbilling/models/credit_note_application.py index 4e81d3c0..2b8baf53 100644 --- a/advancedbilling/models/credit_note_application.py +++ b/advancedbilling/models/credit_note_application.py @@ -21,6 +21,8 @@ class CreditNoteApplication(object): invoice_uid (str): TODO: type description here. memo (str): TODO: type description here. applied_amount (str): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -47,7 +49,7 @@ def __init__(self, invoice_uid=APIHelper.SKIP, memo=APIHelper.SKIP, applied_amount=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the CreditNoteApplication class""" # Initialize members of the class @@ -63,6 +65,8 @@ def __init__(self, self.applied_amount = applied_amount # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -80,7 +84,7 @@ def from_dictionary(cls, """ - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -90,16 +94,14 @@ def from_dictionary(cls, 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 - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, invoice_uid, memo, applied_amount, - dictionary) + additional_properties) @classmethod def validate(cls, dictionary): diff --git a/advancedbilling/models/credit_note_line_item.py b/advancedbilling/models/credit_note_line_item.py index 361fc203..49387519 100644 --- a/advancedbilling/models/credit_note_line_item.py +++ b/advancedbilling/models/credit_note_line_item.py @@ -75,6 +75,8 @@ class CreditNoteLineItem(object): credited. Will be `nil` for non-component credits. billing_schedule_item_id (int): TODO: type description here. custom_item (bool): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -146,7 +148,7 @@ def __init__(self, price_point_id=APIHelper.SKIP, billing_schedule_item_id=APIHelper.SKIP, custom_item=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the CreditNoteLineItem class""" # Initialize members of the class @@ -188,6 +190,8 @@ def __init__(self, self.custom_item = custom_item # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -205,7 +209,7 @@ def from_dictionary(cls, """ - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -228,9 +232,7 @@ def from_dictionary(cls, 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 - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, @@ -250,7 +252,7 @@ def from_dictionary(cls, price_point_id, billing_schedule_item_id, custom_item, - dictionary) + additional_properties) @classmethod def validate(cls, dictionary): diff --git a/advancedbilling/models/credit_note_status.py b/advancedbilling/models/credit_note_status.py index 96cd7b61..b368492f 100644 --- a/advancedbilling/models/credit_note_status.py +++ b/advancedbilling/models/credit_note_status.py @@ -17,6 +17,8 @@ class CreditNoteStatus(object): Attributes: OPEN: TODO: type description here. APPLIED: TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ _all_values = ['open', 'applied'] diff --git a/advancedbilling/models/credit_scheme.py b/advancedbilling/models/credit_scheme.py index bd56a165..dc54a176 100644 --- a/advancedbilling/models/credit_scheme.py +++ b/advancedbilling/models/credit_scheme.py @@ -18,6 +18,8 @@ class CreditScheme(object): NONE: TODO: type description here. CREDIT: TODO: type description here. REFUND: TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ NONE = 'none' diff --git a/advancedbilling/models/credit_scheme_request.py b/advancedbilling/models/credit_scheme_request.py index 4f4de33e..e5318e44 100644 --- a/advancedbilling/models/credit_scheme_request.py +++ b/advancedbilling/models/credit_scheme_request.py @@ -16,6 +16,8 @@ class CreditSchemeRequest(object): Attributes: credit_scheme (CreditScheme): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -26,13 +28,15 @@ class CreditSchemeRequest(object): def __init__(self, credit_scheme=None, - additional_properties={}): + additional_properties=None): """Constructor for the CreditSchemeRequest class""" # Initialize members of the class self.credit_scheme = credit_scheme # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -50,15 +54,13 @@ def from_dictionary(cls, """ - if dictionary is None: + 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 # Clean out expected properties from dictionary - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, - dictionary) + additional_properties) diff --git a/advancedbilling/models/credit_type.py b/advancedbilling/models/credit_type.py index a8829964..33785497 100644 --- a/advancedbilling/models/credit_type.py +++ b/advancedbilling/models/credit_type.py @@ -20,6 +20,8 @@ class CreditType(object): FULL: TODO: type description here. PRORATED: TODO: type description here. NONE: TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ _all_values = ['full', 'prorated', 'none'] diff --git a/advancedbilling/models/currency_price.py b/advancedbilling/models/currency_price.py index cdf1bd07..a7f3315d 100644 --- a/advancedbilling/models/currency_price.py +++ b/advancedbilling/models/currency_price.py @@ -20,8 +20,12 @@ class CurrencyPrice(object): currency (str): TODO: type description here. price (float): TODO: type description here. formatted_price (str): TODO: type description here. + price_id (int): TODO: type description here. + price_point_id (int): TODO: type description here. product_price_point_id (int): TODO: type description here. role (CurrencyPriceRole): Role for the price. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -31,6 +35,8 @@ class CurrencyPrice(object): "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' } @@ -40,6 +46,8 @@ class CurrencyPrice(object): 'currency', 'price', 'formatted_price', + 'price_id', + 'price_point_id', 'product_price_point_id', 'role', ] @@ -49,9 +57,11 @@ def __init__(self, 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={}): + additional_properties=None): """Constructor for the CurrencyPrice class""" # Initialize members of the class @@ -63,12 +73,18 @@ def __init__(self, self.price = price if formatted_price is not APIHelper.SKIP: self.formatted_price = formatted_price + if price_id is not APIHelper.SKIP: + self.price_id = price_id + if price_point_id is not APIHelper.SKIP: + 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 if role is not APIHelper.SKIP: self.role = role # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -86,7 +102,7 @@ def from_dictionary(cls, """ - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -94,17 +110,19 @@ def from_dictionary(cls, 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 - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, price, formatted_price, + price_id, + price_point_id, product_price_point_id, role, - dictionary) + additional_properties) diff --git a/advancedbilling/models/currency_price_role.py b/advancedbilling/models/currency_price_role.py index c3585afd..863f821b 100644 --- a/advancedbilling/models/currency_price_role.py +++ b/advancedbilling/models/currency_price_role.py @@ -18,6 +18,8 @@ class CurrencyPriceRole(object): BASELINE: TODO: type description here. TRIAL: TODO: type description here. INITIAL: TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ BASELINE = 'baseline' diff --git a/advancedbilling/models/currency_prices_response.py b/advancedbilling/models/currency_prices_response.py index 1ab42a94..79af81be 100644 --- a/advancedbilling/models/currency_prices_response.py +++ b/advancedbilling/models/currency_prices_response.py @@ -17,6 +17,8 @@ class CurrencyPricesResponse(object): Attributes: currency_prices (List[CurrencyPrice]): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -27,13 +29,15 @@ class CurrencyPricesResponse(object): def __init__(self, currency_prices=None, - additional_properties={}): + additional_properties=None): """Constructor for the CurrencyPricesResponse class""" # Initialize members of the class self.currency_prices = currency_prices # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -51,7 +55,7 @@ def from_dictionary(cls, """ - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -59,9 +63,7 @@ def from_dictionary(cls, 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 - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, - dictionary) + additional_properties) diff --git a/advancedbilling/models/custom_field_owner.py b/advancedbilling/models/custom_field_owner.py index a6927c2a..99f51512 100644 --- a/advancedbilling/models/custom_field_owner.py +++ b/advancedbilling/models/custom_field_owner.py @@ -17,6 +17,8 @@ class CustomFieldOwner(object): Attributes: CUSTOMER: TODO: type description here. SUBSCRIPTION: TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ _all_values = ['Customer', 'Subscription'] diff --git a/advancedbilling/models/custom_field_value_change.py b/advancedbilling/models/custom_field_value_change.py index 45a2602c..1aa849c8 100644 --- a/advancedbilling/models/custom_field_value_change.py +++ b/advancedbilling/models/custom_field_value_change.py @@ -23,6 +23,8 @@ class CustomFieldValueChange(object): new_value (str): TODO: type description here. resource_type (str): TODO: type description here. resource_id (int): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -50,7 +52,7 @@ def __init__(self, new_value=None, resource_type=None, resource_id=None, - additional_properties={}): + additional_properties=None): """Constructor for the CustomFieldValueChange class""" # Initialize members of the class @@ -63,6 +65,8 @@ def __init__(self, self.resource_id = resource_id # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -80,7 +84,7 @@ def from_dictionary(cls, """ - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -92,9 +96,7 @@ def from_dictionary(cls, 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 - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, @@ -103,7 +105,7 @@ def from_dictionary(cls, new_value, resource_type, resource_id, - dictionary) + additional_properties) @classmethod def validate(cls, dictionary): diff --git a/advancedbilling/models/customer.py b/advancedbilling/models/customer.py index a60ebeca..62b031c3 100644 --- a/advancedbilling/models/customer.py +++ b/advancedbilling/models/customer.py @@ -67,6 +67,8 @@ class Customer(object): 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. """ @@ -194,7 +196,7 @@ def __init__(self, salesforce_id=APIHelper.SKIP, tax_exempt_reason=APIHelper.SKIP, default_auto_renewal_profile_id=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the Customer class""" # Initialize members of the class @@ -260,6 +262,8 @@ def __init__(self, self.default_auto_renewal_profile_id = default_auto_renewal_profile_id # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -277,7 +281,7 @@ def from_dictionary(cls, """ - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -321,9 +325,7 @@ def from_dictionary(cls, 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 - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, @@ -355,7 +357,7 @@ def from_dictionary(cls, salesforce_id, tax_exempt_reason, default_auto_renewal_profile_id, - dictionary) + additional_properties) @classmethod def validate(cls, dictionary): diff --git a/advancedbilling/models/customer_attributes.py b/advancedbilling/models/customer_attributes.py index cb65dd98..2e6ab43c 100644 --- a/advancedbilling/models/customer_attributes.py +++ b/advancedbilling/models/customer_attributes.py @@ -64,6 +64,8 @@ class CustomerAttributes(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. """ @@ -142,7 +144,7 @@ def __init__(self, parent_id=APIHelper.SKIP, salesforce_id=APIHelper.SKIP, default_auto_renewal_profile_id=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the CustomerAttributes class""" # Initialize members of the class @@ -188,6 +190,8 @@ def __init__(self, self.default_auto_renewal_profile_id = default_auto_renewal_profile_id # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -205,7 +209,7 @@ def from_dictionary(cls, """ - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -230,9 +234,7 @@ def from_dictionary(cls, 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 - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, @@ -254,7 +256,7 @@ def from_dictionary(cls, parent_id, salesforce_id, default_auto_renewal_profile_id, - dictionary) + additional_properties) @classmethod def validate(cls, dictionary): diff --git a/advancedbilling/models/customer_change.py b/advancedbilling/models/customer_change.py index 45481824..c5e8655a 100644 --- a/advancedbilling/models/customer_change.py +++ b/advancedbilling/models/customer_change.py @@ -24,6 +24,8 @@ class CustomerChange(object): billing_address (AddressChange): TODO: type description here. custom_fields (CustomerCustomFieldsChange): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -54,7 +56,7 @@ def __init__(self, shipping_address=APIHelper.SKIP, billing_address=APIHelper.SKIP, custom_fields=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the CustomerChange class""" # Initialize members of the class @@ -68,6 +70,8 @@ def __init__(self, self.custom_fields = custom_fields # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -85,7 +89,7 @@ def from_dictionary(cls, """ - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -106,12 +110,10 @@ def from_dictionary(cls, else: custom_fields = APIHelper.SKIP # Clean out expected properties from dictionary - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, billing_address, custom_fields, - dictionary) + additional_properties) diff --git a/advancedbilling/models/customer_changes_preview_response.py b/advancedbilling/models/customer_changes_preview_response.py index 82d55712..1746b798 100644 --- a/advancedbilling/models/customer_changes_preview_response.py +++ b/advancedbilling/models/customer_changes_preview_response.py @@ -17,6 +17,8 @@ class CustomerChangesPreviewResponse(object): Attributes: changes (CustomerChange): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -27,13 +29,15 @@ class CustomerChangesPreviewResponse(object): def __init__(self, changes=None, - additional_properties={}): + additional_properties=None): """Constructor for the CustomerChangesPreviewResponse class""" # Initialize members of the class self.changes = changes # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -51,15 +55,13 @@ def from_dictionary(cls, """ - if dictionary is None: + 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 # Clean out expected properties from dictionary - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, - dictionary) + additional_properties) diff --git a/advancedbilling/models/customer_custom_fields_change.py b/advancedbilling/models/customer_custom_fields_change.py index 9b4865bc..307459b4 100644 --- a/advancedbilling/models/customer_custom_fields_change.py +++ b/advancedbilling/models/customer_custom_fields_change.py @@ -18,6 +18,8 @@ class CustomerCustomFieldsChange(object): Attributes: before (List[InvoiceCustomField]): TODO: type description here. after (List[InvoiceCustomField]): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -30,7 +32,7 @@ class CustomerCustomFieldsChange(object): def __init__(self, before=None, after=None, - additional_properties={}): + additional_properties=None): """Constructor for the CustomerCustomFieldsChange class""" # Initialize members of the class @@ -38,6 +40,8 @@ def __init__(self, self.after = after # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -55,7 +59,7 @@ def from_dictionary(cls, """ - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -66,10 +70,8 @@ def from_dictionary(cls, if dictionary.get('after') is not None: after = [InvoiceCustomField.from_dictionary(x) for x in dictionary.get('after')] # Clean out expected properties from dictionary - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, - dictionary) + additional_properties) diff --git a/advancedbilling/models/customer_error.py b/advancedbilling/models/customer_error.py index 258d6681..4374e0ab 100644 --- a/advancedbilling/models/customer_error.py +++ b/advancedbilling/models/customer_error.py @@ -17,6 +17,8 @@ class CustomerError(object): Attributes: customer (str): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -31,7 +33,7 @@ class CustomerError(object): def __init__(self, customer=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the CustomerError class""" # Initialize members of the class @@ -39,6 +41,8 @@ def __init__(self, self.customer = customer # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -56,18 +60,16 @@ def from_dictionary(cls, """ - if dictionary is None: + 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 # Clean out expected properties from dictionary - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, - dictionary) + additional_properties) @classmethod def validate(cls, dictionary): diff --git a/advancedbilling/models/customer_payer_change.py b/advancedbilling/models/customer_payer_change.py index 375f6ff0..073b83ea 100644 --- a/advancedbilling/models/customer_payer_change.py +++ b/advancedbilling/models/customer_payer_change.py @@ -18,6 +18,8 @@ class CustomerPayerChange(object): Attributes: before (InvoicePayerChange): TODO: type description here. after (InvoicePayerChange): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -30,7 +32,7 @@ class CustomerPayerChange(object): def __init__(self, before=None, after=None, - additional_properties={}): + additional_properties=None): """Constructor for the CustomerPayerChange class""" # Initialize members of the class @@ -38,6 +40,8 @@ def __init__(self, self.after = after # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -55,17 +59,15 @@ def from_dictionary(cls, """ - if dictionary is None: + 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 # Clean out expected properties from dictionary - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, - dictionary) + additional_properties) diff --git a/advancedbilling/models/customer_response.py b/advancedbilling/models/customer_response.py index 2e239f6a..3a9bdd0f 100644 --- a/advancedbilling/models/customer_response.py +++ b/advancedbilling/models/customer_response.py @@ -17,6 +17,8 @@ class CustomerResponse(object): Attributes: customer (Customer): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -27,13 +29,15 @@ class CustomerResponse(object): def __init__(self, customer=None, - additional_properties={}): + additional_properties=None): """Constructor for the CustomerResponse class""" # Initialize members of the class self.customer = customer # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -51,15 +55,13 @@ def from_dictionary(cls, """ - if dictionary is None: + 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 # Clean out expected properties from dictionary - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, - dictionary) + additional_properties) diff --git a/advancedbilling/models/debit_note.py b/advancedbilling/models/debit_note.py index 33d04475..c18d084a 100644 --- a/advancedbilling/models/debit_note.py +++ b/advancedbilling/models/debit_note.py @@ -71,6 +71,8 @@ class DebitNote(object): discounts (List[InvoiceDiscount]): TODO: type description here. taxes (List[InvoiceTax]): TODO: type description here. refunds (List[InvoiceRefund]): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -151,7 +153,7 @@ def __init__(self, discounts=APIHelper.SKIP, taxes=APIHelper.SKIP, refunds=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the DebitNote class""" # Initialize members of the class @@ -203,6 +205,8 @@ def __init__(self, self.refunds = refunds # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -220,7 +224,7 @@ def from_dictionary(cls, """ - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -264,9 +268,7 @@ def from_dictionary(cls, else: refunds = APIHelper.SKIP # Clean out expected properties from dictionary - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, @@ -291,7 +293,7 @@ def from_dictionary(cls, discounts, taxes, refunds, - dictionary) + additional_properties) @classmethod def validate(cls, dictionary): diff --git a/advancedbilling/models/debit_note_role.py b/advancedbilling/models/debit_note_role.py index e0366bc1..45c85e22 100644 --- a/advancedbilling/models/debit_note_role.py +++ b/advancedbilling/models/debit_note_role.py @@ -17,6 +17,8 @@ class DebitNoteRole(object): Attributes: CHARGEBACK: TODO: type description here. REFUND: TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ _all_values = ['chargeback', 'refund'] diff --git a/advancedbilling/models/debit_note_status.py b/advancedbilling/models/debit_note_status.py index 532b5cf3..ec63cb97 100644 --- a/advancedbilling/models/debit_note_status.py +++ b/advancedbilling/models/debit_note_status.py @@ -19,6 +19,8 @@ class DebitNoteStatus(object): APPLIED: TODO: type description here. BANISHED: TODO: type description here. PAID: TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ _all_values = ['open', 'applied', 'banished', 'paid'] diff --git a/advancedbilling/models/deduct_service_credit.py b/advancedbilling/models/deduct_service_credit.py index 0e6b849a..c644eeb9 100644 --- a/advancedbilling/models/deduct_service_credit.py +++ b/advancedbilling/models/deduct_service_credit.py @@ -18,6 +18,8 @@ class DeductServiceCredit(object): Attributes: amount (str | float): TODO: type description here. memo (str): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -34,7 +36,7 @@ class DeductServiceCredit(object): def __init__(self, amount=None, memo=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the DeductServiceCredit class""" # Initialize members of the class @@ -43,6 +45,8 @@ def __init__(self, self.memo = memo # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -61,20 +65,18 @@ def from_dictionary(cls, """ from advancedbilling.utilities.union_type_lookup import UnionTypeLookUp - if dictionary is None: + 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 # Clean out expected properties from dictionary - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, - dictionary) + additional_properties) @classmethod def validate(cls, dictionary): diff --git a/advancedbilling/models/deduct_service_credit_request.py b/advancedbilling/models/deduct_service_credit_request.py index 81e0fdc8..008a2ec5 100644 --- a/advancedbilling/models/deduct_service_credit_request.py +++ b/advancedbilling/models/deduct_service_credit_request.py @@ -17,6 +17,8 @@ class DeductServiceCreditRequest(object): Attributes: deduction (DeductServiceCredit): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -27,13 +29,15 @@ class DeductServiceCreditRequest(object): def __init__(self, deduction=None, - additional_properties={}): + additional_properties=None): """Constructor for the DeductServiceCreditRequest class""" # Initialize members of the class self.deduction = deduction # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -51,15 +55,13 @@ def from_dictionary(cls, """ - if dictionary is None: + 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 # Clean out expected properties from dictionary - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, - dictionary) + additional_properties) diff --git a/advancedbilling/models/delayed_cancellation_response.py b/advancedbilling/models/delayed_cancellation_response.py index dec48103..c0d6d6bd 100644 --- a/advancedbilling/models/delayed_cancellation_response.py +++ b/advancedbilling/models/delayed_cancellation_response.py @@ -17,6 +17,8 @@ class DelayedCancellationResponse(object): Attributes: message (str): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -31,7 +33,7 @@ class DelayedCancellationResponse(object): def __init__(self, message=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the DelayedCancellationResponse class""" # Initialize members of the class @@ -39,6 +41,8 @@ def __init__(self, self.message = message # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -56,15 +60,13 @@ def from_dictionary(cls, """ - if dictionary is None: + 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 # Clean out expected properties from dictionary - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, - dictionary) + additional_properties) diff --git a/advancedbilling/models/delete_subscription_group_response.py b/advancedbilling/models/delete_subscription_group_response.py index 7defda26..d49e90cd 100644 --- a/advancedbilling/models/delete_subscription_group_response.py +++ b/advancedbilling/models/delete_subscription_group_response.py @@ -18,6 +18,8 @@ class DeleteSubscriptionGroupResponse(object): Attributes: uid (str): TODO: type description here. deleted (bool): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -35,7 +37,7 @@ class DeleteSubscriptionGroupResponse(object): def __init__(self, uid=APIHelper.SKIP, deleted=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the DeleteSubscriptionGroupResponse class""" # Initialize members of the class @@ -45,6 +47,8 @@ def __init__(self, self.deleted = deleted # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -62,17 +66,15 @@ def from_dictionary(cls, """ - if dictionary is None: + 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 # Clean out expected properties from dictionary - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, - dictionary) + additional_properties) diff --git a/advancedbilling/models/direction.py b/advancedbilling/models/direction.py index 13d93d88..8bd30e4b 100644 --- a/advancedbilling/models/direction.py +++ b/advancedbilling/models/direction.py @@ -17,6 +17,8 @@ class Direction(object): Attributes: ASC: TODO: type description here. DESC: TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ ASC = 'asc' diff --git a/advancedbilling/models/discount_type.py b/advancedbilling/models/discount_type.py index 87e9c08f..1027b75f 100644 --- a/advancedbilling/models/discount_type.py +++ b/advancedbilling/models/discount_type.py @@ -17,6 +17,8 @@ class DiscountType(object): Attributes: AMOUNT: TODO: type description here. PERCENT: TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ AMOUNT = 'amount' diff --git a/advancedbilling/models/dunner_data.py b/advancedbilling/models/dunner_data.py index ea984123..318a9f43 100644 --- a/advancedbilling/models/dunner_data.py +++ b/advancedbilling/models/dunner_data.py @@ -22,6 +22,8 @@ class DunnerData(object): created_at (datetime): TODO: type description here. attempts (int): TODO: type description here. last_attempted_at (datetime): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -42,7 +44,7 @@ def __init__(self, created_at=None, attempts=None, last_attempted_at=None, - additional_properties={}): + additional_properties=None): """Constructor for the DunnerData class""" # Initialize members of the class @@ -54,6 +56,8 @@ def __init__(self, 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: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -71,7 +75,7 @@ def from_dictionary(cls, """ - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -82,9 +86,7 @@ def from_dictionary(cls, 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 - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, @@ -92,7 +94,7 @@ def from_dictionary(cls, created_at, attempts, last_attempted_at, - dictionary) + additional_properties) @classmethod def validate(cls, dictionary): diff --git a/advancedbilling/models/dunning_step_data.py b/advancedbilling/models/dunning_step_data.py index 3ee26503..7000154d 100644 --- a/advancedbilling/models/dunning_step_data.py +++ b/advancedbilling/models/dunning_step_data.py @@ -24,6 +24,8 @@ class DunningStepData(object): send_bcc_email (bool): TODO: type description here. send_sms (bool): TODO: type description here. sms_body (str): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -60,7 +62,7 @@ def __init__(self, email_body=APIHelper.SKIP, email_subject=APIHelper.SKIP, sms_body=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the DunningStepData class""" # Initialize members of the class @@ -77,6 +79,8 @@ def __init__(self, self.sms_body = sms_body # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -94,7 +98,7 @@ def from_dictionary(cls, """ - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -107,9 +111,7 @@ def from_dictionary(cls, 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 - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, @@ -119,7 +121,7 @@ def from_dictionary(cls, email_body, email_subject, sms_body, - dictionary) + additional_properties) @classmethod def validate(cls, dictionary): diff --git a/advancedbilling/models/dunning_step_reached.py b/advancedbilling/models/dunning_step_reached.py index c4c30ec7..38222486 100644 --- a/advancedbilling/models/dunning_step_reached.py +++ b/advancedbilling/models/dunning_step_reached.py @@ -21,6 +21,8 @@ class DunningStepReached(object): dunner (DunnerData): TODO: type description here. current_step (DunningStepData): TODO: type description here. next_step (DunningStepData): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -35,7 +37,7 @@ def __init__(self, dunner=None, current_step=None, next_step=None, - additional_properties={}): + additional_properties=None): """Constructor for the DunningStepReached class""" # Initialize members of the class @@ -44,6 +46,8 @@ def __init__(self, self.next_step = next_step # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -61,7 +65,7 @@ def from_dictionary(cls, """ - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -69,14 +73,12 @@ def from_dictionary(cls, 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 - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, next_step, - dictionary) + additional_properties) @classmethod def validate(cls, dictionary): diff --git a/advancedbilling/models/ebb_component.py b/advancedbilling/models/ebb_component.py index a58ae4cf..016d4d2f 100644 --- a/advancedbilling/models/ebb_component.py +++ b/advancedbilling/models/ebb_component.py @@ -38,17 +38,9 @@ class EBBComponent(object): 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://help.chargify.com/products/product-components.html#g - eneral-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`. - 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`. + 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]): TODO: type description here. unit_price (str | float | None): The amount the customer will be @@ -62,7 +54,6 @@ class EBBComponent(object): 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. - price_in_cents (str): deprecated May 2011 - use unit_price instead 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’ @@ -73,6 +64,8 @@ class EBBComponent(object): 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. """ @@ -86,13 +79,10 @@ class EBBComponent(object): "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', - "price_in_cents": 'price_in_cents', "interval": 'interval', "interval_unit": 'interval_unit' } @@ -102,20 +92,15 @@ class EBBComponent(object): 'handle', 'taxable', 'prices', - 'upgrade_charge', - 'downgrade_credit', 'price_points', 'unit_price', 'tax_code', 'hide_date_range_on_invoice', - 'price_in_cents', 'interval', 'interval_unit', ] _nullables = [ - 'upgrade_charge', - 'downgrade_credit', 'interval_unit', ] @@ -128,16 +113,13 @@ def __init__(self, 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, - price_in_cents=APIHelper.SKIP, interval=APIHelper.SKIP, interval_unit=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the EBBComponent class""" # Initialize members of the class @@ -152,10 +134,6 @@ def __init__(self, self.pricing_scheme = pricing_scheme if prices is not APIHelper.SKIP: self.prices = prices - if upgrade_charge is not APIHelper.SKIP: - self.upgrade_charge = upgrade_charge - if downgrade_credit is not APIHelper.SKIP: - self.downgrade_credit = downgrade_credit if price_points is not APIHelper.SKIP: self.price_points = price_points if unit_price is not APIHelper.SKIP: @@ -164,8 +142,6 @@ def __init__(self, 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 - if price_in_cents is not APIHelper.SKIP: - self.price_in_cents = price_in_cents self.event_based_billing_metric_id = event_based_billing_metric_id if interval is not APIHelper.SKIP: self.interval = interval @@ -173,6 +149,8 @@ def __init__(self, self.interval_unit = interval_unit # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -191,7 +169,7 @@ def from_dictionary(cls, """ from advancedbilling.utilities.union_type_lookup import UnionTypeLookUp - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -207,8 +185,6 @@ def from_dictionary(cls, 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 price_points = None if dictionary.get('price_points') is not None: price_points = [ComponentPricePointItem.from_dictionary(x) for x in dictionary.get('price_points')] @@ -217,13 +193,10 @@ def from_dictionary(cls, 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 - 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 "interval_unit" in dictionary.keys() else APIHelper.SKIP # Clean out expected properties from dictionary - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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,13 +206,10 @@ def from_dictionary(cls, handle, taxable, prices, - upgrade_charge, - downgrade_credit, price_points, unit_price, tax_code, hide_date_range_on_invoice, - price_in_cents, interval, interval_unit, - dictionary) + additional_properties) diff --git a/advancedbilling/models/ebb_event.py b/advancedbilling/models/ebb_event.py index 6eced44f..172ded93 100644 --- a/advancedbilling/models/ebb_event.py +++ b/advancedbilling/models/ebb_event.py @@ -18,6 +18,8 @@ class EBBEvent(object): Attributes: chargify (ChargifyEBB): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -32,7 +34,7 @@ class EBBEvent(object): def __init__(self, chargify=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the EBBEvent class""" # Initialize members of the class @@ -40,6 +42,8 @@ def __init__(self, self.chargify = chargify # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -57,15 +61,13 @@ def from_dictionary(cls, """ - if dictionary is None: + 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 # Clean out expected properties from dictionary - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, - dictionary) + additional_properties) diff --git a/advancedbilling/models/enable_webhooks_request.py b/advancedbilling/models/enable_webhooks_request.py index 4ff34c31..7c5dfce6 100644 --- a/advancedbilling/models/enable_webhooks_request.py +++ b/advancedbilling/models/enable_webhooks_request.py @@ -16,6 +16,8 @@ class EnableWebhooksRequest(object): Attributes: webhooks_enabled (bool): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -26,13 +28,15 @@ class EnableWebhooksRequest(object): def __init__(self, webhooks_enabled=None, - additional_properties={}): + additional_properties=None): """Constructor for the EnableWebhooksRequest class""" # Initialize members of the class self.webhooks_enabled = webhooks_enabled # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -50,15 +54,13 @@ def from_dictionary(cls, """ - if dictionary is None: + 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 # Clean out expected properties from dictionary - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, - dictionary) + additional_properties) diff --git a/advancedbilling/models/enable_webhooks_response.py b/advancedbilling/models/enable_webhooks_response.py index 43dd361f..d1b43e75 100644 --- a/advancedbilling/models/enable_webhooks_response.py +++ b/advancedbilling/models/enable_webhooks_response.py @@ -17,6 +17,8 @@ class EnableWebhooksResponse(object): Attributes: webhooks_enabled (bool): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -31,7 +33,7 @@ class EnableWebhooksResponse(object): def __init__(self, webhooks_enabled=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the EnableWebhooksResponse class""" # Initialize members of the class @@ -39,6 +41,8 @@ def __init__(self, self.webhooks_enabled = webhooks_enabled # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -56,15 +60,13 @@ def from_dictionary(cls, """ - if dictionary is None: + 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 # Clean out expected properties from dictionary - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, - dictionary) + additional_properties) diff --git a/advancedbilling/models/endpoint.py b/advancedbilling/models/endpoint.py index a3fe695a..c2ff2ad9 100644 --- a/advancedbilling/models/endpoint.py +++ b/advancedbilling/models/endpoint.py @@ -21,6 +21,8 @@ class Endpoint(object): site_id (int): TODO: type description here. status (str): TODO: type description here. webhook_subscriptions (List[str]): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -47,7 +49,7 @@ def __init__(self, site_id=APIHelper.SKIP, status=APIHelper.SKIP, webhook_subscriptions=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the Endpoint class""" # Initialize members of the class @@ -63,6 +65,8 @@ def __init__(self, self.webhook_subscriptions = webhook_subscriptions # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -80,7 +84,7 @@ def from_dictionary(cls, """ - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -90,13 +94,11 @@ def from_dictionary(cls, 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 - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, site_id, status, webhook_subscriptions, - dictionary) + additional_properties) diff --git a/advancedbilling/models/endpoint_response.py b/advancedbilling/models/endpoint_response.py index 2869fa43..f0665e7a 100644 --- a/advancedbilling/models/endpoint_response.py +++ b/advancedbilling/models/endpoint_response.py @@ -18,6 +18,8 @@ class EndpointResponse(object): Attributes: endpoint (Endpoint): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -32,7 +34,7 @@ class EndpointResponse(object): def __init__(self, endpoint=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the EndpointResponse class""" # Initialize members of the class @@ -40,6 +42,8 @@ def __init__(self, self.endpoint = endpoint # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -57,15 +61,13 @@ def from_dictionary(cls, """ - if dictionary is None: + 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 # Clean out expected properties from dictionary - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, - dictionary) + additional_properties) diff --git a/advancedbilling/models/errors.py b/advancedbilling/models/errors.py index d44179ef..2afc6947 100644 --- a/advancedbilling/models/errors.py +++ b/advancedbilling/models/errors.py @@ -18,6 +18,8 @@ class Errors(object): Attributes: per_page (List[str]): TODO: type description here. price_point (List[str]): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -35,7 +37,7 @@ class Errors(object): def __init__(self, per_page=APIHelper.SKIP, price_point=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the Errors class""" # Initialize members of the class @@ -45,6 +47,8 @@ def __init__(self, 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 @@ -62,17 +66,15 @@ def from_dictionary(cls, """ - if dictionary is None: + 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 # Clean out expected properties from dictionary - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, - dictionary) + additional_properties) diff --git a/advancedbilling/models/event.py b/advancedbilling/models/event.py index 4fcf6e8d..302dea5d 100644 --- a/advancedbilling/models/event.py +++ b/advancedbilling/models/event.py @@ -7,6 +7,7 @@ https://www.apimatic.io ). """ from advancedbilling.api_helper import APIHelper +from advancedbilling.models.event_key import EventKey class Event(object): @@ -17,7 +18,7 @@ class Event(object): Attributes: id (long|int): TODO: type description here. - key (str): TODO: type description here. + key (EventKey): TODO: type description here. message (str): TODO: type description here. subscription_id (int): TODO: type description here. customer_id (int): TODO: type description here. @@ -27,10 +28,72 @@ class Event(object): ComponentAllocationChange | MeteredUsage | PrepaidUsage | DunningStepReached | InvoiceIssued | PendingCancellationChange | PrepaidSubscriptionBalanceChanged | ProformaInvoiceIssued | - SubscriptionGroupSignupSuccess | SubscriptionGroupSignupFailure | - CreditAccountBalanceChanged | PrepaymentAccountBalanceChanged | - PaymentCollectionMethodChanged | ItemPricePointChanged | - CustomFieldValueChange | None): TODO: type description here. + 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` - + PaymentCollectionMethodChanged * + `subscription_service_credit_account_balance_changed` - + CreditAccountBalanceChanged * `item_price_point_changed` - + ItemPricePointChanged * `custom_field_value_change` - + CustomFieldValueChange * The rest, that is + `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`, + `subscription_bank_account_update`, `refund_failure`, + `upcoming_renewal_notice`, `trial_end_notice`, + `direct_debit_payment_paid_out`, `direct_debit_payment_rejected`, + `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`, + `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` they map to `null` instead. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -59,7 +122,7 @@ def __init__(self, customer_id=None, created_at=None, event_specific_data=None, - additional_properties={}): + additional_properties=None): """Constructor for the Event class""" # Initialize members of the class @@ -72,6 +135,8 @@ def __init__(self, self.event_specific_data = event_specific_data # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -90,7 +155,7 @@ def from_dictionary(cls, """ from advancedbilling.utilities.union_type_lookup import UnionTypeLookUp - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -102,9 +167,7 @@ def from_dictionary(cls, 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 - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, @@ -113,7 +176,7 @@ def from_dictionary(cls, customer_id, created_at, event_specific_data, - dictionary) + additional_properties) @classmethod def validate(cls, dictionary): @@ -134,7 +197,7 @@ def validate(cls, dictionary): 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: isinstance(value, str)) \ + 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, @@ -153,7 +216,7 @@ def validate(cls, dictionary): 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: isinstance(value, str)) \ + 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'), diff --git a/advancedbilling/models/event_based_billing_segment_error.py b/advancedbilling/models/event_based_billing_segment_error.py index 47b86d7c..43425372 100644 --- a/advancedbilling/models/event_based_billing_segment_error.py +++ b/advancedbilling/models/event_based_billing_segment_error.py @@ -20,6 +20,8 @@ class EventBasedBillingSegmentError(object): 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. """ @@ -30,13 +32,15 @@ class EventBasedBillingSegmentError(object): def __init__(self, segments=None, - additional_properties={}): + additional_properties=None): """Constructor for the EventBasedBillingSegmentError class""" # Initialize members of the class self.segments = segments # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -54,15 +58,13 @@ def from_dictionary(cls, """ - if dictionary is None: + 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 # Clean out expected properties from dictionary - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, - dictionary) + additional_properties) diff --git a/advancedbilling/models/event_key.py b/advancedbilling/models/event_key.py new file mode 100644 index 00000000..daff8643 --- /dev/null +++ b/advancedbilling/models/event_key.py @@ -0,0 +1,280 @@ +# -*- coding: utf-8 -*- + +""" +advanced_billing + +This file was automatically generated for Maxio by APIMATIC v3.0 ( + https://www.apimatic.io ). +""" + + +class EventKey(object): + + """Implementation of the 'Event Key' enum. + + TODO: type enum description here. + + Attributes: + PAYMENT_SUCCESS: TODO: type description here. + PAYMENT_FAILURE: TODO: type description here. + SIGNUP_SUCCESS: TODO: type description here. + SIGNUP_FAILURE: TODO: type description here. + DELAYED_SIGNUP_CREATION_SUCCESS: TODO: type description here. + DELAYED_SIGNUP_CREATION_FAILURE: TODO: type description here. + BILLING_DATE_CHANGE: TODO: type description here. + EXPIRATION_DATE_CHANGE: TODO: type description here. + RENEWAL_SUCCESS: TODO: type description here. + RENEWAL_FAILURE: TODO: type description here. + SUBSCRIPTION_STATE_CHANGE: TODO: type description here. + SUBSCRIPTION_PRODUCT_CHANGE: TODO: type description here. + PENDING_CANCELLATION_CHANGE: TODO: type description here. + EXPIRING_CARD: TODO: type description here. + CUSTOMER_UPDATE: TODO: type description here. + CUSTOMER_CREATE: TODO: type description here. + CUSTOMER_DELETE: TODO: type description here. + COMPONENT_ALLOCATION_CHANGE: TODO: type description here. + METERED_USAGE: TODO: type description here. + PREPAID_USAGE: TODO: type description here. + UPGRADE_DOWNGRADE_SUCCESS: TODO: type description here. + UPGRADE_DOWNGRADE_FAILURE: TODO: type description here. + STATEMENT_CLOSED: TODO: type description here. + STATEMENT_SETTLED: TODO: type description here. + SUBSCRIPTION_CARD_UPDATE: TODO: type description here. + SUBSCRIPTION_GROUP_CARD_UPDATE: TODO: type description here. + SUBSCRIPTION_BANK_ACCOUNT_UPDATE: TODO: type description here. + REFUND_SUCCESS: TODO: type description here. + REFUND_FAILURE: TODO: type description here. + UPCOMING_RENEWAL_NOTICE: TODO: type description here. + TRIAL_END_NOTICE: TODO: type description here. + DUNNING_STEP_REACHED: TODO: type description here. + INVOICE_ISSUED: TODO: type description here. + PREPAID_SUBSCRIPTION_BALANCE_CHANGED: TODO: type description here. + SUBSCRIPTION_GROUP_SIGNUP_SUCCESS: TODO: type description here. + SUBSCRIPTION_GROUP_SIGNUP_FAILURE: TODO: type description here. + DIRECT_DEBIT_PAYMENT_PAID_OUT: TODO: type description here. + DIRECT_DEBIT_PAYMENT_REJECTED: TODO: type description here. + DIRECT_DEBIT_PAYMENT_PENDING: TODO: type description here. + PENDING_PAYMENT_CREATED: TODO: type description here. + PENDING_PAYMENT_FAILED: TODO: type description here. + PENDING_PAYMENT_COMPLETED: TODO: type description here. + PROFORMA_INVOICE_ISSUED: TODO: type description here. + SUBSCRIPTION_PREPAYMENT_ACCOUNT_BALANCE_CHANGED: TODO: type + description here. + SUBSCRIPTION_SERVICE_CREDIT_ACCOUNT_BALANCE_CHANGED: TODO: type + description here. + CUSTOM_FIELD_VALUE_CHANGE: TODO: type description here. + ITEM_PRICE_POINT_CHANGED: TODO: type description here. + RENEWAL_SUCCESS_RECREATED: TODO: type description here. + RENEWAL_FAILURE_RECREATED: TODO: type description here. + PAYMENT_SUCCESS_RECREATED: TODO: type description here. + PAYMENT_FAILURE_RECREATED: TODO: type description here. + SUBSCRIPTION_DELETION: TODO: type description here. + SUBSCRIPTION_GROUP_BANK_ACCOUNT_UPDATE: TODO: type description here. + SUBSCRIPTION_PAYPAL_ACCOUNT_UPDATE: TODO: type description here. + SUBSCRIPTION_GROUP_PAYPAL_ACCOUNT_UPDATE: TODO: type description here. + SUBSCRIPTION_CUSTOMER_CHANGE: TODO: type description here. + ACCOUNT_TRANSACTION_CHANGED: TODO: type description here. + GO_CARDLESS_PAYMENT_PAID_OUT: TODO: type description here. + GO_CARDLESS_PAYMENT_REJECTED: TODO: type description here. + GO_CARDLESS_PAYMENT_PENDING: TODO: type description here. + STRIPE_DIRECT_DEBIT_PAYMENT_PAID_OUT: TODO: type description here. + STRIPE_DIRECT_DEBIT_PAYMENT_REJECTED: TODO: type description here. + STRIPE_DIRECT_DEBIT_PAYMENT_PENDING: TODO: type description here. + MAXIO_PAYMENTS_DIRECT_DEBIT_PAYMENT_PAID_OUT: TODO: type description + here. + MAXIO_PAYMENTS_DIRECT_DEBIT_PAYMENT_REJECTED: TODO: type description + here. + MAXIO_PAYMENTS_DIRECT_DEBIT_PAYMENT_PENDING: TODO: type description + here. + INVOICE_IN_COLLECTIONS_CANCELED: TODO: type description here. + SUBSCRIPTION_ADDED_TO_GROUP: TODO: type description here. + SUBSCRIPTION_REMOVED_FROM_GROUP: TODO: type description here. + CHARGEBACK_OPENED: TODO: type description here. + CHARGEBACK_LOST: TODO: type description here. + CHARGEBACK_ACCEPTED: TODO: type description here. + CHARGEBACK_CLOSED: TODO: type description here. + CHARGEBACK_WON: TODO: type description here. + PAYMENT_COLLECTION_METHOD_CHANGED: TODO: type description here. + COMPONENT_BILLING_DATE_CHANGED: TODO: type description here. + SUBSCRIPTION_TERM_RENEWAL_SCHEDULED: TODO: type description here. + SUBSCRIPTION_TERM_RENEWAL_PENDING: TODO: type description here. + SUBSCRIPTION_TERM_RENEWAL_ACTIVATED: TODO: type description here. + SUBSCRIPTION_TERM_RENEWAL_REMOVED: TODO: type description here. + 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' + + SIGNUP_SUCCESS = 'signup_success' + + SIGNUP_FAILURE = 'signup_failure' + + DELAYED_SIGNUP_CREATION_SUCCESS = 'delayed_signup_creation_success' + + DELAYED_SIGNUP_CREATION_FAILURE = 'delayed_signup_creation_failure' + + BILLING_DATE_CHANGE = 'billing_date_change' + + EXPIRATION_DATE_CHANGE = 'expiration_date_change' + + RENEWAL_SUCCESS = 'renewal_success' + + RENEWAL_FAILURE = 'renewal_failure' + + SUBSCRIPTION_STATE_CHANGE = 'subscription_state_change' + + SUBSCRIPTION_PRODUCT_CHANGE = 'subscription_product_change' + + PENDING_CANCELLATION_CHANGE = 'pending_cancellation_change' + + EXPIRING_CARD = 'expiring_card' + + CUSTOMER_UPDATE = 'customer_update' + + CUSTOMER_CREATE = 'customer_create' + + CUSTOMER_DELETE = 'customer_delete' + + COMPONENT_ALLOCATION_CHANGE = 'component_allocation_change' + + METERED_USAGE = 'metered_usage' + + PREPAID_USAGE = 'prepaid_usage' + + UPGRADE_DOWNGRADE_SUCCESS = 'upgrade_downgrade_success' + + UPGRADE_DOWNGRADE_FAILURE = 'upgrade_downgrade_failure' + + STATEMENT_CLOSED = 'statement_closed' + + STATEMENT_SETTLED = 'statement_settled' + + SUBSCRIPTION_CARD_UPDATE = 'subscription_card_update' + + SUBSCRIPTION_GROUP_CARD_UPDATE = 'subscription_group_card_update' + + SUBSCRIPTION_BANK_ACCOUNT_UPDATE = 'subscription_bank_account_update' + + REFUND_SUCCESS = 'refund_success' + + REFUND_FAILURE = 'refund_failure' + + UPCOMING_RENEWAL_NOTICE = 'upcoming_renewal_notice' + + TRIAL_END_NOTICE = 'trial_end_notice' + + DUNNING_STEP_REACHED = 'dunning_step_reached' + + INVOICE_ISSUED = 'invoice_issued' + + PREPAID_SUBSCRIPTION_BALANCE_CHANGED = 'prepaid_subscription_balance_changed' + + SUBSCRIPTION_GROUP_SIGNUP_SUCCESS = 'subscription_group_signup_success' + + SUBSCRIPTION_GROUP_SIGNUP_FAILURE = 'subscription_group_signup_failure' + + DIRECT_DEBIT_PAYMENT_PAID_OUT = 'direct_debit_payment_paid_out' + + DIRECT_DEBIT_PAYMENT_REJECTED = 'direct_debit_payment_rejected' + + DIRECT_DEBIT_PAYMENT_PENDING = 'direct_debit_payment_pending' + + PENDING_PAYMENT_CREATED = 'pending_payment_created' + + PENDING_PAYMENT_FAILED = 'pending_payment_failed' + + PENDING_PAYMENT_COMPLETED = 'pending_payment_completed' + + PROFORMA_INVOICE_ISSUED = 'proforma_invoice_issued' + + SUBSCRIPTION_PREPAYMENT_ACCOUNT_BALANCE_CHANGED = 'subscription_prepayment_account_balance_changed' + + SUBSCRIPTION_SERVICE_CREDIT_ACCOUNT_BALANCE_CHANGED = 'subscription_service_credit_account_balance_changed' + + CUSTOM_FIELD_VALUE_CHANGE = 'custom_field_value_change' + + ITEM_PRICE_POINT_CHANGED = 'item_price_point_changed' + + RENEWAL_SUCCESS_RECREATED = 'renewal_success_recreated' + + RENEWAL_FAILURE_RECREATED = 'renewal_failure_recreated' + + PAYMENT_SUCCESS_RECREATED = 'payment_success_recreated' + + PAYMENT_FAILURE_RECREATED = 'payment_failure_recreated' + + SUBSCRIPTION_DELETION = 'subscription_deletion' + + SUBSCRIPTION_GROUP_BANK_ACCOUNT_UPDATE = 'subscription_group_bank_account_update' + + SUBSCRIPTION_PAYPAL_ACCOUNT_UPDATE = 'subscription_paypal_account_update' + + SUBSCRIPTION_GROUP_PAYPAL_ACCOUNT_UPDATE = 'subscription_group_paypal_account_update' + + SUBSCRIPTION_CUSTOMER_CHANGE = 'subscription_customer_change' + + ACCOUNT_TRANSACTION_CHANGED = 'account_transaction_changed' + + GO_CARDLESS_PAYMENT_PAID_OUT = 'go_cardless_payment_paid_out' + + GO_CARDLESS_PAYMENT_REJECTED = 'go_cardless_payment_rejected' + + GO_CARDLESS_PAYMENT_PENDING = 'go_cardless_payment_pending' + + STRIPE_DIRECT_DEBIT_PAYMENT_PAID_OUT = 'stripe_direct_debit_payment_paid_out' + + STRIPE_DIRECT_DEBIT_PAYMENT_REJECTED = 'stripe_direct_debit_payment_rejected' + + STRIPE_DIRECT_DEBIT_PAYMENT_PENDING = 'stripe_direct_debit_payment_pending' + + MAXIO_PAYMENTS_DIRECT_DEBIT_PAYMENT_PAID_OUT = 'maxio_payments_direct_debit_payment_paid_out' + + MAXIO_PAYMENTS_DIRECT_DEBIT_PAYMENT_REJECTED = 'maxio_payments_direct_debit_payment_rejected' + + MAXIO_PAYMENTS_DIRECT_DEBIT_PAYMENT_PENDING = 'maxio_payments_direct_debit_payment_pending' + + INVOICE_IN_COLLECTIONS_CANCELED = 'invoice_in_collections_canceled' + + SUBSCRIPTION_ADDED_TO_GROUP = 'subscription_added_to_group' + + SUBSCRIPTION_REMOVED_FROM_GROUP = 'subscription_removed_from_group' + + CHARGEBACK_OPENED = 'chargeback_opened' + + CHARGEBACK_LOST = 'chargeback_lost' + + CHARGEBACK_ACCEPTED = 'chargeback_accepted' + + CHARGEBACK_CLOSED = 'chargeback_closed' + + CHARGEBACK_WON = 'chargeback_won' + + PAYMENT_COLLECTION_METHOD_CHANGED = 'payment_collection_method_changed' + + COMPONENT_BILLING_DATE_CHANGED = 'component_billing_date_changed' + + SUBSCRIPTION_TERM_RENEWAL_SCHEDULED = 'subscription_term_renewal_scheduled' + + SUBSCRIPTION_TERM_RENEWAL_PENDING = 'subscription_term_renewal_pending' + + 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 + + Args: + value: the value to be validated + + Returns: + boolean : if value is valid enum values. + + """ + return value in cls._all_values + \ No newline at end of file diff --git a/advancedbilling/models/event_response.py b/advancedbilling/models/event_response.py index e7d81096..7b216503 100644 --- a/advancedbilling/models/event_response.py +++ b/advancedbilling/models/event_response.py @@ -17,6 +17,8 @@ class EventResponse(object): Attributes: event (Event): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -27,13 +29,15 @@ class EventResponse(object): def __init__(self, event=None, - additional_properties={}): + additional_properties=None): """Constructor for the EventResponse class""" # Initialize members of the class self.event = event # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -51,15 +55,13 @@ def from_dictionary(cls, """ - if dictionary is None: + 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 # Clean out expected properties from dictionary - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, - dictionary) + additional_properties) diff --git a/advancedbilling/models/event_type.py b/advancedbilling/models/event_type.py deleted file mode 100644 index f5472978..00000000 --- a/advancedbilling/models/event_type.py +++ /dev/null @@ -1,123 +0,0 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing - -This file was automatically generated for Maxio by APIMATIC v3.0 ( - https://www.apimatic.io ). -""" - - -class EventType(object): - - """Implementation of the 'Event Type' enum. - - TODO: type enum description here. - - Attributes: - ACCOUNT_TRANSACTION_CHANGED: TODO: type description here. - BILLING_DATE_CHANGE: TODO: type description here. - COMPONENT_ALLOCATION_CHANGE: TODO: type description here. - CUSTOMER_UPDATE: TODO: type description here. - CUSTOMER_CREATE: TODO: type description here. - DUNNING_STEP_REACHED: TODO: type description here. - EXPIRATION_DATE_CHANGE: TODO: type description here. - EXPIRING_CARD: TODO: type description here. - METERED_USAGE: TODO: type description here. - PAYMENT_SUCCESS: TODO: type description here. - PAYMENT_SUCCESS_RECREATED: TODO: type description here. - PAYMENT_FAILURE: TODO: type description here. - PAYMENT_FAILURE_RECREATED: TODO: type description here. - REFUND_FAILURE: TODO: type description here. - REFUND_SUCCESS: TODO: type description here. - RENEWAL_SUCCESS: TODO: type description here. - RENEWAL_SUCCESS_RECREATED: TODO: type description here. - RENEWAL_FAILURE: TODO: type description here. - SIGNUP_SUCCESS: TODO: type description here. - SIGNUP_FAILURE: TODO: type description here. - STATEMENT_CLOSED: TODO: type description here. - STATEMENT_SETTLED: TODO: type description here. - SUBSCRIPTION_BANK_ACCOUNT_UPDATE: TODO: type description here. - SUBSCRIPTION_DELETION: TODO: type description here. - SUBSCRIPTION_PAYPAL_ACCOUNT_UPDATE: TODO: type description here. - SUBSCRIPTION_PRODUCT_CHANGE: TODO: type description here. - SUBSCRIPTION_STATE_CHANGE: TODO: type description here. - TRIAL_END_NOTICE: TODO: type description here. - UPGRADE_DOWNGRADE_SUCCESS: TODO: type description here. - UPGRADE_DOWNGRADE_FAILURE: TODO: type description here. - UPCOMING_RENEWAL_NOTICE: TODO: type description here. - CUSTOM_FIELD_VALUE_CHANGE: TODO: type description here. - SUBSCRIPTION_PREPAYMENT_ACCOUNT_BALANCE_CHANGED: TODO: type - description here. - SUBSCRIPTION_SERVICE_CREDIT_ACCOUNT_BALANCE_CHANGED: TODO: type - description here. - - """ - ACCOUNT_TRANSACTION_CHANGED = 'account_transaction_changed' - - BILLING_DATE_CHANGE = 'billing_date_change' - - COMPONENT_ALLOCATION_CHANGE = 'component_allocation_change' - - CUSTOMER_UPDATE = 'customer_update' - - CUSTOMER_CREATE = 'customer_create' - - DUNNING_STEP_REACHED = 'dunning_step_reached' - - EXPIRATION_DATE_CHANGE = 'expiration_date_change' - - EXPIRING_CARD = 'expiring_card' - - METERED_USAGE = 'metered_usage' - - PAYMENT_SUCCESS = 'payment_success' - - PAYMENT_SUCCESS_RECREATED = 'payment_success_recreated' - - PAYMENT_FAILURE = 'payment_failure' - - PAYMENT_FAILURE_RECREATED = 'payment_failure_recreated' - - REFUND_FAILURE = 'refund_failure' - - REFUND_SUCCESS = 'refund_success' - - RENEWAL_SUCCESS = 'renewal_success' - - RENEWAL_SUCCESS_RECREATED = 'renewal_success_recreated' - - RENEWAL_FAILURE = 'renewal_failure' - - SIGNUP_SUCCESS = 'signup_success' - - SIGNUP_FAILURE = 'signup_failure' - - STATEMENT_CLOSED = 'statement_closed' - - STATEMENT_SETTLED = 'statement_settled' - - SUBSCRIPTION_BANK_ACCOUNT_UPDATE = 'subscription_bank_account_update' - - SUBSCRIPTION_DELETION = 'subscription_deletion' - - SUBSCRIPTION_PAYPAL_ACCOUNT_UPDATE = 'subscription_paypal_account_update' - - SUBSCRIPTION_PRODUCT_CHANGE = 'subscription_product_change' - - SUBSCRIPTION_STATE_CHANGE = 'subscription_state_change' - - TRIAL_END_NOTICE = 'trial_end_notice' - - UPGRADE_DOWNGRADE_SUCCESS = 'upgrade_downgrade_success' - - UPGRADE_DOWNGRADE_FAILURE = 'upgrade_downgrade_failure' - - UPCOMING_RENEWAL_NOTICE = 'upcoming_renewal_notice' - - CUSTOM_FIELD_VALUE_CHANGE = 'custom_field_value_change' - - SUBSCRIPTION_PREPAYMENT_ACCOUNT_BALANCE_CHANGED = 'subscription_prepayment_account_balance_changed' - - SUBSCRIPTION_SERVICE_CREDIT_ACCOUNT_BALANCE_CHANGED = 'subscription_service_credit_account_balance_changed' - diff --git a/advancedbilling/models/expiration_interval_unit.py b/advancedbilling/models/expiration_interval_unit.py index 8bcf5ebd..cfd80cec 100644 --- a/advancedbilling/models/expiration_interval_unit.py +++ b/advancedbilling/models/expiration_interval_unit.py @@ -18,6 +18,8 @@ class ExpirationIntervalUnit(object): DAY: TODO: type description here. MONTH: TODO: type description here. NEVER: TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ _all_values = ['day', 'month', 'never'] diff --git a/advancedbilling/models/failed_payment_action.py b/advancedbilling/models/failed_payment_action.py index b0d2e234..0a03e158 100644 --- a/advancedbilling/models/failed_payment_action.py +++ b/advancedbilling/models/failed_payment_action.py @@ -30,6 +30,8 @@ class FailedPaymentAction(object): LEAVE_OPEN_INVOICE: TODO: type description here. ROLLBACK_TO_PENDING: TODO: type description here. INITIATE_DUNNING: TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ LEAVE_OPEN_INVOICE = 'leave_open_invoice' diff --git a/advancedbilling/models/failed_payment_event.py b/advancedbilling/models/failed_payment_event.py index 1f67d857..e6f48841 100644 --- a/advancedbilling/models/failed_payment_event.py +++ b/advancedbilling/models/failed_payment_event.py @@ -25,6 +25,8 @@ class FailedPaymentEvent(object): event_type (InvoiceEventType): TODO: type description here. event_data (FailedPaymentEventData): Example schema for an `failed_payment` event + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -43,7 +45,7 @@ def __init__(self, invoice=None, event_type='failed_payment', event_data=None, - additional_properties={}): + additional_properties=None): """Constructor for the FailedPaymentEvent class""" # Initialize members of the class @@ -54,6 +56,8 @@ def __init__(self, self.event_data = event_data # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -71,7 +75,7 @@ def from_dictionary(cls, """ - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -81,16 +85,14 @@ def from_dictionary(cls, 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 - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, invoice, event_type, event_data, - dictionary) + additional_properties) @classmethod def validate(cls, dictionary): diff --git a/advancedbilling/models/failed_payment_event_data.py b/advancedbilling/models/failed_payment_event_data.py index 03571b8c..3caeeba2 100644 --- a/advancedbilling/models/failed_payment_event_data.py +++ b/advancedbilling/models/failed_payment_event_data.py @@ -24,6 +24,8 @@ class FailedPaymentEventData(object): memo (str): The memo passed when the payment was created. payment_method (InvoicePaymentMethodType): TODO: type description here. transaction_id (int): The transaction ID of the failed payment. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -50,7 +52,7 @@ def __init__(self, payment_method=None, transaction_id=None, memo=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the FailedPaymentEventData class""" # Initialize members of the class @@ -62,6 +64,8 @@ def __init__(self, self.transaction_id = transaction_id # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -79,7 +83,7 @@ def from_dictionary(cls, """ - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -89,16 +93,14 @@ def from_dictionary(cls, 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 - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, payment_method, transaction_id, memo, - dictionary) + additional_properties) @classmethod def validate(cls, dictionary): diff --git a/advancedbilling/models/first_charge_type.py b/advancedbilling/models/first_charge_type.py index 36f93e33..4d2679fc 100644 --- a/advancedbilling/models/first_charge_type.py +++ b/advancedbilling/models/first_charge_type.py @@ -18,6 +18,8 @@ class FirstChargeType(object): PRORATED: TODO: type description here. IMMEDIATE: TODO: type description here. DELAYED: TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ _all_values = ['prorated', 'immediate', 'delayed'] diff --git a/advancedbilling/models/full_subscription_group_response.py b/advancedbilling/models/full_subscription_group_response.py index c6d9a403..68c4c0a4 100644 --- a/advancedbilling/models/full_subscription_group_response.py +++ b/advancedbilling/models/full_subscription_group_response.py @@ -96,6 +96,8 @@ class FullSubscriptionGroupResponse(object): customer (SubscriptionGroupCustomer): TODO: type description here. account_balances (SubscriptionGroupBalances): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -143,7 +145,7 @@ def __init__(self, current_billing_amount_in_cents=APIHelper.SKIP, customer=APIHelper.SKIP, account_balances=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the FullSubscriptionGroupResponse class""" # Initialize members of the class @@ -173,6 +175,8 @@ def __init__(self, self.account_balances = account_balances # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -190,7 +194,7 @@ def from_dictionary(cls, """ - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -207,9 +211,7 @@ def from_dictionary(cls, 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 - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, @@ -223,4 +225,4 @@ def from_dictionary(cls, current_billing_amount_in_cents, customer, account_balances, - dictionary) + additional_properties) diff --git a/advancedbilling/models/get_one_time_token_payment_profile.py b/advancedbilling/models/get_one_time_token_payment_profile.py index 99d7ccbd..04f6479f 100644 --- a/advancedbilling/models/get_one_time_token_payment_profile.py +++ b/advancedbilling/models/get_one_time_token_payment_profile.py @@ -38,6 +38,8 @@ class GetOneTimeTokenPaymentProfile(object): site_gateway_setting_id (int): TODO: type description here. customer_vault_token (str): TODO: type description here. gateway_handle (str): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -103,7 +105,7 @@ def __init__(self, billing_address_2=APIHelper.SKIP, customer_vault_token=APIHelper.SKIP, gateway_handle=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the GetOneTimeTokenPaymentProfile class""" # Initialize members of the class @@ -135,6 +137,8 @@ def __init__(self, self.gateway_handle = gateway_handle # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -152,7 +156,7 @@ def from_dictionary(cls, """ - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -178,9 +182,7 @@ def from_dictionary(cls, 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 - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, @@ -203,4 +205,4 @@ def from_dictionary(cls, billing_address_2, customer_vault_token, gateway_handle, - dictionary) + additional_properties) diff --git a/advancedbilling/models/get_one_time_token_request.py b/advancedbilling/models/get_one_time_token_request.py index fa2d4788..03c1faaf 100644 --- a/advancedbilling/models/get_one_time_token_request.py +++ b/advancedbilling/models/get_one_time_token_request.py @@ -18,6 +18,8 @@ class GetOneTimeTokenRequest(object): Attributes: payment_profile (GetOneTimeTokenPaymentProfile): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -28,13 +30,15 @@ class GetOneTimeTokenRequest(object): def __init__(self, payment_profile=None, - additional_properties={}): + additional_properties=None): """Constructor for the GetOneTimeTokenRequest class""" # Initialize members of the class self.payment_profile = payment_profile # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -52,15 +56,13 @@ def from_dictionary(cls, """ - if dictionary is None: + 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 # Clean out expected properties from dictionary - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, - dictionary) + additional_properties) diff --git a/advancedbilling/models/group_billing.py b/advancedbilling/models/group_billing.py index e538da2d..526ef1c0 100644 --- a/advancedbilling/models/group_billing.py +++ b/advancedbilling/models/group_billing.py @@ -26,6 +26,8 @@ class GroupBilling(object): 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. """ @@ -46,7 +48,7 @@ def __init__(self, accrue=False, align_date=False, prorate=False, - additional_properties={}): + additional_properties=None): """Constructor for the GroupBilling class""" # Initialize members of the class @@ -55,6 +57,8 @@ def __init__(self, self.prorate = prorate # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -72,7 +76,7 @@ def from_dictionary(cls, """ - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -80,14 +84,12 @@ def from_dictionary(cls, 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 - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, prorate, - dictionary) + additional_properties) @classmethod def validate(cls, dictionary): diff --git a/advancedbilling/models/group_settings.py b/advancedbilling/models/group_settings.py index ca4af9c4..523ea1b2 100644 --- a/advancedbilling/models/group_settings.py +++ b/advancedbilling/models/group_settings.py @@ -22,6 +22,8 @@ class GroupSettings(object): 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. """ @@ -38,7 +40,7 @@ class GroupSettings(object): def __init__(self, target=None, billing=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the GroupSettings class""" # Initialize members of the class @@ -47,6 +49,8 @@ def __init__(self, self.billing = billing # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -64,20 +68,18 @@ def from_dictionary(cls, """ - if dictionary is None: + 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 # Clean out expected properties from dictionary - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, - dictionary) + additional_properties) @classmethod def validate(cls, dictionary): diff --git a/advancedbilling/models/group_target.py b/advancedbilling/models/group_target.py index 88830be6..1975093f 100644 --- a/advancedbilling/models/group_target.py +++ b/advancedbilling/models/group_target.py @@ -23,6 +23,8 @@ class GroupTarget(object): 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. """ @@ -39,7 +41,7 @@ class GroupTarget(object): def __init__(self, mtype=None, id=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the GroupTarget class""" # Initialize members of the class @@ -48,6 +50,8 @@ def __init__(self, self.id = id # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -65,20 +69,18 @@ def from_dictionary(cls, """ - if dictionary is None: + 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 # Clean out expected properties from dictionary - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, - dictionary) + additional_properties) @classmethod def validate(cls, dictionary): diff --git a/advancedbilling/models/group_target_type.py b/advancedbilling/models/group_target_type.py index 4bdc6666..85579142 100644 --- a/advancedbilling/models/group_target_type.py +++ b/advancedbilling/models/group_target_type.py @@ -20,6 +20,8 @@ class GroupTargetType(object): SELF: TODO: type description here. PARENT: TODO: type description here. ELDEST: TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ _all_values = ['customer', 'subscription', 'self', 'parent', 'eldest'] diff --git a/advancedbilling/models/group_type.py b/advancedbilling/models/group_type.py index c77ef7d0..47843057 100644 --- a/advancedbilling/models/group_type.py +++ b/advancedbilling/models/group_type.py @@ -17,6 +17,8 @@ class GroupType(object): Attributes: SINGLE_CUSTOMER: TODO: type description here. MULTIPLE_CUSTOMERS: TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ SINGLE_CUSTOMER = 'single_customer' diff --git a/advancedbilling/models/historic_usage.py b/advancedbilling/models/historic_usage.py index 2f320715..5bec64c1 100644 --- a/advancedbilling/models/historic_usage.py +++ b/advancedbilling/models/historic_usage.py @@ -21,6 +21,8 @@ class HistoricUsage(object): 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. """ @@ -41,7 +43,7 @@ def __init__(self, total_usage_quantity=APIHelper.SKIP, billing_period_starts_at=APIHelper.SKIP, billing_period_ends_at=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the HistoricUsage class""" # Initialize members of the class @@ -53,6 +55,8 @@ def __init__(self, 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: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -70,7 +74,7 @@ def from_dictionary(cls, """ - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -78,14 +82,12 @@ def from_dictionary(cls, 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 - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, billing_period_ends_at, - dictionary) + additional_properties) @classmethod def validate(cls, dictionary): diff --git a/advancedbilling/models/include_not_null.py b/advancedbilling/models/include_not_null.py index 918c6008..5b4ee925 100644 --- a/advancedbilling/models/include_not_null.py +++ b/advancedbilling/models/include_not_null.py @@ -16,6 +16,8 @@ class IncludeNotNull(object): Attributes: NOT_NULL: TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ NOT_NULL = 'not_null' diff --git a/advancedbilling/models/include_null_or_not_null.py b/advancedbilling/models/include_null_or_not_null.py index 66c321fb..50c83123 100644 --- a/advancedbilling/models/include_null_or_not_null.py +++ b/advancedbilling/models/include_null_or_not_null.py @@ -17,6 +17,8 @@ class IncludeNullOrNotNull(object): Attributes: NOT_NULL: TODO: type description here. NULL: TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ NOT_NULL = 'not_null' diff --git a/advancedbilling/models/include_option.py b/advancedbilling/models/include_option.py index 368983c3..9b32cce0 100644 --- a/advancedbilling/models/include_option.py +++ b/advancedbilling/models/include_option.py @@ -17,6 +17,8 @@ class IncludeOption(object): Attributes: EXCLUDE: TODO: type description here. INCLUDE: TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ _all_values = ['0', '1'] diff --git a/advancedbilling/models/interval_unit.py b/advancedbilling/models/interval_unit.py index 669624e8..f7b2df02 100644 --- a/advancedbilling/models/interval_unit.py +++ b/advancedbilling/models/interval_unit.py @@ -17,6 +17,8 @@ class IntervalUnit(object): Attributes: DAY: TODO: type description here. MONTH: TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ _all_values = ['day', 'month'] diff --git a/advancedbilling/models/invoice.py b/advancedbilling/models/invoice.py index c13b9b4c..e09bd7a2 100644 --- a/advancedbilling/models/invoice.py +++ b/advancedbilling/models/invoice.py @@ -10,9 +10,11 @@ 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 @@ -119,6 +121,7 @@ class Invoice(object): 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. + debit_amount (str): TODO: type description here. refund_amount (str): TODO: type description here. paid_amount (str): The amount paid on the invoice by the customer. due_amount (str): Amount due on the invoice, which is `total_amount - @@ -127,14 +130,18 @@ class Invoice(object): discounts (List[InvoiceDiscount]): TODO: type description here. taxes (List[InvoiceTax]): TODO: type description here. credits (List[InvoiceCredit]): TODO: type description here. + debits (List[InvoiceDebit]): TODO: type description here. refunds (List[InvoiceRefund]): TODO: type description here. payments (List[InvoicePayment]): TODO: type description here. custom_fields (List[InvoiceCustomField]): TODO: type description here. display_settings (InvoiceDisplaySettings): TODO: type description here. + avatax_details (InvoiceAvataxDetails): TODO: type description here. public_url (str): The public URL of the invoice previous_balance_data (InvoicePreviousBalance): TODO: type description here. public_url_expires_on (date): The format is `"YYYY-MM-DD"`. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -179,6 +186,7 @@ class Invoice(object): "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', @@ -186,10 +194,12 @@ class Invoice(object): "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' @@ -235,6 +245,7 @@ class Invoice(object): 'tax_amount', 'total_amount', 'credit_amount', + 'debit_amount', 'refund_amount', 'paid_amount', 'due_amount', @@ -242,10 +253,12 @@ class Invoice(object): 'discounts', 'taxes', 'credits', + 'debits', 'refunds', 'payments', 'custom_fields', 'display_settings', + 'avatax_details', 'public_url', 'previous_balance_data', 'public_url_expires_on', @@ -300,6 +313,7 @@ def __init__(self, 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, @@ -307,14 +321,16 @@ def __init__(self, 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={}): + additional_properties=None): """Constructor for the Invoice class""" # Initialize members of the class @@ -396,6 +412,8 @@ def __init__(self, self.total_amount = total_amount if credit_amount is not APIHelper.SKIP: self.credit_amount = credit_amount + if debit_amount is not APIHelper.SKIP: + self.debit_amount = debit_amount if refund_amount is not APIHelper.SKIP: self.refund_amount = refund_amount if paid_amount is not APIHelper.SKIP: @@ -410,6 +428,8 @@ def __init__(self, self.taxes = taxes if credits is not APIHelper.SKIP: self.credits = credits + if debits is not APIHelper.SKIP: + self.debits = debits if refunds is not APIHelper.SKIP: self.refunds = refunds if payments is not APIHelper.SKIP: @@ -418,6 +438,8 @@ def __init__(self, self.custom_fields = custom_fields if display_settings is not APIHelper.SKIP: self.display_settings = display_settings + if avatax_details is not APIHelper.SKIP: + self.avatax_details = avatax_details if public_url is not APIHelper.SKIP: self.public_url = public_url if previous_balance_data is not APIHelper.SKIP: @@ -426,6 +448,8 @@ def __init__(self, self.public_url_expires_on = public_url_expires_on # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -443,7 +467,7 @@ def from_dictionary(cls, """ - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -489,6 +513,7 @@ def from_dictionary(cls, 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 @@ -512,6 +537,11 @@ def from_dictionary(cls, 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')] + else: + debits = APIHelper.SKIP refunds = None if dictionary.get('refunds') is not None: refunds = [InvoiceRefund.from_dictionary(x) for x in dictionary.get('refunds')] @@ -528,13 +558,12 @@ def from_dictionary(cls, 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 # Clean out expected properties from dictionary - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, @@ -575,6 +604,7 @@ def from_dictionary(cls, tax_amount, total_amount, credit_amount, + debit_amount, refund_amount, paid_amount, due_amount, @@ -582,14 +612,16 @@ def from_dictionary(cls, discounts, taxes, credits, + debits, refunds, payments, custom_fields, display_settings, + avatax_details, public_url, previous_balance_data, public_url_expires_on, - dictionary) + additional_properties) @classmethod def validate(cls, dictionary): diff --git a/advancedbilling/models/invoice_address.py b/advancedbilling/models/invoice_address.py index ace402bd..265ef531 100644 --- a/advancedbilling/models/invoice_address.py +++ b/advancedbilling/models/invoice_address.py @@ -22,6 +22,8 @@ class InvoiceAddress(object): state (str): TODO: type description here. zip (str): TODO: type description here. country (str): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -60,7 +62,7 @@ def __init__(self, state=APIHelper.SKIP, zip=APIHelper.SKIP, country=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the InvoiceAddress class""" # Initialize members of the class @@ -78,6 +80,8 @@ def __init__(self, self.country = country # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -95,7 +99,7 @@ def from_dictionary(cls, """ - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -106,9 +110,7 @@ def from_dictionary(cls, 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 - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, @@ -116,7 +118,7 @@ def from_dictionary(cls, state, zip, country, - dictionary) + additional_properties) @classmethod def validate(cls, dictionary): diff --git a/advancedbilling/models/invoice_avatax_details.py b/advancedbilling/models/invoice_avatax_details.py new file mode 100644 index 00000000..76a8ed89 --- /dev/null +++ b/advancedbilling/models/invoice_avatax_details.py @@ -0,0 +1,140 @@ +# -*- coding: utf-8 -*- + +""" +advanced_billing + +This file was automatically generated for Maxio by APIMATIC v3.0 ( + https://www.apimatic.io ). +""" +from advancedbilling.api_helper import APIHelper + + +class InvoiceAvataxDetails(object): + + """Implementation of the 'Invoice Avatax Details' model. + + TODO: type model description here. + + Attributes: + id (long|int): TODO: type description here. + status (str): TODO: type description here. + document_code (str): TODO: type description here. + commit_date (datetime): TODO: type description here. + modify_date (datetime): TODO: type description here. + 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' + } + + _optionals = [ + 'id', + 'status', + 'document_code', + 'commit_date', + 'modify_date', + ] + + _nullables = [ + '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""" + + # Initialize members of the class + if id is not APIHelper.SKIP: + self.id = id + if status is not APIHelper.SKIP: + self.status = status + if document_code is not APIHelper.SKIP: + 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 + if modify_date is not APIHelper.SKIP: + 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: + additional_properties = {} + self.additional_properties = additional_properties + + @classmethod + def from_dictionary(cls, + dictionary): + """Creates 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 "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 + 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()} + # Return an object of this model + return cls(id, + status, + document_code, + commit_date, + modify_date, + additional_properties) + + @classmethod + def validate(cls, dictionary): + """Validates 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 True + + if not isinstance(dictionary, dict): + return False + + return True diff --git a/advancedbilling/models/invoice_balance_item.py b/advancedbilling/models/invoice_balance_item.py index 8a6d9367..8a2bfeb4 100644 --- a/advancedbilling/models/invoice_balance_item.py +++ b/advancedbilling/models/invoice_balance_item.py @@ -19,6 +19,8 @@ class InvoiceBalanceItem(object): uid (str): TODO: type description here. number (str): TODO: type description here. outstanding_amount (str): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -39,7 +41,7 @@ def __init__(self, uid=APIHelper.SKIP, number=APIHelper.SKIP, outstanding_amount=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the InvoiceBalanceItem class""" # Initialize members of the class @@ -51,6 +53,8 @@ def __init__(self, self.outstanding_amount = outstanding_amount # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -68,7 +72,7 @@ def from_dictionary(cls, """ - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -76,14 +80,12 @@ def from_dictionary(cls, 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 - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, outstanding_amount, - dictionary) + additional_properties) @classmethod def validate(cls, dictionary): diff --git a/advancedbilling/models/invoice_consolidation_level.py b/advancedbilling/models/invoice_consolidation_level.py index 4199ae32..5046b742 100644 --- a/advancedbilling/models/invoice_consolidation_level.py +++ b/advancedbilling/models/invoice_consolidation_level.py @@ -29,6 +29,8 @@ class InvoiceConsolidationLevel(object): NONE: TODO: type description here. CHILD: TODO: type description here. PARENT: TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ _all_values = ['none', 'child', 'parent'] diff --git a/advancedbilling/models/invoice_credit.py b/advancedbilling/models/invoice_credit.py index a552077a..d2e4fba6 100644 --- a/advancedbilling/models/invoice_credit.py +++ b/advancedbilling/models/invoice_credit.py @@ -23,6 +23,8 @@ class InvoiceCredit(object): memo (str): TODO: type description here. original_amount (str): TODO: type description here. applied_amount (str): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -55,7 +57,7 @@ def __init__(self, memo=APIHelper.SKIP, original_amount=APIHelper.SKIP, applied_amount=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the InvoiceCredit class""" # Initialize members of the class @@ -75,6 +77,8 @@ def __init__(self, self.applied_amount = applied_amount # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -92,7 +96,7 @@ def from_dictionary(cls, """ - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -104,9 +108,7 @@ def from_dictionary(cls, 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 - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, @@ -115,7 +117,7 @@ def from_dictionary(cls, memo, original_amount, applied_amount, - dictionary) + additional_properties) @classmethod def validate(cls, dictionary): diff --git a/advancedbilling/models/invoice_custom_field.py b/advancedbilling/models/invoice_custom_field.py index e301c62f..aad67991 100644 --- a/advancedbilling/models/invoice_custom_field.py +++ b/advancedbilling/models/invoice_custom_field.py @@ -21,6 +21,8 @@ class InvoiceCustomField(object): name (str): TODO: type description here. value (str): TODO: type description here. metadatum_id (int): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -47,7 +49,7 @@ def __init__(self, name=APIHelper.SKIP, value=APIHelper.SKIP, metadatum_id=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the InvoiceCustomField class""" # Initialize members of the class @@ -63,6 +65,8 @@ def __init__(self, self.metadatum_id = metadatum_id # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -80,7 +84,7 @@ def from_dictionary(cls, """ - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -90,16 +94,14 @@ def from_dictionary(cls, 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 - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, name, value, metadatum_id, - dictionary) + additional_properties) @classmethod def validate(cls, dictionary): diff --git a/advancedbilling/models/invoice_customer.py b/advancedbilling/models/invoice_customer.py index fe8ba403..571d5f16 100644 --- a/advancedbilling/models/invoice_customer.py +++ b/advancedbilling/models/invoice_customer.py @@ -24,6 +24,8 @@ class InvoiceCustomer(object): email (str): TODO: type description here. vat_number (str): TODO: type description here. reference (str): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -63,7 +65,7 @@ def __init__(self, email=APIHelper.SKIP, vat_number=APIHelper.SKIP, reference=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the InvoiceCustomer class""" # Initialize members of the class @@ -83,6 +85,8 @@ def __init__(self, self.reference = reference # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -100,7 +104,7 @@ def from_dictionary(cls, """ - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -112,9 +116,7 @@ def from_dictionary(cls, 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 - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, @@ -123,7 +125,7 @@ def from_dictionary(cls, email, vat_number, reference, - dictionary) + additional_properties) @classmethod def validate(cls, dictionary): diff --git a/advancedbilling/models/invoice_date_field.py b/advancedbilling/models/invoice_date_field.py index d1b642c5..940c6c00 100644 --- a/advancedbilling/models/invoice_date_field.py +++ b/advancedbilling/models/invoice_date_field.py @@ -20,6 +20,8 @@ class InvoiceDateField(object): ISSUE_DATE: TODO: type description here. UPDATED_AT: TODO: type description here. PAID_DATE: TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ CREATED_AT = 'created_at' diff --git a/advancedbilling/models/invoice_debit.py b/advancedbilling/models/invoice_debit.py new file mode 100644 index 00000000..dc0ed7d2 --- /dev/null +++ b/advancedbilling/models/invoice_debit.py @@ -0,0 +1,150 @@ +# -*- coding: utf-8 -*- + +""" +advanced_billing + +This file was automatically generated for Maxio by APIMATIC v3.0 ( + https://www.apimatic.io ). +""" +from advancedbilling.api_helper import APIHelper + + +class InvoiceDebit(object): + + """Implementation of the 'Invoice Debit' model. + + TODO: type model description here. + + Attributes: + uid (str): TODO: type description here. + debit_note_number (str): TODO: type description here. + debit_note_uid (str): TODO: type description here. + role (DebitNoteRole): The role of the debit note. + transaction_time (datetime): TODO: type description here. + memo (str): TODO: type description here. + original_amount (str): TODO: type description here. + applied_amount (str): TODO: type description here. + 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' + } + + _optionals = [ + '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""" + + # Initialize members of the class + if uid is not APIHelper.SKIP: + self.uid = uid + if debit_note_number is not APIHelper.SKIP: + self.debit_note_number = debit_note_number + if debit_note_uid is not APIHelper.SKIP: + self.debit_note_uid = debit_note_uid + if role is not APIHelper.SKIP: + 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 + if memo is not APIHelper.SKIP: + self.memo = memo + if original_amount is not APIHelper.SKIP: + self.original_amount = original_amount + if applied_amount is not APIHelper.SKIP: + self.applied_amount = applied_amount + + # 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): + """Creates 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 + 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()} + # Return an object of this model + return cls(uid, + debit_note_number, + debit_note_uid, + role, + transaction_time, + memo, + original_amount, + applied_amount, + additional_properties) + + @classmethod + def validate(cls, dictionary): + """Validates 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 True + + if not isinstance(dictionary, dict): + return False + + return True diff --git a/advancedbilling/models/invoice_discount.py b/advancedbilling/models/invoice_discount.py index 29214a56..98a5a152 100644 --- a/advancedbilling/models/invoice_discount.py +++ b/advancedbilling/models/invoice_discount.py @@ -30,6 +30,8 @@ class InvoiceDiscount(object): transaction_id (int): TODO: type description here. line_item_breakouts (List[InvoiceDiscountBreakout]): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -81,7 +83,7 @@ def __init__(self, discount_amount=APIHelper.SKIP, transaction_id=APIHelper.SKIP, line_item_breakouts=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the InvoiceDiscount class""" # Initialize members of the class @@ -111,6 +113,8 @@ def __init__(self, self.line_item_breakouts = line_item_breakouts # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -128,7 +132,7 @@ def from_dictionary(cls, """ - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -149,9 +153,7 @@ def from_dictionary(cls, else: line_item_breakouts = APIHelper.SKIP # Clean out expected properties from dictionary - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, @@ -165,7 +167,7 @@ def from_dictionary(cls, discount_amount, transaction_id, line_item_breakouts, - dictionary) + additional_properties) @classmethod def validate(cls, dictionary): diff --git a/advancedbilling/models/invoice_discount_breakout.py b/advancedbilling/models/invoice_discount_breakout.py index 400dc4f6..e52f3dac 100644 --- a/advancedbilling/models/invoice_discount_breakout.py +++ b/advancedbilling/models/invoice_discount_breakout.py @@ -19,6 +19,8 @@ class InvoiceDiscountBreakout(object): uid (str): TODO: type description here. eligible_amount (str): TODO: type description here. discount_amount (str): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -39,7 +41,7 @@ def __init__(self, uid=APIHelper.SKIP, eligible_amount=APIHelper.SKIP, discount_amount=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the InvoiceDiscountBreakout class""" # Initialize members of the class @@ -51,6 +53,8 @@ def __init__(self, self.discount_amount = discount_amount # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -68,7 +72,7 @@ def from_dictionary(cls, """ - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -76,14 +80,12 @@ def from_dictionary(cls, 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 - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, discount_amount, - dictionary) + additional_properties) @classmethod def validate(cls, dictionary): diff --git a/advancedbilling/models/invoice_discount_source_type.py b/advancedbilling/models/invoice_discount_source_type.py index 4126f390..2dc1d22c 100644 --- a/advancedbilling/models/invoice_discount_source_type.py +++ b/advancedbilling/models/invoice_discount_source_type.py @@ -18,6 +18,8 @@ class InvoiceDiscountSourceType(object): COUPON: TODO: type description here. REFERRAL: TODO: type description here. ENUM_AD HOC COUPON: TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ _all_values = ['Coupon', 'Referral', 'Ad Hoc Coupon'] diff --git a/advancedbilling/models/invoice_discount_type.py b/advancedbilling/models/invoice_discount_type.py index 4d0da42d..46eb6ff0 100644 --- a/advancedbilling/models/invoice_discount_type.py +++ b/advancedbilling/models/invoice_discount_type.py @@ -18,6 +18,8 @@ class InvoiceDiscountType(object): PERCENTAGE: TODO: type description here. FLAT_AMOUNT: TODO: type description here. ROLLOVER: TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ _all_values = ['percentage', 'flat_amount', 'rollover'] diff --git a/advancedbilling/models/invoice_display_settings.py b/advancedbilling/models/invoice_display_settings.py index 9377db86..15a53149 100644 --- a/advancedbilling/models/invoice_display_settings.py +++ b/advancedbilling/models/invoice_display_settings.py @@ -18,6 +18,8 @@ class InvoiceDisplaySettings(object): Attributes: hide_zero_subtotal_lines (bool): TODO: type description here. include_discounts_on_lines (bool): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -35,7 +37,7 @@ class InvoiceDisplaySettings(object): def __init__(self, hide_zero_subtotal_lines=APIHelper.SKIP, include_discounts_on_lines=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the InvoiceDisplaySettings class""" # Initialize members of the class @@ -45,6 +47,8 @@ def __init__(self, self.include_discounts_on_lines = include_discounts_on_lines # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -62,20 +66,18 @@ def from_dictionary(cls, """ - if dictionary is None: + 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 # Clean out expected properties from dictionary - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, - dictionary) + additional_properties) @classmethod def validate(cls, dictionary): diff --git a/advancedbilling/models/invoice_event_payment_method.py b/advancedbilling/models/invoice_event_payment_method.py index 5044f2d9..45763aa8 100644 --- a/advancedbilling/models/invoice_event_payment_method.py +++ b/advancedbilling/models/invoice_event_payment_method.py @@ -20,6 +20,8 @@ class InvoiceEventPaymentMethod(object): CREDIT_CARD: TODO: type description here. EXTERNAL: TODO: type description here. PAYPAL_ACCOUNT: TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ _all_values = ['apple_pay', 'bank_account', 'credit_card', 'external', 'paypal_account'] diff --git a/advancedbilling/models/invoice_event_type.py b/advancedbilling/models/invoice_event_type.py index 4a29a767..fafe12db 100644 --- a/advancedbilling/models/invoice_event_type.py +++ b/advancedbilling/models/invoice_event_type.py @@ -30,6 +30,8 @@ class InvoiceEventType(object): REMOVE_PAYMENT: TODO: type description here. FAILED_PAYMENT: TODO: type description here. CHANGE_CHARGEBACK_STATUS: TODO: type description here. + 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'] diff --git a/advancedbilling/models/invoice_issued.py b/advancedbilling/models/invoice_issued.py index 1891a165..ba3d526a 100644 --- a/advancedbilling/models/invoice_issued.py +++ b/advancedbilling/models/invoice_issued.py @@ -37,6 +37,8 @@ class InvoiceIssued(object): consolidation_level (str): TODO: type description here. line_items (List[InvoiceLineItemEventData]): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -79,7 +81,7 @@ def __init__(self, product_name=None, consolidation_level=None, line_items=None, - additional_properties={}): + additional_properties=None): """Constructor for the InvoiceIssued class""" # Initialize members of the class @@ -100,6 +102,8 @@ def __init__(self, self.line_items = line_items # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -117,7 +121,7 @@ def from_dictionary(cls, """ - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -139,9 +143,7 @@ def from_dictionary(cls, 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 - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, @@ -158,7 +160,7 @@ def from_dictionary(cls, product_name, consolidation_level, line_items, - dictionary) + additional_properties) @classmethod def validate(cls, dictionary): diff --git a/advancedbilling/models/invoice_line_item.py b/advancedbilling/models/invoice_line_item.py index 679888e1..6c42dc46 100644 --- a/advancedbilling/models/invoice_line_item.py +++ b/advancedbilling/models/invoice_line_item.py @@ -88,6 +88,7 @@ class InvoiceLineItem(object): `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): TODO: type description here. hide (bool): TODO: type description here. component_cost_data (InvoiceLineItemComponentCostData): TODO: type description here. @@ -95,6 +96,8 @@ class InvoiceLineItem(object): product custom_item (bool): TODO: type description here. kind (str): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -117,6 +120,7 @@ class InvoiceLineItem(object): "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', @@ -142,6 +146,7 @@ class InvoiceLineItem(object): 'product_version', 'component_id', 'price_point_id', + 'billing_schedule_item_id', 'hide', 'component_cost_data', 'product_price_point_id', @@ -154,6 +159,7 @@ class InvoiceLineItem(object): 'product_version', 'component_id', 'price_point_id', + 'billing_schedule_item_id', 'component_cost_data', 'product_price_point_id', ] @@ -176,12 +182,13 @@ def __init__(self, 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={}): + additional_properties=None): """Constructor for the InvoiceLineItem class""" # Initialize members of the class @@ -219,6 +226,8 @@ def __init__(self, self.component_id = component_id if price_point_id is not APIHelper.SKIP: 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 if hide is not APIHelper.SKIP: self.hide = hide if component_cost_data is not APIHelper.SKIP: @@ -231,6 +240,8 @@ def __init__(self, self.kind = kind # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -248,7 +259,7 @@ def from_dictionary(cls, """ - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -269,6 +280,7 @@ def from_dictionary(cls, 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 @@ -278,9 +290,7 @@ def from_dictionary(cls, 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 - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, @@ -299,12 +309,13 @@ def from_dictionary(cls, product_version, component_id, price_point_id, + billing_schedule_item_id, hide, component_cost_data, product_price_point_id, custom_item, kind, - dictionary) + additional_properties) @classmethod def validate(cls, dictionary): diff --git a/advancedbilling/models/invoice_line_item_component_cost_data.py b/advancedbilling/models/invoice_line_item_component_cost_data.py index 08753591..fba4f251 100644 --- a/advancedbilling/models/invoice_line_item_component_cost_data.py +++ b/advancedbilling/models/invoice_line_item_component_cost_data.py @@ -18,6 +18,8 @@ class InvoiceLineItemComponentCostData(object): Attributes: rates (List[ComponentCostData]): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -32,7 +34,7 @@ class InvoiceLineItemComponentCostData(object): def __init__(self, rates=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the InvoiceLineItemComponentCostData class""" # Initialize members of the class @@ -40,6 +42,8 @@ def __init__(self, self.rates = rates # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -57,7 +61,7 @@ def from_dictionary(cls, """ - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -67,12 +71,10 @@ def from_dictionary(cls, else: rates = APIHelper.SKIP # Clean out expected properties from dictionary - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, - dictionary) + additional_properties) @classmethod def validate(cls, dictionary): diff --git a/advancedbilling/models/invoice_line_item_event_data.py b/advancedbilling/models/invoice_line_item_event_data.py index 617737b6..2720ca1b 100644 --- a/advancedbilling/models/invoice_line_item_event_data.py +++ b/advancedbilling/models/invoice_line_item_event_data.py @@ -38,6 +38,8 @@ class InvoiceLineItemEventData(object): component_id (int): TODO: type description here. billing_schedule_item_id (int): TODO: type description here. custom_item (bool): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -120,7 +122,7 @@ def __init__(self, component_id=APIHelper.SKIP, billing_schedule_item_id=APIHelper.SKIP, custom_item=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the InvoiceLineItemEventData class""" # Initialize members of the class @@ -166,6 +168,8 @@ def __init__(self, self.custom_item = custom_item # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -183,7 +187,7 @@ def from_dictionary(cls, """ - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -212,9 +216,7 @@ def from_dictionary(cls, 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 - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, @@ -236,7 +238,7 @@ def from_dictionary(cls, component_id, billing_schedule_item_id, custom_item, - dictionary) + additional_properties) @classmethod def validate(cls, dictionary): diff --git a/advancedbilling/models/invoice_line_item_pricing_detail.py b/advancedbilling/models/invoice_line_item_pricing_detail.py index f8c267ec..4c74c456 100644 --- a/advancedbilling/models/invoice_line_item_pricing_detail.py +++ b/advancedbilling/models/invoice_line_item_pricing_detail.py @@ -18,6 +18,8 @@ class InvoiceLineItemPricingDetail(object): Attributes: label (str): TODO: type description here. amount (str): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -35,7 +37,7 @@ class InvoiceLineItemPricingDetail(object): def __init__(self, label=APIHelper.SKIP, amount=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the InvoiceLineItemPricingDetail class""" # Initialize members of the class @@ -45,6 +47,8 @@ def __init__(self, self.amount = amount # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -62,20 +66,18 @@ def from_dictionary(cls, """ - if dictionary is None: + 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 # Clean out expected properties from dictionary - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, - dictionary) + additional_properties) @classmethod def validate(cls, dictionary): diff --git a/advancedbilling/models/invoice_payer.py b/advancedbilling/models/invoice_payer.py index ee7fa361..916c1857 100644 --- a/advancedbilling/models/invoice_payer.py +++ b/advancedbilling/models/invoice_payer.py @@ -22,6 +22,8 @@ class InvoicePayer(object): organization (str): TODO: type description here. email (str): TODO: type description here. vat_number (str): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -56,7 +58,7 @@ def __init__(self, organization=APIHelper.SKIP, email=APIHelper.SKIP, vat_number=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the InvoicePayer class""" # Initialize members of the class @@ -74,6 +76,8 @@ def __init__(self, self.vat_number = vat_number # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -91,7 +95,7 @@ def from_dictionary(cls, """ - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -102,9 +106,7 @@ def from_dictionary(cls, 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 - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, @@ -112,7 +114,7 @@ def from_dictionary(cls, organization, email, vat_number, - dictionary) + additional_properties) @classmethod def validate(cls, dictionary): diff --git a/advancedbilling/models/invoice_payer_change.py b/advancedbilling/models/invoice_payer_change.py index 10bcee7e..ae980ffe 100644 --- a/advancedbilling/models/invoice_payer_change.py +++ b/advancedbilling/models/invoice_payer_change.py @@ -20,6 +20,8 @@ class InvoicePayerChange(object): last_name (str): TODO: type description here. organization (str): TODO: type description here. email (str): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -43,7 +45,7 @@ def __init__(self, last_name=APIHelper.SKIP, organization=APIHelper.SKIP, email=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the InvoicePayerChange class""" # Initialize members of the class @@ -57,6 +59,8 @@ def __init__(self, self.email = email # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -74,7 +78,7 @@ def from_dictionary(cls, """ - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -83,12 +87,10 @@ def from_dictionary(cls, 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 - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, organization, email, - dictionary) + additional_properties) diff --git a/advancedbilling/models/invoice_payment.py b/advancedbilling/models/invoice_payment.py index d4917079..e99fe865 100644 --- a/advancedbilling/models/invoice_payment.py +++ b/advancedbilling/models/invoice_payment.py @@ -34,6 +34,8 @@ class InvoicePayment(object): a customer. Must be in the past. Applicable only to `external` payments. uid (str): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -87,7 +89,7 @@ def __init__(self, gateway_transaction_id=APIHelper.SKIP, received_on=APIHelper.SKIP, uid=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the InvoicePayment class""" # Initialize members of the class @@ -117,6 +119,8 @@ def __init__(self, self.uid = uid # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -134,7 +138,7 @@ def from_dictionary(cls, """ - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -154,9 +158,7 @@ def from_dictionary(cls, received_on = APIHelper.SKIP uid = dictionary.get("uid") if dictionary.get("uid") else APIHelper.SKIP # Clean out expected properties from dictionary - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, @@ -170,7 +172,7 @@ def from_dictionary(cls, gateway_transaction_id, received_on, uid, - dictionary) + additional_properties) @classmethod def validate(cls, dictionary): diff --git a/advancedbilling/models/invoice_payment_application.py b/advancedbilling/models/invoice_payment_application.py index 4831caba..3769fd92 100644 --- a/advancedbilling/models/invoice_payment_application.py +++ b/advancedbilling/models/invoice_payment_application.py @@ -21,6 +21,8 @@ class InvoicePaymentApplication(object): 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. """ @@ -41,7 +43,7 @@ def __init__(self, invoice_uid=APIHelper.SKIP, application_uid=APIHelper.SKIP, applied_amount=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the InvoicePaymentApplication class""" # Initialize members of the class @@ -53,6 +55,8 @@ def __init__(self, self.applied_amount = applied_amount # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -70,7 +74,7 @@ def from_dictionary(cls, """ - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -78,11 +82,9 @@ def from_dictionary(cls, 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 - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, applied_amount, - dictionary) + additional_properties) diff --git a/advancedbilling/models/invoice_payment_method.py b/advancedbilling/models/invoice_payment_method.py index 49300e4b..58144ad7 100644 --- a/advancedbilling/models/invoice_payment_method.py +++ b/advancedbilling/models/invoice_payment_method.py @@ -24,6 +24,8 @@ class InvoicePaymentMethod(object): card_expiration (str): TODO: type description here. last_four (str): TODO: type description here. masked_card_number (str): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -63,7 +65,7 @@ def __init__(self, card_expiration=APIHelper.SKIP, last_four=APIHelper.SKIP, masked_card_number=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the InvoicePaymentMethod class""" # Initialize members of the class @@ -85,6 +87,8 @@ def __init__(self, self.masked_card_number = masked_card_number # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -102,7 +106,7 @@ def from_dictionary(cls, """ - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -115,9 +119,7 @@ def from_dictionary(cls, 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 - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, @@ -127,7 +129,7 @@ def from_dictionary(cls, card_expiration, last_four, masked_card_number, - dictionary) + additional_properties) @classmethod def validate(cls, dictionary): diff --git a/advancedbilling/models/invoice_payment_method_type.py b/advancedbilling/models/invoice_payment_method_type.py index 9268e9a9..68c81fc6 100644 --- a/advancedbilling/models/invoice_payment_method_type.py +++ b/advancedbilling/models/invoice_payment_method_type.py @@ -21,6 +21,8 @@ class InvoicePaymentMethodType(object): MONEY_ORDER: TODO: type description here. ACH: TODO: type description here. OTHER: TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ _all_values = ['credit_card', 'check', 'cash', 'money_order', 'ach', 'other'] diff --git a/advancedbilling/models/invoice_payment_type.py b/advancedbilling/models/invoice_payment_type.py index 48612bf6..8fc13c87 100644 --- a/advancedbilling/models/invoice_payment_type.py +++ b/advancedbilling/models/invoice_payment_type.py @@ -19,6 +19,8 @@ class InvoicePaymentType(object): PREPAYMENT: TODO: type description here. SERVICE_CREDIT: TODO: type description here. PAYMENT: TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ EXTERNAL = 'external' diff --git a/advancedbilling/models/invoice_pre_payment.py b/advancedbilling/models/invoice_pre_payment.py index 3e05a259..4cabb04d 100644 --- a/advancedbilling/models/invoice_pre_payment.py +++ b/advancedbilling/models/invoice_pre_payment.py @@ -22,6 +22,8 @@ class InvoicePrePayment(object): ending_balance_in_cents (long|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. """ @@ -42,7 +44,7 @@ def __init__(self, subscription_id=APIHelper.SKIP, amount_in_cents=APIHelper.SKIP, ending_balance_in_cents=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the InvoicePrePayment class""" # Initialize members of the class @@ -54,6 +56,8 @@ def __init__(self, self.ending_balance_in_cents = ending_balance_in_cents # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -71,7 +75,7 @@ def from_dictionary(cls, """ - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -79,11 +83,9 @@ def from_dictionary(cls, 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 - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, ending_balance_in_cents, - dictionary) + additional_properties) diff --git a/advancedbilling/models/invoice_previous_balance.py b/advancedbilling/models/invoice_previous_balance.py index 1d219bed..546a28a6 100644 --- a/advancedbilling/models/invoice_previous_balance.py +++ b/advancedbilling/models/invoice_previous_balance.py @@ -19,6 +19,8 @@ class InvoicePreviousBalance(object): Attributes: captured_at (datetime): TODO: type description here. invoices (List[InvoiceBalanceItem]): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -36,7 +38,7 @@ class InvoicePreviousBalance(object): def __init__(self, captured_at=APIHelper.SKIP, invoices=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the InvoicePreviousBalance class""" # Initialize members of the class @@ -46,6 +48,8 @@ def __init__(self, self.invoices = invoices # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -63,7 +67,7 @@ def from_dictionary(cls, """ - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -74,13 +78,11 @@ def from_dictionary(cls, else: invoices = APIHelper.SKIP # Clean out expected properties from dictionary - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, - dictionary) + additional_properties) @classmethod def validate(cls, dictionary): diff --git a/advancedbilling/models/invoice_refund.py b/advancedbilling/models/invoice_refund.py index eaebfc80..561840bd 100644 --- a/advancedbilling/models/invoice_refund.py +++ b/advancedbilling/models/invoice_refund.py @@ -26,6 +26,8 @@ class InvoiceRefund(object): gateway_used (str): TODO: type description here. gateway_handle (str): TODO: type description here. ach_late_reject (bool): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -70,7 +72,7 @@ def __init__(self, gateway_used=APIHelper.SKIP, gateway_handle=APIHelper.SKIP, ach_late_reject=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the InvoiceRefund class""" # Initialize members of the class @@ -94,6 +96,8 @@ def __init__(self, self.ach_late_reject = ach_late_reject # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -111,7 +115,7 @@ def from_dictionary(cls, """ - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -125,9 +129,7 @@ def from_dictionary(cls, 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 - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, @@ -138,7 +140,7 @@ def from_dictionary(cls, gateway_used, gateway_handle, ach_late_reject, - dictionary) + additional_properties) @classmethod def validate(cls, dictionary): diff --git a/advancedbilling/models/invoice_response.py b/advancedbilling/models/invoice_response.py index 86a7d446..fe846bc9 100644 --- a/advancedbilling/models/invoice_response.py +++ b/advancedbilling/models/invoice_response.py @@ -17,6 +17,8 @@ class InvoiceResponse(object): Attributes: invoice (Invoice): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -27,13 +29,15 @@ class InvoiceResponse(object): def __init__(self, invoice=None, - additional_properties={}): + additional_properties=None): """Constructor for the InvoiceResponse class""" # Initialize members of the class self.invoice = invoice # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -51,15 +55,13 @@ def from_dictionary(cls, """ - if dictionary is None: + 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 # Clean out expected properties from dictionary - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, - dictionary) + additional_properties) diff --git a/advancedbilling/models/invoice_role.py b/advancedbilling/models/invoice_role.py index cb9f2f6b..9f33278d 100644 --- a/advancedbilling/models/invoice_role.py +++ b/advancedbilling/models/invoice_role.py @@ -25,6 +25,8 @@ class InvoiceRole(object): ADHOC: TODO: type description here. BACKPORT: TODO: type description here. BACKPORTBALANCERECONCILIATION: TODO: type description here. + 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'] diff --git a/advancedbilling/models/invoice_seller.py b/advancedbilling/models/invoice_seller.py index df6af6ea..ee931a15 100644 --- a/advancedbilling/models/invoice_seller.py +++ b/advancedbilling/models/invoice_seller.py @@ -22,6 +22,8 @@ class InvoiceSeller(object): address (InvoiceAddress): TODO: type description here. phone (str): TODO: type description here. logo_url (str): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -49,7 +51,7 @@ def __init__(self, address=APIHelper.SKIP, phone=APIHelper.SKIP, logo_url=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the InvoiceSeller class""" # Initialize members of the class @@ -63,6 +65,8 @@ def __init__(self, self.logo_url = logo_url # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -80,7 +84,7 @@ def from_dictionary(cls, """ - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -89,15 +93,13 @@ def from_dictionary(cls, 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 - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, phone, logo_url, - dictionary) + additional_properties) @classmethod def validate(cls, dictionary): diff --git a/advancedbilling/models/invoice_sort_field.py b/advancedbilling/models/invoice_sort_field.py index d9101b06..aab82e18 100644 --- a/advancedbilling/models/invoice_sort_field.py +++ b/advancedbilling/models/invoice_sort_field.py @@ -23,6 +23,8 @@ class InvoiceSortField(object): ISSUE_DATE: TODO: type description here. DUE_DATE: TODO: type description here. NUMBER: TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ STATUS = 'status' diff --git a/advancedbilling/models/invoice_status.py b/advancedbilling/models/invoice_status.py index 144e35a5..656c3ad7 100644 --- a/advancedbilling/models/invoice_status.py +++ b/advancedbilling/models/invoice_status.py @@ -23,9 +23,12 @@ class InvoiceStatus(object): PENDING: TODO: type description here. VOIDED: TODO: type description here. CANCELED: TODO: type description here. + PROCESSING: TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ - _all_values = ['draft', 'open', 'paid', 'pending', 'voided', 'canceled'] + _all_values = ['draft', 'open', 'paid', 'pending', 'voided', 'canceled', 'processing'] DRAFT = 'draft' OPEN = 'open' @@ -38,6 +41,8 @@ class InvoiceStatus(object): CANCELED = 'canceled' + PROCESSING = 'processing' + @classmethod def validate(cls, value): """Validates value contains in enum diff --git a/advancedbilling/models/invoice_tax.py b/advancedbilling/models/invoice_tax.py index ee91c7e5..fae04a49 100644 --- a/advancedbilling/models/invoice_tax.py +++ b/advancedbilling/models/invoice_tax.py @@ -35,6 +35,8 @@ class InvoiceTax(object): eu_vat (bool): TODO: type description here. mtype (str): TODO: type description here. tax_exempt_amount (str): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -92,7 +94,7 @@ def __init__(self, eu_vat=APIHelper.SKIP, mtype=APIHelper.SKIP, tax_exempt_amount=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the InvoiceTax class""" # Initialize members of the class @@ -126,6 +128,8 @@ def __init__(self, self.tax_exempt_amount = tax_exempt_amount # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -143,7 +147,7 @@ def from_dictionary(cls, """ - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -170,9 +174,7 @@ def from_dictionary(cls, 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 - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, @@ -188,7 +190,7 @@ def from_dictionary(cls, eu_vat, mtype, tax_exempt_amount, - dictionary) + additional_properties) @classmethod def validate(cls, dictionary): diff --git a/advancedbilling/models/invoice_tax_breakout.py b/advancedbilling/models/invoice_tax_breakout.py index 5582b60f..90d3ea05 100644 --- a/advancedbilling/models/invoice_tax_breakout.py +++ b/advancedbilling/models/invoice_tax_breakout.py @@ -20,6 +20,8 @@ class InvoiceTaxBreakout(object): taxable_amount (str): TODO: type description here. tax_amount (str): TODO: type description here. tax_exempt_amount (str): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -43,7 +45,7 @@ def __init__(self, taxable_amount=APIHelper.SKIP, tax_amount=APIHelper.SKIP, tax_exempt_amount=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the InvoiceTaxBreakout class""" # Initialize members of the class @@ -57,6 +59,8 @@ def __init__(self, self.tax_exempt_amount = tax_exempt_amount # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -74,7 +78,7 @@ def from_dictionary(cls, """ - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -83,15 +87,13 @@ def from_dictionary(cls, 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 - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, tax_amount, tax_exempt_amount, - dictionary) + additional_properties) @classmethod def validate(cls, dictionary): diff --git a/advancedbilling/models/invoice_tax_component_breakout.py b/advancedbilling/models/invoice_tax_component_breakout.py index 4f11abc3..04143819 100644 --- a/advancedbilling/models/invoice_tax_component_breakout.py +++ b/advancedbilling/models/invoice_tax_component_breakout.py @@ -30,6 +30,8 @@ class InvoiceTaxComponentBreakout(object): tax_authority_type (int): TODO: type description here. state_assigned_no (str): TODO: type description here. tax_sub_type (str): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -83,7 +85,7 @@ def __init__(self, tax_authority_type=APIHelper.SKIP, state_assigned_no=APIHelper.SKIP, tax_sub_type=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the InvoiceTaxComponentBreakout class""" # Initialize members of the class @@ -117,6 +119,8 @@ def __init__(self, self.tax_sub_type = tax_sub_type # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -134,7 +138,7 @@ def from_dictionary(cls, """ - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -153,9 +157,7 @@ def from_dictionary(cls, 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 - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, @@ -171,7 +173,7 @@ def from_dictionary(cls, tax_authority_type, state_assigned_no, tax_sub_type, - dictionary) + additional_properties) @classmethod def validate(cls, dictionary): diff --git a/advancedbilling/models/issue_advance_invoice_request.py b/advancedbilling/models/issue_advance_invoice_request.py index 9814e5f2..197492b9 100644 --- a/advancedbilling/models/issue_advance_invoice_request.py +++ b/advancedbilling/models/issue_advance_invoice_request.py @@ -17,6 +17,8 @@ class IssueAdvanceInvoiceRequest(object): Attributes: force (bool): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -31,7 +33,7 @@ class IssueAdvanceInvoiceRequest(object): def __init__(self, force=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the IssueAdvanceInvoiceRequest class""" # Initialize members of the class @@ -39,6 +41,8 @@ def __init__(self, self.force = force # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -56,15 +60,13 @@ def from_dictionary(cls, """ - if dictionary is None: + 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 # Clean out expected properties from dictionary - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, - dictionary) + additional_properties) diff --git a/advancedbilling/models/issue_invoice_event.py b/advancedbilling/models/issue_invoice_event.py index 6e790552..d5643f56 100644 --- a/advancedbilling/models/issue_invoice_event.py +++ b/advancedbilling/models/issue_invoice_event.py @@ -25,6 +25,8 @@ class IssueInvoiceEvent(object): event_type (InvoiceEventType): TODO: type description here. event_data (IssueInvoiceEventData): Example schema for an `issue_invoice` event + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -43,7 +45,7 @@ def __init__(self, invoice=None, event_type='issue_invoice', event_data=None, - additional_properties={}): + additional_properties=None): """Constructor for the IssueInvoiceEvent class""" # Initialize members of the class @@ -54,6 +56,8 @@ def __init__(self, self.event_data = event_data # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -71,7 +75,7 @@ def from_dictionary(cls, """ - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -81,16 +85,14 @@ def from_dictionary(cls, 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 - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, invoice, event_type, event_data, - dictionary) + additional_properties) @classmethod def validate(cls, dictionary): diff --git a/advancedbilling/models/issue_invoice_event_data.py b/advancedbilling/models/issue_invoice_event_data.py index 8400af94..3966e08e 100644 --- a/advancedbilling/models/issue_invoice_event_data.py +++ b/advancedbilling/models/issue_invoice_event_data.py @@ -41,6 +41,8 @@ class IssueInvoiceEventData(object): 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. """ @@ -59,7 +61,7 @@ def __init__(self, to_status=None, due_amount=None, total_amount=None, - additional_properties={}): + additional_properties=None): """Constructor for the IssueInvoiceEventData class""" # Initialize members of the class @@ -70,6 +72,8 @@ def __init__(self, self.total_amount = total_amount # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -87,7 +91,7 @@ def from_dictionary(cls, """ - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -97,16 +101,14 @@ def from_dictionary(cls, 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 - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, to_status, due_amount, total_amount, - dictionary) + additional_properties) @classmethod def validate(cls, dictionary): diff --git a/advancedbilling/models/issue_invoice_request.py b/advancedbilling/models/issue_invoice_request.py index 38254157..aef238aa 100644 --- a/advancedbilling/models/issue_invoice_request.py +++ b/advancedbilling/models/issue_invoice_request.py @@ -30,6 +30,8 @@ class IssueInvoiceRequest(object): 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. """ @@ -44,13 +46,15 @@ class IssueInvoiceRequest(object): def __init__(self, on_failed_payment='leave_open_invoice', - additional_properties={}): + additional_properties=None): """Constructor for the IssueInvoiceRequest class""" # Initialize members of the class self.on_failed_payment = on_failed_payment # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -68,15 +72,13 @@ def from_dictionary(cls, """ - if dictionary is None: + 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' # Clean out expected properties from dictionary - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, - dictionary) + additional_properties) diff --git a/advancedbilling/models/issue_service_credit.py b/advancedbilling/models/issue_service_credit.py index 9ab6b310..5224c16e 100644 --- a/advancedbilling/models/issue_service_credit.py +++ b/advancedbilling/models/issue_service_credit.py @@ -18,6 +18,8 @@ class IssueServiceCredit(object): Attributes: amount (float | str): TODO: type description here. memo (str): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -34,7 +36,7 @@ class IssueServiceCredit(object): def __init__(self, amount=None, memo=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the IssueServiceCredit class""" # Initialize members of the class @@ -43,6 +45,8 @@ def __init__(self, self.memo = memo # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -61,20 +65,18 @@ def from_dictionary(cls, """ from advancedbilling.utilities.union_type_lookup import UnionTypeLookUp - if dictionary is None: + 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 # Clean out expected properties from dictionary - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, - dictionary) + additional_properties) @classmethod def validate(cls, dictionary): diff --git a/advancedbilling/models/issue_service_credit_request.py b/advancedbilling/models/issue_service_credit_request.py index 828609c4..0fbb5179 100644 --- a/advancedbilling/models/issue_service_credit_request.py +++ b/advancedbilling/models/issue_service_credit_request.py @@ -17,6 +17,8 @@ class IssueServiceCreditRequest(object): Attributes: service_credit (IssueServiceCredit): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -27,13 +29,15 @@ class IssueServiceCreditRequest(object): def __init__(self, service_credit=None, - additional_properties={}): + additional_properties=None): """Constructor for the IssueServiceCreditRequest class""" # Initialize members of the class self.service_credit = service_credit # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -51,15 +55,13 @@ def from_dictionary(cls, """ - if dictionary is None: + 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 # Clean out expected properties from dictionary - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, - dictionary) + additional_properties) diff --git a/advancedbilling/models/item_category.py b/advancedbilling/models/item_category.py index ca19dfbe..d28844fc 100644 --- a/advancedbilling/models/item_category.py +++ b/advancedbilling/models/item_category.py @@ -21,6 +21,8 @@ class ItemCategory(object): ENUM_DIGITAL SERVICES: TODO: type description here. ENUM_PHYSICAL GOODS: TODO: type description here. OTHER: TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ ENUM_BUSINESS_SOFTWARE = 'Business Software' diff --git a/advancedbilling/models/item_price_point_changed.py b/advancedbilling/models/item_price_point_changed.py index 60b4a142..43f22a93 100644 --- a/advancedbilling/models/item_price_point_changed.py +++ b/advancedbilling/models/item_price_point_changed.py @@ -23,6 +23,8 @@ class ItemPricePointChanged(object): item_name (str): TODO: type description here. previous_price_point (ItemPricePointData): TODO: type description here. current_price_point (ItemPricePointData): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -43,7 +45,7 @@ def __init__(self, item_name=None, previous_price_point=None, current_price_point=None, - additional_properties={}): + additional_properties=None): """Constructor for the ItemPricePointChanged class""" # Initialize members of the class @@ -55,6 +57,8 @@ def __init__(self, self.current_price_point = current_price_point # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -72,7 +76,7 @@ def from_dictionary(cls, """ - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -83,9 +87,7 @@ def from_dictionary(cls, 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 - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, @@ -93,7 +95,7 @@ def from_dictionary(cls, item_name, previous_price_point, current_price_point, - dictionary) + additional_properties) @classmethod def validate(cls, dictionary): diff --git a/advancedbilling/models/item_price_point_data.py b/advancedbilling/models/item_price_point_data.py index 46a2b467..0af0cd01 100644 --- a/advancedbilling/models/item_price_point_data.py +++ b/advancedbilling/models/item_price_point_data.py @@ -19,6 +19,8 @@ class ItemPricePointData(object): id (int): TODO: type description here. handle (str): TODO: type description here. name (str): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -39,7 +41,7 @@ def __init__(self, id=APIHelper.SKIP, handle=APIHelper.SKIP, name=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the ItemPricePointData class""" # Initialize members of the class @@ -51,6 +53,8 @@ def __init__(self, self.name = name # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -68,7 +72,7 @@ def from_dictionary(cls, """ - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -76,14 +80,12 @@ def from_dictionary(cls, 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 - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, name, - dictionary) + additional_properties) @classmethod def validate(cls, dictionary): diff --git a/advancedbilling/models/line_item_kind.py b/advancedbilling/models/line_item_kind.py index 122ac84f..369cd0d9 100644 --- a/advancedbilling/models/line_item_kind.py +++ b/advancedbilling/models/line_item_kind.py @@ -25,6 +25,8 @@ class LineItemKind(object): EVENT_BASED_COMPONENT: TODO: type description here. COUPON: TODO: type description here. TAX: TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ BASELINE = 'baseline' diff --git a/advancedbilling/models/line_item_transaction_type.py b/advancedbilling/models/line_item_transaction_type.py index 18362502..0f9992f2 100644 --- a/advancedbilling/models/line_item_transaction_type.py +++ b/advancedbilling/models/line_item_transaction_type.py @@ -22,6 +22,8 @@ class LineItemTransactionType(object): REFUND: TODO: type description here. INFO_TRANSACTION: TODO: type description here. PAYMENT_AUTHORIZATION: TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ CHARGE = 'charge' diff --git a/advancedbilling/models/list_components_filter.py b/advancedbilling/models/list_components_filter.py index 38572010..0fe7b7c1 100644 --- a/advancedbilling/models/list_components_filter.py +++ b/advancedbilling/models/list_components_filter.py @@ -22,6 +22,8 @@ class ListComponentsFilter(object): 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. """ @@ -39,7 +41,7 @@ class ListComponentsFilter(object): def __init__(self, ids=APIHelper.SKIP, use_site_exchange_rate=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the ListComponentsFilter class""" # Initialize members of the class @@ -49,6 +51,8 @@ def __init__(self, self.use_site_exchange_rate = use_site_exchange_rate # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -66,17 +70,15 @@ def from_dictionary(cls, """ - if dictionary is None: + 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 # Clean out expected properties from dictionary - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, - dictionary) + additional_properties) diff --git a/advancedbilling/models/list_components_price_points_include.py b/advancedbilling/models/list_components_price_points_include.py index 05000330..edeb30bf 100644 --- a/advancedbilling/models/list_components_price_points_include.py +++ b/advancedbilling/models/list_components_price_points_include.py @@ -16,6 +16,8 @@ class ListComponentsPricePointsInclude(object): Attributes: CURRENCY_PRICES: TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ CURRENCY_PRICES = 'currency_prices' diff --git a/advancedbilling/models/list_components_price_points_response.py b/advancedbilling/models/list_components_price_points_response.py index dde50549..ab0d4000 100644 --- a/advancedbilling/models/list_components_price_points_response.py +++ b/advancedbilling/models/list_components_price_points_response.py @@ -17,6 +17,8 @@ class ListComponentsPricePointsResponse(object): Attributes: price_points (List[ComponentPricePoint]): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -27,13 +29,15 @@ class ListComponentsPricePointsResponse(object): def __init__(self, price_points=None, - additional_properties={}): + additional_properties=None): """Constructor for the ListComponentsPricePointsResponse class""" # Initialize members of the class self.price_points = price_points # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -51,7 +55,7 @@ def from_dictionary(cls, """ - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -59,9 +63,7 @@ def from_dictionary(cls, 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 - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, - dictionary) + additional_properties) diff --git a/advancedbilling/models/list_coupons_filter.py b/advancedbilling/models/list_coupons_filter.py index 1d13aa87..293391b0 100644 --- a/advancedbilling/models/list_coupons_filter.py +++ b/advancedbilling/models/list_coupons_filter.py @@ -49,6 +49,8 @@ class ListCouponsFilter(object): use_site_exchange_rate (bool): Allows fetching coupons 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. """ @@ -84,7 +86,7 @@ def __init__(self, ids=APIHelper.SKIP, codes=APIHelper.SKIP, use_site_exchange_rate=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the ListCouponsFilter class""" # Initialize members of the class @@ -106,6 +108,8 @@ def __init__(self, self.use_site_exchange_rate = use_site_exchange_rate # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -123,7 +127,7 @@ def from_dictionary(cls, """ - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -136,9 +140,7 @@ def from_dictionary(cls, 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 # Clean out expected properties from dictionary - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, @@ -148,4 +150,4 @@ def from_dictionary(cls, ids, codes, use_site_exchange_rate, - dictionary) + additional_properties) diff --git a/advancedbilling/models/list_credit_notes_response.py b/advancedbilling/models/list_credit_notes_response.py index fc373abd..b7587693 100644 --- a/advancedbilling/models/list_credit_notes_response.py +++ b/advancedbilling/models/list_credit_notes_response.py @@ -17,6 +17,8 @@ class ListCreditNotesResponse(object): Attributes: credit_notes (List[CreditNote]): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -27,13 +29,15 @@ class ListCreditNotesResponse(object): def __init__(self, credit_notes=None, - additional_properties={}): + additional_properties=None): """Constructor for the ListCreditNotesResponse class""" # Initialize members of the class self.credit_notes = credit_notes # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -51,7 +55,7 @@ def from_dictionary(cls, """ - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -59,9 +63,7 @@ def from_dictionary(cls, 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 - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, - dictionary) + additional_properties) diff --git a/advancedbilling/models/list_events_date_field.py b/advancedbilling/models/list_events_date_field.py index 77c1123f..97cb911a 100644 --- a/advancedbilling/models/list_events_date_field.py +++ b/advancedbilling/models/list_events_date_field.py @@ -16,6 +16,8 @@ class ListEventsDateField(object): Attributes: CREATED_AT: TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ CREATED_AT = 'created_at' diff --git a/advancedbilling/models/list_invoice_events_response.py b/advancedbilling/models/list_invoice_events_response.py index 8810aa4e..80fa56ae 100644 --- a/advancedbilling/models/list_invoice_events_response.py +++ b/advancedbilling/models/list_invoice_events_response.py @@ -26,6 +26,8 @@ class ListInvoiceEventsResponse(object): page (int): TODO: type description here. per_page (int): TODO: type description here. total_pages (int): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -49,7 +51,7 @@ def __init__(self, page=APIHelper.SKIP, per_page=APIHelper.SKIP, total_pages=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the ListInvoiceEventsResponse class""" # Initialize members of the class @@ -63,6 +65,8 @@ def __init__(self, self.total_pages = total_pages # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -81,7 +85,7 @@ def from_dictionary(cls, """ from advancedbilling.utilities.union_type_lookup import UnionTypeLookUp - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -90,12 +94,10 @@ def from_dictionary(cls, 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 - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, per_page, total_pages, - dictionary) + additional_properties) diff --git a/advancedbilling/models/list_invoices_response.py b/advancedbilling/models/list_invoices_response.py index fef624f9..d3dec179 100644 --- a/advancedbilling/models/list_invoices_response.py +++ b/advancedbilling/models/list_invoices_response.py @@ -17,6 +17,8 @@ class ListInvoicesResponse(object): Attributes: invoices (List[Invoice]): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -27,13 +29,15 @@ class ListInvoicesResponse(object): def __init__(self, invoices=None, - additional_properties={}): + additional_properties=None): """Constructor for the ListInvoicesResponse class""" # Initialize members of the class self.invoices = invoices # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -51,7 +55,7 @@ def from_dictionary(cls, """ - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -59,9 +63,7 @@ def from_dictionary(cls, if dictionary.get('invoices') is not None: invoices = [Invoice.from_dictionary(x) for x in dictionary.get('invoices')] # Clean out expected properties from dictionary - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, - dictionary) + additional_properties) diff --git a/advancedbilling/models/list_metafields_response.py b/advancedbilling/models/list_metafields_response.py index cb45a425..28dc2a06 100644 --- a/advancedbilling/models/list_metafields_response.py +++ b/advancedbilling/models/list_metafields_response.py @@ -22,6 +22,8 @@ class ListMetafieldsResponse(object): total_pages (int): TODO: type description here. per_page (int): TODO: type description here. metafields (List[Metafield]): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -48,7 +50,7 @@ def __init__(self, total_pages=APIHelper.SKIP, per_page=APIHelper.SKIP, metafields=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the ListMetafieldsResponse class""" # Initialize members of the class @@ -64,6 +66,8 @@ def __init__(self, self.metafields = metafields # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -81,7 +85,7 @@ def from_dictionary(cls, """ - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -95,13 +99,11 @@ def from_dictionary(cls, else: metafields = APIHelper.SKIP # Clean out expected properties from dictionary - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, total_pages, per_page, metafields, - dictionary) + additional_properties) diff --git a/advancedbilling/models/list_mrr_filter.py b/advancedbilling/models/list_mrr_filter.py index fd0a80d9..fce6576b 100644 --- a/advancedbilling/models/list_mrr_filter.py +++ b/advancedbilling/models/list_mrr_filter.py @@ -18,6 +18,8 @@ class ListMrrFilter(object): 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. """ @@ -32,7 +34,7 @@ class ListMrrFilter(object): def __init__(self, subscription_ids=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the ListMrrFilter class""" # Initialize members of the class @@ -40,6 +42,8 @@ def __init__(self, self.subscription_ids = subscription_ids # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -57,15 +61,13 @@ def from_dictionary(cls, """ - if dictionary is None: + 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 # Clean out expected properties from dictionary - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, - dictionary) + additional_properties) diff --git a/advancedbilling/models/list_mrr_response.py b/advancedbilling/models/list_mrr_response.py index 24325c09..fb6092d7 100644 --- a/advancedbilling/models/list_mrr_response.py +++ b/advancedbilling/models/list_mrr_response.py @@ -17,6 +17,8 @@ class ListMRRResponse(object): Attributes: mrr (ListMRRResponseResult): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -27,13 +29,15 @@ class ListMRRResponse(object): def __init__(self, mrr=None, - additional_properties={}): + additional_properties=None): """Constructor for the ListMRRResponse class""" # Initialize members of the class self.mrr = mrr # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -51,15 +55,13 @@ def from_dictionary(cls, """ - if dictionary is None: + 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 # Clean out expected properties from dictionary - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, - dictionary) + additional_properties) diff --git a/advancedbilling/models/list_mrr_response_result.py b/advancedbilling/models/list_mrr_response_result.py index 9c04d4f6..25c15c4e 100644 --- a/advancedbilling/models/list_mrr_response_result.py +++ b/advancedbilling/models/list_mrr_response_result.py @@ -24,6 +24,8 @@ class ListMRRResponseResult(object): currency (str): TODO: type description here. currency_symbol (str): TODO: type description here. movements (List[Movement]): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -56,7 +58,7 @@ def __init__(self, currency=APIHelper.SKIP, currency_symbol=APIHelper.SKIP, movements=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the ListMRRResponseResult class""" # Initialize members of the class @@ -76,6 +78,8 @@ def __init__(self, self.movements = movements # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -93,7 +97,7 @@ def from_dictionary(cls, """ - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -109,9 +113,7 @@ def from_dictionary(cls, else: movements = APIHelper.SKIP # Clean out expected properties from dictionary - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, @@ -120,4 +122,4 @@ def from_dictionary(cls, currency, currency_symbol, movements, - dictionary) + additional_properties) diff --git a/advancedbilling/models/list_offers_response.py b/advancedbilling/models/list_offers_response.py index 2101c48d..ccc85552 100644 --- a/advancedbilling/models/list_offers_response.py +++ b/advancedbilling/models/list_offers_response.py @@ -18,6 +18,8 @@ class ListOffersResponse(object): Attributes: offers (List[Offer]): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -32,7 +34,7 @@ class ListOffersResponse(object): def __init__(self, offers=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the ListOffersResponse class""" # Initialize members of the class @@ -40,6 +42,8 @@ def __init__(self, self.offers = offers # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -57,7 +61,7 @@ def from_dictionary(cls, """ - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -67,9 +71,7 @@ def from_dictionary(cls, else: offers = APIHelper.SKIP # Clean out expected properties from dictionary - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, - dictionary) + additional_properties) diff --git a/advancedbilling/models/list_prepayment_date_field.py b/advancedbilling/models/list_prepayment_date_field.py index 728562a7..26a9e11a 100644 --- a/advancedbilling/models/list_prepayment_date_field.py +++ b/advancedbilling/models/list_prepayment_date_field.py @@ -17,6 +17,8 @@ class ListPrepaymentDateField(object): Attributes: CREATED_AT: TODO: type description here. APPLICATION_AT: TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ CREATED_AT = 'created_at' diff --git a/advancedbilling/models/list_prepayments_filter.py b/advancedbilling/models/list_prepayments_filter.py index 24e3ccee..a8650c5d 100644 --- a/advancedbilling/models/list_prepayments_filter.py +++ b/advancedbilling/models/list_prepayments_filter.py @@ -30,6 +30,8 @@ class ListPrepaymentsFilter(object): 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. """ @@ -50,7 +52,7 @@ def __init__(self, date_field=APIHelper.SKIP, start_date=APIHelper.SKIP, end_date=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the ListPrepaymentsFilter class""" # Initialize members of the class @@ -62,6 +64,8 @@ def __init__(self, self.end_date = end_date # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -79,7 +83,7 @@ def from_dictionary(cls, """ - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -87,11 +91,9 @@ def from_dictionary(cls, 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 - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, end_date, - dictionary) + additional_properties) diff --git a/advancedbilling/models/list_price_points_filter.py b/advancedbilling/models/list_price_points_filter.py index 90a5aa6b..3fa190ff 100644 --- a/advancedbilling/models/list_price_points_filter.py +++ b/advancedbilling/models/list_price_points_filter.py @@ -48,6 +48,8 @@ class ListPricePointsFilter(object): 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. """ @@ -83,7 +85,7 @@ def __init__(self, mtype=APIHelper.SKIP, ids=APIHelper.SKIP, archived_at=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the ListPricePointsFilter class""" # Initialize members of the class @@ -105,6 +107,8 @@ def __init__(self, self.archived_at = archived_at # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -122,7 +126,7 @@ def from_dictionary(cls, """ - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -135,9 +139,7 @@ def from_dictionary(cls, 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 - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, @@ -147,4 +149,4 @@ def from_dictionary(cls, mtype, ids, archived_at, - dictionary) + additional_properties) diff --git a/advancedbilling/models/list_product_price_points_response.py b/advancedbilling/models/list_product_price_points_response.py index 8f7556f5..6b04ed4e 100644 --- a/advancedbilling/models/list_product_price_points_response.py +++ b/advancedbilling/models/list_product_price_points_response.py @@ -17,6 +17,8 @@ class ListProductPricePointsResponse(object): Attributes: price_points (List[ProductPricePoint]): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -27,13 +29,15 @@ class ListProductPricePointsResponse(object): def __init__(self, price_points=None, - additional_properties={}): + additional_properties=None): """Constructor for the ListProductPricePointsResponse class""" # Initialize members of the class self.price_points = price_points # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -51,7 +55,7 @@ def from_dictionary(cls, """ - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -59,9 +63,7 @@ def from_dictionary(cls, 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 - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, - dictionary) + additional_properties) diff --git a/advancedbilling/models/list_products_filter.py b/advancedbilling/models/list_products_filter.py index f1450e4b..108b238b 100644 --- a/advancedbilling/models/list_products_filter.py +++ b/advancedbilling/models/list_products_filter.py @@ -29,6 +29,8 @@ class ListProductsFilter(object): 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. """ @@ -49,7 +51,7 @@ def __init__(self, ids=APIHelper.SKIP, prepaid_product_price_point=APIHelper.SKIP, use_site_exchange_rate=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the ListProductsFilter class""" # Initialize members of the class @@ -61,6 +63,8 @@ def __init__(self, self.use_site_exchange_rate = use_site_exchange_rate # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -78,7 +82,7 @@ def from_dictionary(cls, """ - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -86,11 +90,9 @@ def from_dictionary(cls, 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 - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, use_site_exchange_rate, - dictionary) + additional_properties) diff --git a/advancedbilling/models/list_products_include.py b/advancedbilling/models/list_products_include.py index 10c77d7c..897731f0 100644 --- a/advancedbilling/models/list_products_include.py +++ b/advancedbilling/models/list_products_include.py @@ -16,6 +16,8 @@ class ListProductsInclude(object): Attributes: PREPAID_PRODUCT_PRICE_POINT: TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ PREPAID_PRODUCT_PRICE_POINT = 'prepaid_product_price_point' diff --git a/advancedbilling/models/list_products_price_points_include.py b/advancedbilling/models/list_products_price_points_include.py index fb23d197..affd9709 100644 --- a/advancedbilling/models/list_products_price_points_include.py +++ b/advancedbilling/models/list_products_price_points_include.py @@ -16,6 +16,8 @@ class ListProductsPricePointsInclude(object): Attributes: CURRENCY_PRICES: TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ CURRENCY_PRICES = 'currency_prices' diff --git a/advancedbilling/models/list_proforma_invoices_meta.py b/advancedbilling/models/list_proforma_invoices_meta.py index 9e786b05..6de2099b 100644 --- a/advancedbilling/models/list_proforma_invoices_meta.py +++ b/advancedbilling/models/list_proforma_invoices_meta.py @@ -20,6 +20,8 @@ class ListProformaInvoicesMeta(object): current_page (int): TODO: type description here. total_pages (int): TODO: type description here. status_code (int): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -43,7 +45,7 @@ def __init__(self, current_page=APIHelper.SKIP, total_pages=APIHelper.SKIP, status_code=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the ListProformaInvoicesMeta class""" # Initialize members of the class @@ -57,6 +59,8 @@ def __init__(self, self.status_code = status_code # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -74,7 +78,7 @@ def from_dictionary(cls, """ - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -83,12 +87,10 @@ def from_dictionary(cls, 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 - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, total_pages, status_code, - dictionary) + additional_properties) diff --git a/advancedbilling/models/list_proforma_invoices_response.py b/advancedbilling/models/list_proforma_invoices_response.py index bde08f60..13d7b1d5 100644 --- a/advancedbilling/models/list_proforma_invoices_response.py +++ b/advancedbilling/models/list_proforma_invoices_response.py @@ -20,6 +20,8 @@ class ListProformaInvoicesResponse(object): Attributes: proforma_invoices (List[ProformaInvoice]): TODO: type description here. meta (ListProformaInvoicesMeta): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -37,7 +39,7 @@ class ListProformaInvoicesResponse(object): def __init__(self, proforma_invoices=APIHelper.SKIP, meta=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the ListProformaInvoicesResponse class""" # Initialize members of the class @@ -47,6 +49,8 @@ def __init__(self, self.meta = meta # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -64,7 +68,7 @@ def from_dictionary(cls, """ - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -75,10 +79,8 @@ def from_dictionary(cls, proforma_invoices = APIHelper.SKIP meta = ListProformaInvoicesMeta.from_dictionary(dictionary.get('meta')) if 'meta' in dictionary.keys() else APIHelper.SKIP # Clean out expected properties from dictionary - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, - dictionary) + additional_properties) diff --git a/advancedbilling/models/list_public_keys_meta.py b/advancedbilling/models/list_public_keys_meta.py index 6f9032d9..27707d5f 100644 --- a/advancedbilling/models/list_public_keys_meta.py +++ b/advancedbilling/models/list_public_keys_meta.py @@ -20,6 +20,8 @@ class ListPublicKeysMeta(object): current_page (int): TODO: type description here. total_pages (int): TODO: type description here. per_page (int): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -43,7 +45,7 @@ def __init__(self, current_page=APIHelper.SKIP, total_pages=APIHelper.SKIP, per_page=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the ListPublicKeysMeta class""" # Initialize members of the class @@ -57,6 +59,8 @@ def __init__(self, self.per_page = per_page # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -74,7 +78,7 @@ def from_dictionary(cls, """ - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -83,12 +87,10 @@ def from_dictionary(cls, 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 - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, total_pages, per_page, - dictionary) + additional_properties) diff --git a/advancedbilling/models/list_public_keys_response.py b/advancedbilling/models/list_public_keys_response.py index e4f2b81e..5f139613 100644 --- a/advancedbilling/models/list_public_keys_response.py +++ b/advancedbilling/models/list_public_keys_response.py @@ -20,6 +20,8 @@ class ListPublicKeysResponse(object): Attributes: chargify_js_keys (List[PublicKey]): TODO: type description here. meta (ListPublicKeysMeta): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -37,7 +39,7 @@ class ListPublicKeysResponse(object): def __init__(self, chargify_js_keys=APIHelper.SKIP, meta=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the ListPublicKeysResponse class""" # Initialize members of the class @@ -47,6 +49,8 @@ def __init__(self, self.meta = meta # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -64,7 +68,7 @@ def from_dictionary(cls, """ - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -75,10 +79,8 @@ def from_dictionary(cls, chargify_js_keys = APIHelper.SKIP meta = ListPublicKeysMeta.from_dictionary(dictionary.get('meta')) if 'meta' in dictionary.keys() else APIHelper.SKIP # Clean out expected properties from dictionary - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, - dictionary) + additional_properties) diff --git a/advancedbilling/models/list_sale_rep_item.py b/advancedbilling/models/list_sale_rep_item.py index f5207547..f9718fbf 100644 --- a/advancedbilling/models/list_sale_rep_item.py +++ b/advancedbilling/models/list_sale_rep_item.py @@ -22,6 +22,8 @@ class ListSaleRepItem(object): subscriptions_count (int): TODO: type description here. mrr_data (Dict[str, SaleRepItemMrr]): TODO: type description here. test_mode (bool): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -48,7 +50,7 @@ def __init__(self, subscriptions_count=APIHelper.SKIP, mrr_data=APIHelper.SKIP, test_mode=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the ListSaleRepItem class""" # Initialize members of the class @@ -64,6 +66,8 @@ def __init__(self, self.test_mode = test_mode # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -81,7 +85,7 @@ def from_dictionary(cls, """ - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -91,13 +95,11 @@ def from_dictionary(cls, 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 - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, subscriptions_count, mrr_data, test_mode, - dictionary) + additional_properties) diff --git a/advancedbilling/models/list_segments_filter.py b/advancedbilling/models/list_segments_filter.py index 0e905a71..dc873ac3 100644 --- a/advancedbilling/models/list_segments_filter.py +++ b/advancedbilling/models/list_segments_filter.py @@ -32,6 +32,8 @@ class ListSegmentsFilter(object): 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. """ @@ -55,7 +57,7 @@ def __init__(self, segment_property_2_value=APIHelper.SKIP, segment_property_3_value=APIHelper.SKIP, segment_property_4_value=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the ListSegmentsFilter class""" # Initialize members of the class @@ -69,6 +71,8 @@ def __init__(self, self.segment_property_4_value = segment_property_4_value # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -86,7 +90,7 @@ def from_dictionary(cls, """ - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -95,12 +99,10 @@ def from_dictionary(cls, 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 - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, segment_property_3_value, segment_property_4_value, - dictionary) + additional_properties) diff --git a/advancedbilling/models/list_segments_response.py b/advancedbilling/models/list_segments_response.py index 1e4dad69..c75fa24a 100644 --- a/advancedbilling/models/list_segments_response.py +++ b/advancedbilling/models/list_segments_response.py @@ -18,6 +18,8 @@ class ListSegmentsResponse(object): Attributes: segments (List[Segment]): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -32,7 +34,7 @@ class ListSegmentsResponse(object): def __init__(self, segments=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the ListSegmentsResponse class""" # Initialize members of the class @@ -40,6 +42,8 @@ def __init__(self, self.segments = segments # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -57,7 +61,7 @@ def from_dictionary(cls, """ - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -67,9 +71,7 @@ def from_dictionary(cls, else: segments = APIHelper.SKIP # Clean out expected properties from dictionary - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, - dictionary) + additional_properties) diff --git a/advancedbilling/models/list_subcription_group_prepayment_item.py b/advancedbilling/models/list_subcription_group_prepayment_item.py index 70f8299c..bcb5230a 100644 --- a/advancedbilling/models/list_subcription_group_prepayment_item.py +++ b/advancedbilling/models/list_subcription_group_prepayment_item.py @@ -25,6 +25,8 @@ class ListSubcriptionGroupPrepaymentItem(object): memo (str): TODO: type description here. payment_type (PrepaymentMethod): TODO: type description here. created_at (datetime): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -63,7 +65,7 @@ def __init__(self, memo=APIHelper.SKIP, payment_type=APIHelper.SKIP, created_at=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the ListSubcriptionGroupPrepaymentItem class""" # Initialize members of the class @@ -87,6 +89,8 @@ def __init__(self, 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 @@ -104,7 +108,7 @@ def from_dictionary(cls, """ - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -118,9 +122,7 @@ def from_dictionary(cls, 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 - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, @@ -131,4 +133,4 @@ def from_dictionary(cls, memo, payment_type, created_at, - dictionary) + additional_properties) diff --git a/advancedbilling/models/list_subscription_components_filter.py b/advancedbilling/models/list_subscription_components_filter.py index 04c1b52e..d0ebce00 100644 --- a/advancedbilling/models/list_subscription_components_filter.py +++ b/advancedbilling/models/list_subscription_components_filter.py @@ -22,6 +22,8 @@ class ListSubscriptionComponentsFilter(object): 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. """ @@ -39,7 +41,7 @@ class ListSubscriptionComponentsFilter(object): def __init__(self, currencies=APIHelper.SKIP, use_site_exchange_rate=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the ListSubscriptionComponentsFilter class""" # Initialize members of the class @@ -49,6 +51,8 @@ def __init__(self, self.use_site_exchange_rate = use_site_exchange_rate # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -66,17 +70,15 @@ def from_dictionary(cls, """ - if dictionary is None: + 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 # Clean out expected properties from dictionary - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, - dictionary) + additional_properties) diff --git a/advancedbilling/models/list_subscription_components_for_site_filter.py b/advancedbilling/models/list_subscription_components_for_site_filter.py index 5e095813..38277ca7 100644 --- a/advancedbilling/models/list_subscription_components_for_site_filter.py +++ b/advancedbilling/models/list_subscription_components_for_site_filter.py @@ -25,6 +25,8 @@ class ListSubscriptionComponentsForSiteFilter(object): 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. """ @@ -45,7 +47,7 @@ def __init__(self, currencies=APIHelper.SKIP, use_site_exchange_rate=APIHelper.SKIP, subscription=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the ListSubscriptionComponentsForSiteFilter class""" # Initialize members of the class @@ -57,6 +59,8 @@ def __init__(self, self.subscription = subscription # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -74,7 +78,7 @@ def from_dictionary(cls, """ - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -82,11 +86,9 @@ def from_dictionary(cls, 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 - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, subscription, - dictionary) + additional_properties) diff --git a/advancedbilling/models/list_subscription_components_include.py b/advancedbilling/models/list_subscription_components_include.py index c9e4129c..3753eee5 100644 --- a/advancedbilling/models/list_subscription_components_include.py +++ b/advancedbilling/models/list_subscription_components_include.py @@ -17,6 +17,8 @@ class ListSubscriptionComponentsInclude(object): Attributes: SUBSCRIPTION: TODO: type description here. HISTORIC_USAGES: TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ SUBSCRIPTION = 'subscription' diff --git a/advancedbilling/models/list_subscription_components_response.py b/advancedbilling/models/list_subscription_components_response.py index 1b76c1fe..468c4035 100644 --- a/advancedbilling/models/list_subscription_components_response.py +++ b/advancedbilling/models/list_subscription_components_response.py @@ -18,6 +18,8 @@ class ListSubscriptionComponentsResponse(object): Attributes: subscriptions_components (List[SubscriptionComponent]): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -28,13 +30,15 @@ class ListSubscriptionComponentsResponse(object): def __init__(self, subscriptions_components=None, - additional_properties={}): + additional_properties=None): """Constructor for the ListSubscriptionComponentsResponse class""" # Initialize members of the class self.subscriptions_components = subscriptions_components # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -52,7 +56,7 @@ def from_dictionary(cls, """ - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -60,9 +64,7 @@ def from_dictionary(cls, 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 - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, - dictionary) + additional_properties) diff --git a/advancedbilling/models/list_subscription_components_sort.py b/advancedbilling/models/list_subscription_components_sort.py index 6cefc3f3..b621ecf3 100644 --- a/advancedbilling/models/list_subscription_components_sort.py +++ b/advancedbilling/models/list_subscription_components_sort.py @@ -17,6 +17,8 @@ class ListSubscriptionComponentsSort(object): Attributes: ID: TODO: type description here. UPDATED_AT: TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ ID = 'id' diff --git a/advancedbilling/models/list_subscription_group_prepayment.py b/advancedbilling/models/list_subscription_group_prepayment.py index c26983ee..0be4c9f9 100644 --- a/advancedbilling/models/list_subscription_group_prepayment.py +++ b/advancedbilling/models/list_subscription_group_prepayment.py @@ -18,6 +18,8 @@ class ListSubscriptionGroupPrepayment(object): Attributes: prepayment (ListSubcriptionGroupPrepaymentItem): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -28,13 +30,15 @@ class ListSubscriptionGroupPrepayment(object): def __init__(self, prepayment=None, - additional_properties={}): + additional_properties=None): """Constructor for the ListSubscriptionGroupPrepayment class""" # Initialize members of the class self.prepayment = prepayment # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -52,15 +56,13 @@ def from_dictionary(cls, """ - if dictionary is None: + 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 # Clean out expected properties from dictionary - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, - dictionary) + additional_properties) diff --git a/advancedbilling/models/list_subscription_group_prepayment_response.py b/advancedbilling/models/list_subscription_group_prepayment_response.py index 9fb523e7..0965f2ac 100644 --- a/advancedbilling/models/list_subscription_group_prepayment_response.py +++ b/advancedbilling/models/list_subscription_group_prepayment_response.py @@ -18,6 +18,8 @@ class ListSubscriptionGroupPrepaymentResponse(object): Attributes: prepayments (List[ListSubscriptionGroupPrepayment]): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -28,13 +30,15 @@ class ListSubscriptionGroupPrepaymentResponse(object): def __init__(self, prepayments=None, - additional_properties={}): + additional_properties=None): """Constructor for the ListSubscriptionGroupPrepaymentResponse class""" # Initialize members of the class self.prepayments = prepayments # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -52,7 +56,7 @@ def from_dictionary(cls, """ - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -60,9 +64,7 @@ def from_dictionary(cls, if dictionary.get('prepayments') is not None: prepayments = [ListSubscriptionGroupPrepayment.from_dictionary(x) for x in dictionary.get('prepayments')] # Clean out expected properties from dictionary - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, - dictionary) + additional_properties) diff --git a/advancedbilling/models/list_subscription_groups_item.py b/advancedbilling/models/list_subscription_groups_item.py index c98142f5..572b9348 100644 --- a/advancedbilling/models/list_subscription_groups_item.py +++ b/advancedbilling/models/list_subscription_groups_item.py @@ -29,6 +29,8 @@ class ListSubscriptionGroupsItem(object): account_balances (SubscriptionGroupBalances): TODO: type description here. group_type (GroupType): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -73,7 +75,7 @@ def __init__(self, cancel_at_end_of_period=APIHelper.SKIP, account_balances=APIHelper.SKIP, group_type=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the ListSubscriptionGroupsItem class""" # Initialize members of the class @@ -101,6 +103,8 @@ def __init__(self, self.group_type = group_type # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -118,7 +122,7 @@ def from_dictionary(cls, """ - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -134,9 +138,7 @@ def from_dictionary(cls, 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 - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, @@ -149,4 +151,4 @@ def from_dictionary(cls, cancel_at_end_of_period, account_balances, group_type, - dictionary) + additional_properties) diff --git a/advancedbilling/models/list_subscription_groups_meta.py b/advancedbilling/models/list_subscription_groups_meta.py index 42eef34c..93d78a33 100644 --- a/advancedbilling/models/list_subscription_groups_meta.py +++ b/advancedbilling/models/list_subscription_groups_meta.py @@ -18,6 +18,8 @@ class ListSubscriptionGroupsMeta(object): Attributes: current_page (int): TODO: type description here. total_count (int): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -35,7 +37,7 @@ class ListSubscriptionGroupsMeta(object): def __init__(self, current_page=APIHelper.SKIP, total_count=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the ListSubscriptionGroupsMeta class""" # Initialize members of the class @@ -45,6 +47,8 @@ def __init__(self, self.total_count = total_count # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -62,17 +66,15 @@ def from_dictionary(cls, """ - if dictionary is None: + 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 # Clean out expected properties from dictionary - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, - dictionary) + additional_properties) diff --git a/advancedbilling/models/list_subscription_groups_response.py b/advancedbilling/models/list_subscription_groups_response.py index f32ef6d1..5dae10d5 100644 --- a/advancedbilling/models/list_subscription_groups_response.py +++ b/advancedbilling/models/list_subscription_groups_response.py @@ -21,6 +21,8 @@ class ListSubscriptionGroupsResponse(object): subscription_groups (List[ListSubscriptionGroupsItem]): TODO: type description here. meta (ListSubscriptionGroupsMeta): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -38,7 +40,7 @@ class ListSubscriptionGroupsResponse(object): def __init__(self, subscription_groups=APIHelper.SKIP, meta=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the ListSubscriptionGroupsResponse class""" # Initialize members of the class @@ -48,6 +50,8 @@ def __init__(self, self.meta = meta # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -65,7 +69,7 @@ def from_dictionary(cls, """ - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -76,10 +80,8 @@ def from_dictionary(cls, subscription_groups = APIHelper.SKIP meta = ListSubscriptionGroupsMeta.from_dictionary(dictionary.get('meta')) if 'meta' in dictionary.keys() else APIHelper.SKIP # Clean out expected properties from dictionary - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, - dictionary) + additional_properties) diff --git a/advancedbilling/models/metadata.py b/advancedbilling/models/metadata.py index 07e0cbeb..a73eec32 100644 --- a/advancedbilling/models/metadata.py +++ b/advancedbilling/models/metadata.py @@ -22,6 +22,8 @@ class Metadata(object): name (str): TODO: type description here. deleted_at (datetime): TODO: type description here. metafield_id (int): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -59,7 +61,7 @@ def __init__(self, name=APIHelper.SKIP, deleted_at=APIHelper.SKIP, metafield_id=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the Metadata class""" # Initialize members of the class @@ -77,6 +79,8 @@ def __init__(self, self.metafield_id = metafield_id # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -94,7 +98,7 @@ def from_dictionary(cls, """ - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -108,9 +112,7 @@ def from_dictionary(cls, deleted_at = APIHelper.SKIP metafield_id = dictionary.get("metafield_id") if "metafield_id" in dictionary.keys() else APIHelper.SKIP # Clean out expected properties from dictionary - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, @@ -118,4 +120,4 @@ def from_dictionary(cls, name, deleted_at, metafield_id, - dictionary) + additional_properties) diff --git a/advancedbilling/models/metafield.py b/advancedbilling/models/metafield.py index 587d8e5d..1bf8c035 100644 --- a/advancedbilling/models/metafield.py +++ b/advancedbilling/models/metafield.py @@ -31,6 +31,8 @@ class Metafield(object): input, and appear differently on a Public Signup Page. Defaults to 'text' enum (str | List[str] | None): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -64,7 +66,7 @@ def __init__(self, data_count=APIHelper.SKIP, input_type=APIHelper.SKIP, enum=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the Metafield class""" # Initialize members of the class @@ -82,6 +84,8 @@ def __init__(self, self.enum = enum # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -100,7 +104,7 @@ def from_dictionary(cls, """ from advancedbilling.utilities.union_type_lookup import UnionTypeLookUp - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -114,9 +118,7 @@ def from_dictionary(cls, else: enum = APIHelper.SKIP # Clean out expected properties from dictionary - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, @@ -124,4 +126,4 @@ def from_dictionary(cls, data_count, input_type, enum, - dictionary) + additional_properties) diff --git a/advancedbilling/models/metafield_input.py b/advancedbilling/models/metafield_input.py index 1b096e2c..e4016b48 100644 --- a/advancedbilling/models/metafield_input.py +++ b/advancedbilling/models/metafield_input.py @@ -23,6 +23,8 @@ class MetafieldInput(object): TEXT: TODO: type description here. RADIO: TODO: type description here. DROPDOWN: TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ _all_values = ['balance_tracker', 'text', 'radio', 'dropdown'] diff --git a/advancedbilling/models/metafield_scope.py b/advancedbilling/models/metafield_scope.py index 4919ddd9..48d34cb6 100644 --- a/advancedbilling/models/metafield_scope.py +++ b/advancedbilling/models/metafield_scope.py @@ -31,6 +31,8 @@ class MetafieldScope(object): public_edit (IncludeOption): Include (1) or exclude (0) metafields from being edited by your ecosystem. hosted (List[str]): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -63,7 +65,7 @@ def __init__(self, public_show=APIHelper.SKIP, public_edit=APIHelper.SKIP, hosted=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the MetafieldScope class""" # Initialize members of the class @@ -83,6 +85,8 @@ def __init__(self, self.hosted = hosted # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -100,7 +104,7 @@ def from_dictionary(cls, """ - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -112,9 +116,7 @@ def from_dictionary(cls, 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 - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, @@ -123,7 +125,7 @@ def from_dictionary(cls, public_show, public_edit, hosted, - dictionary) + additional_properties) @classmethod def validate(cls, dictionary): diff --git a/advancedbilling/models/metered_component.py b/advancedbilling/models/metered_component.py index ed9d890a..ab038e7a 100644 --- a/advancedbilling/models/metered_component.py +++ b/advancedbilling/models/metered_component.py @@ -41,14 +41,6 @@ class MeteredComponent(object): 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. - 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`. - 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]): TODO: type description here. unit_price (str | float | None): The amount the customer will be @@ -64,7 +56,6 @@ class MeteredComponent(object): 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. - price_in_cents (str): deprecated May 2011 - use unit_price instead display_on_hosted_page (bool): TODO: type description here. allow_fractional_quantities (bool): TODO: type description here. public_signup_page_ids (List[int]): TODO: type description here. @@ -76,6 +67,8 @@ class MeteredComponent(object): 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. """ @@ -88,13 +81,10 @@ class MeteredComponent(object): "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', - "price_in_cents": 'price_in_cents', "display_on_hosted_page": 'display_on_hosted_page', "allow_fractional_quantities": 'allow_fractional_quantities', "public_signup_page_ids": 'public_signup_page_ids', @@ -107,13 +97,10 @@ class MeteredComponent(object): 'handle', 'taxable', 'prices', - 'upgrade_charge', - 'downgrade_credit', 'price_points', 'unit_price', 'tax_code', 'hide_date_range_on_invoice', - 'price_in_cents', 'display_on_hosted_page', 'allow_fractional_quantities', 'public_signup_page_ids', @@ -122,8 +109,6 @@ class MeteredComponent(object): ] _nullables = [ - 'upgrade_charge', - 'downgrade_credit', 'interval_unit', ] @@ -135,19 +120,16 @@ def __init__(self, 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, - price_in_cents=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={}): + additional_properties=None): """Constructor for the MeteredComponent class""" # Initialize members of the class @@ -162,10 +144,6 @@ def __init__(self, self.pricing_scheme = pricing_scheme if prices is not APIHelper.SKIP: self.prices = prices - if upgrade_charge is not APIHelper.SKIP: - self.upgrade_charge = upgrade_charge - if downgrade_credit is not APIHelper.SKIP: - self.downgrade_credit = downgrade_credit if price_points is not APIHelper.SKIP: self.price_points = price_points if unit_price is not APIHelper.SKIP: @@ -174,8 +152,6 @@ def __init__(self, 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 - if price_in_cents is not APIHelper.SKIP: - self.price_in_cents = price_in_cents if display_on_hosted_page is not APIHelper.SKIP: self.display_on_hosted_page = display_on_hosted_page if allow_fractional_quantities is not APIHelper.SKIP: @@ -188,6 +164,8 @@ def __init__(self, self.interval_unit = interval_unit # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -206,7 +184,7 @@ def from_dictionary(cls, """ from advancedbilling.utilities.union_type_lookup import UnionTypeLookUp - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -221,8 +199,6 @@ def from_dictionary(cls, 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 price_points = None if dictionary.get('price_points') is not None: price_points = [ComponentPricePointItem.from_dictionary(x) for x in dictionary.get('price_points')] @@ -231,16 +207,13 @@ def from_dictionary(cls, 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 - price_in_cents = dictionary.get("price_in_cents") if dictionary.get("price_in_cents") 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 - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, @@ -249,16 +222,13 @@ def from_dictionary(cls, handle, taxable, prices, - upgrade_charge, - downgrade_credit, price_points, unit_price, tax_code, hide_date_range_on_invoice, - price_in_cents, display_on_hosted_page, allow_fractional_quantities, public_signup_page_ids, interval, interval_unit, - dictionary) + additional_properties) diff --git a/advancedbilling/models/metered_usage.py b/advancedbilling/models/metered_usage.py index 33a109c2..58e7866c 100644 --- a/advancedbilling/models/metered_usage.py +++ b/advancedbilling/models/metered_usage.py @@ -22,6 +22,8 @@ class MeteredUsage(object): component_id (int): TODO: type description here. component_handle (str): TODO: type description here. memo (str): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -42,7 +44,7 @@ def __init__(self, component_id=None, component_handle=None, memo=None, - additional_properties={}): + additional_properties=None): """Constructor for the MeteredUsage class""" # Initialize members of the class @@ -54,6 +56,8 @@ def __init__(self, self.memo = memo # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -71,7 +75,7 @@ def from_dictionary(cls, """ - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -82,9 +86,7 @@ def from_dictionary(cls, 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 - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, @@ -92,7 +94,7 @@ def from_dictionary(cls, component_id, component_handle, memo, - dictionary) + additional_properties) @classmethod def validate(cls, dictionary): diff --git a/advancedbilling/models/movement.py b/advancedbilling/models/movement.py index 1d64b6fa..291b7610 100644 --- a/advancedbilling/models/movement.py +++ b/advancedbilling/models/movement.py @@ -27,6 +27,8 @@ class Movement(object): line_items (List[MovementLineItem]): TODO: type description here. subscription_id (int): TODO: type description here. subscriber_name (str): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -65,7 +67,7 @@ def __init__(self, line_items=APIHelper.SKIP, subscription_id=APIHelper.SKIP, subscriber_name=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the Movement class""" # Initialize members of the class @@ -89,6 +91,8 @@ def __init__(self, self.subscriber_name = subscriber_name # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -106,7 +110,7 @@ def from_dictionary(cls, """ - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -124,9 +128,7 @@ def from_dictionary(cls, 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 - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, @@ -137,4 +139,4 @@ def from_dictionary(cls, line_items, subscription_id, subscriber_name, - dictionary) + additional_properties) diff --git a/advancedbilling/models/movement_line_item.py b/advancedbilling/models/movement_line_item.py index 51cd76dc..837ccd2a 100644 --- a/advancedbilling/models/movement_line_item.py +++ b/advancedbilling/models/movement_line_item.py @@ -29,6 +29,8 @@ class MovementLineItem(object): 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. """ @@ -67,7 +69,7 @@ def __init__(self, quantity=APIHelper.SKIP, prev_quantity=APIHelper.SKIP, recurring=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the MovementLineItem class""" # Initialize members of the class @@ -91,6 +93,8 @@ def __init__(self, self.recurring = recurring # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -108,7 +112,7 @@ def from_dictionary(cls, """ - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -126,9 +130,7 @@ def from_dictionary(cls, 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 - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, @@ -139,4 +141,4 @@ def from_dictionary(cls, quantity, prev_quantity, recurring, - dictionary) + additional_properties) diff --git a/advancedbilling/models/mrr.py b/advancedbilling/models/mrr.py index c41eeefc..12387034 100644 --- a/advancedbilling/models/mrr.py +++ b/advancedbilling/models/mrr.py @@ -23,6 +23,8 @@ class MRR(object): currency_symbol (str): TODO: type description here. breakouts (Breakouts): TODO: type description here. at_time (datetime): ISO8601 timestamp + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -52,7 +54,7 @@ def __init__(self, currency_symbol=APIHelper.SKIP, breakouts=APIHelper.SKIP, at_time=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the MRR class""" # Initialize members of the class @@ -70,6 +72,8 @@ def __init__(self, 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: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -87,7 +91,7 @@ def from_dictionary(cls, """ - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -98,9 +102,7 @@ def from_dictionary(cls, 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 - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, @@ -108,4 +110,4 @@ def from_dictionary(cls, currency_symbol, breakouts, at_time, - dictionary) + additional_properties) diff --git a/advancedbilling/models/mrr_movement.py b/advancedbilling/models/mrr_movement.py index a685bdb6..e050a273 100644 --- a/advancedbilling/models/mrr_movement.py +++ b/advancedbilling/models/mrr_movement.py @@ -20,6 +20,8 @@ class MRRMovement(object): category (str): TODO: type description here. subscriber_delta (int): TODO: type description here. lead_delta (int): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -43,7 +45,7 @@ def __init__(self, category=APIHelper.SKIP, subscriber_delta=APIHelper.SKIP, lead_delta=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the MRRMovement class""" # Initialize members of the class @@ -57,6 +59,8 @@ def __init__(self, self.lead_delta = lead_delta # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -74,7 +78,7 @@ def from_dictionary(cls, """ - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -83,12 +87,10 @@ def from_dictionary(cls, 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 - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, subscriber_delta, lead_delta, - dictionary) + additional_properties) diff --git a/advancedbilling/models/mrr_response.py b/advancedbilling/models/mrr_response.py index d8e88f1c..eb73fc37 100644 --- a/advancedbilling/models/mrr_response.py +++ b/advancedbilling/models/mrr_response.py @@ -17,6 +17,8 @@ class MRRResponse(object): Attributes: mrr (MRR): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -27,13 +29,15 @@ class MRRResponse(object): def __init__(self, mrr=None, - additional_properties={}): + additional_properties=None): """Constructor for the MRRResponse class""" # Initialize members of the class self.mrr = mrr # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -51,15 +55,13 @@ def from_dictionary(cls, """ - if dictionary is None: + 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 # Clean out expected properties from dictionary - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, - dictionary) + additional_properties) diff --git a/advancedbilling/models/multi_invoice_payment.py b/advancedbilling/models/multi_invoice_payment.py index 867f4026..2521a143 100644 --- a/advancedbilling/models/multi_invoice_payment.py +++ b/advancedbilling/models/multi_invoice_payment.py @@ -23,6 +23,8 @@ class MultiInvoicePayment(object): representing the currency of invoice transaction. applications (List[InvoicePaymentApplication]): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -46,7 +48,7 @@ def __init__(self, total_amount=APIHelper.SKIP, currency_code=APIHelper.SKIP, applications=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the MultiInvoicePayment class""" # Initialize members of the class @@ -60,6 +62,8 @@ def __init__(self, self.applications = applications # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -77,7 +81,7 @@ def from_dictionary(cls, """ - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -90,12 +94,10 @@ def from_dictionary(cls, else: applications = APIHelper.SKIP # Clean out expected properties from dictionary - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, currency_code, applications, - dictionary) + additional_properties) diff --git a/advancedbilling/models/multi_invoice_payment_response.py b/advancedbilling/models/multi_invoice_payment_response.py index c9604576..42092926 100644 --- a/advancedbilling/models/multi_invoice_payment_response.py +++ b/advancedbilling/models/multi_invoice_payment_response.py @@ -17,6 +17,8 @@ class MultiInvoicePaymentResponse(object): Attributes: payment (MultiInvoicePayment): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -27,13 +29,15 @@ class MultiInvoicePaymentResponse(object): def __init__(self, payment=None, - additional_properties={}): + additional_properties=None): """Constructor for the MultiInvoicePaymentResponse class""" # Initialize members of the class self.payment = payment # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -51,15 +55,13 @@ def from_dictionary(cls, """ - if dictionary is None: + 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 # Clean out expected properties from dictionary - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, - dictionary) + additional_properties) diff --git a/advancedbilling/models/nested_subscription_group.py b/advancedbilling/models/nested_subscription_group.py index 04e37ba2..eb1c530f 100644 --- a/advancedbilling/models/nested_subscription_group.py +++ b/advancedbilling/models/nested_subscription_group.py @@ -23,6 +23,8 @@ class NestedSubscriptionGroup(object): 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. """ @@ -46,7 +48,7 @@ def __init__(self, scheme=APIHelper.SKIP, primary_subscription_id=APIHelper.SKIP, primary=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the NestedSubscriptionGroup class""" # Initialize members of the class @@ -60,6 +62,8 @@ def __init__(self, self.primary = primary # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -77,7 +81,7 @@ def from_dictionary(cls, """ - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -86,12 +90,10 @@ def from_dictionary(cls, 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 - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, primary_subscription_id, primary, - dictionary) + additional_properties) diff --git a/advancedbilling/models/net_terms.py b/advancedbilling/models/net_terms.py index 60a8a6b8..1fab976b 100644 --- a/advancedbilling/models/net_terms.py +++ b/advancedbilling/models/net_terms.py @@ -22,6 +22,8 @@ class NetTerms(object): net_terms_on_remittance_signups_enabled (bool): TODO: type description here. custom_net_terms_enabled (bool): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -48,7 +50,7 @@ def __init__(self, remittance_net_terms=0, net_terms_on_remittance_signups_enabled=False, custom_net_terms_enabled=False, - additional_properties={}): + additional_properties=None): """Constructor for the NetTerms class""" # Initialize members of the class @@ -59,6 +61,8 @@ def __init__(self, self.custom_net_terms_enabled = custom_net_terms_enabled # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -76,7 +80,7 @@ def from_dictionary(cls, """ - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -86,13 +90,11 @@ def from_dictionary(cls, 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 - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, remittance_net_terms, net_terms_on_remittance_signups_enabled, custom_net_terms_enabled, - dictionary) + additional_properties) diff --git a/advancedbilling/models/offer.py b/advancedbilling/models/offer.py index 297efebe..c7971335 100644 --- a/advancedbilling/models/offer.py +++ b/advancedbilling/models/offer.py @@ -39,6 +39,8 @@ class Offer(object): product_price_in_cents (long|int): TODO: type description here. offer_signup_pages (List[OfferSignupPage]): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -112,7 +114,7 @@ def __init__(self, product_price_point_name=APIHelper.SKIP, product_price_in_cents=APIHelper.SKIP, offer_signup_pages=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the Offer class""" # Initialize members of the class @@ -156,6 +158,8 @@ def __init__(self, self.offer_signup_pages = offer_signup_pages # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -173,7 +177,7 @@ def from_dictionary(cls, """ - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -212,9 +216,7 @@ def from_dictionary(cls, else: offer_signup_pages = APIHelper.SKIP # Clean out expected properties from dictionary - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, @@ -235,4 +237,4 @@ def from_dictionary(cls, product_price_point_name, product_price_in_cents, offer_signup_pages, - dictionary) + additional_properties) diff --git a/advancedbilling/models/offer_discount.py b/advancedbilling/models/offer_discount.py index e3fa2027..b9d87471 100644 --- a/advancedbilling/models/offer_discount.py +++ b/advancedbilling/models/offer_discount.py @@ -19,6 +19,8 @@ class OfferDiscount(object): coupon_code (str): TODO: type description here. coupon_id (int): TODO: type description here. coupon_name (str): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -39,7 +41,7 @@ def __init__(self, coupon_code=APIHelper.SKIP, coupon_id=APIHelper.SKIP, coupon_name=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the OfferDiscount class""" # Initialize members of the class @@ -51,6 +53,8 @@ def __init__(self, self.coupon_name = coupon_name # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -68,7 +72,7 @@ def from_dictionary(cls, """ - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -76,11 +80,9 @@ def from_dictionary(cls, 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 - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, coupon_name, - dictionary) + additional_properties) diff --git a/advancedbilling/models/offer_item.py b/advancedbilling/models/offer_item.py index 7bd824fd..a2ba2134 100644 --- a/advancedbilling/models/offer_item.py +++ b/advancedbilling/models/offer_item.py @@ -32,6 +32,8 @@ class OfferItem(object): 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. """ @@ -77,7 +79,7 @@ def __init__(self, currency_prices=APIHelper.SKIP, interval=APIHelper.SKIP, interval_unit=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the OfferItem class""" # Initialize members of the class @@ -103,6 +105,8 @@ def __init__(self, self.interval_unit = interval_unit # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -120,7 +124,7 @@ def from_dictionary(cls, """ - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -139,9 +143,7 @@ def from_dictionary(cls, 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 - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, @@ -153,4 +155,4 @@ def from_dictionary(cls, currency_prices, interval, interval_unit, - dictionary) + additional_properties) diff --git a/advancedbilling/models/offer_response.py b/advancedbilling/models/offer_response.py index a1b4b796..7fac0e16 100644 --- a/advancedbilling/models/offer_response.py +++ b/advancedbilling/models/offer_response.py @@ -18,6 +18,8 @@ class OfferResponse(object): Attributes: offer (Offer): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -32,7 +34,7 @@ class OfferResponse(object): def __init__(self, offer=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the OfferResponse class""" # Initialize members of the class @@ -40,6 +42,8 @@ def __init__(self, self.offer = offer # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -57,15 +61,13 @@ def from_dictionary(cls, """ - if dictionary is None: + 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 # Clean out expected properties from dictionary - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, - dictionary) + additional_properties) diff --git a/advancedbilling/models/offer_signup_page.py b/advancedbilling/models/offer_signup_page.py index 008e8b85..a42cc61a 100644 --- a/advancedbilling/models/offer_signup_page.py +++ b/advancedbilling/models/offer_signup_page.py @@ -22,6 +22,8 @@ class OfferSignupPage(object): return_url (str): TODO: type description here. return_params (str): TODO: type description here. url (str): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -51,7 +53,7 @@ def __init__(self, return_url=APIHelper.SKIP, return_params=APIHelper.SKIP, url=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the OfferSignupPage class""" # Initialize members of the class @@ -69,6 +71,8 @@ def __init__(self, self.url = url # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -86,7 +90,7 @@ def from_dictionary(cls, """ - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -97,9 +101,7 @@ def from_dictionary(cls, 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 - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, @@ -107,4 +109,4 @@ def from_dictionary(cls, return_url, return_params, url, - dictionary) + additional_properties) diff --git a/advancedbilling/models/reason_codes_json_response.py b/advancedbilling/models/ok_response.py similarity index 72% rename from advancedbilling/models/reason_codes_json_response.py rename to advancedbilling/models/ok_response.py index 0b3bdd1c..1aba942c 100644 --- a/advancedbilling/models/reason_codes_json_response.py +++ b/advancedbilling/models/ok_response.py @@ -9,14 +9,16 @@ from advancedbilling.api_helper import APIHelper -class ReasonCodesJsonResponse(object): +class OkResponse(object): - """Implementation of the 'Reason Codes Json Response' model. + """Implementation of the 'Ok Response' model. TODO: type model description here. Attributes: ok (str): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -31,14 +33,16 @@ class ReasonCodesJsonResponse(object): def __init__(self, ok=APIHelper.SKIP, - additional_properties={}): - """Constructor for the ReasonCodesJsonResponse class""" + additional_properties=None): + """Constructor for the OkResponse class""" # Initialize members of the class if ok is not APIHelper.SKIP: self.ok = ok # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -56,15 +60,13 @@ def from_dictionary(cls, """ - if dictionary is None: + 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 # Clean out expected properties from dictionary - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, - dictionary) + additional_properties) diff --git a/advancedbilling/models/on_off_component.py b/advancedbilling/models/on_off_component.py index 3a6a7965..b1908e06 100644 --- a/advancedbilling/models/on_off_component.py +++ b/advancedbilling/models/on_off_component.py @@ -8,7 +8,6 @@ """ from advancedbilling.api_helper import APIHelper from advancedbilling.models.component_price_point_item import ComponentPricePointItem -from advancedbilling.models.price import Price class OnOffComponent(object): @@ -28,11 +27,6 @@ class OnOffComponent(object): or the characters '.', ':', '-', or '_'. taxable (bool): Boolean flag describing whether a component is taxable or not. - 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/24261191737101-P - rice-Points-Components) 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`, @@ -43,11 +37,9 @@ class OnOffComponent(object): `prorated`, `none`. price_points (List[ComponentPricePointItem]): TODO: type description here. - 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 + 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 the @@ -56,7 +48,6 @@ class OnOffComponent(object): 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. - price_in_cents (str): deprecated May 2011 - use unit_price instead display_on_hosted_page (bool): TODO: type description here. allow_fractional_quantities (bool): TODO: type description here. public_signup_page_ids (List[int]): TODO: type description here. @@ -68,23 +59,23 @@ class OnOffComponent(object): 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', - "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', - "price_in_cents": 'price_in_cents', "display_on_hosted_page": 'display_on_hosted_page', "allow_fractional_quantities": 'allow_fractional_quantities', "public_signup_page_ids": 'public_signup_page_ids', @@ -96,14 +87,11 @@ class OnOffComponent(object): 'description', 'handle', 'taxable', - 'prices', 'upgrade_charge', 'downgrade_credit', 'price_points', - 'unit_price', 'tax_code', 'hide_date_range_on_invoice', - 'price_in_cents', 'display_on_hosted_page', 'allow_fractional_quantities', 'public_signup_page_ids', @@ -119,23 +107,21 @@ class OnOffComponent(object): def __init__(self, name=None, + unit_price=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, - price_in_cents=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={}): + additional_properties=None): """Constructor for the OnOffComponent class""" # Initialize members of the class @@ -146,22 +132,17 @@ def __init__(self, self.handle = handle if taxable is not APIHelper.SKIP: self.taxable = taxable - if prices is not APIHelper.SKIP: - self.prices = prices if upgrade_charge is not APIHelper.SKIP: self.upgrade_charge = upgrade_charge if downgrade_credit is not APIHelper.SKIP: self.downgrade_credit = downgrade_credit if price_points is not APIHelper.SKIP: 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 if hide_date_range_on_invoice is not APIHelper.SKIP: self.hide_date_range_on_invoice = hide_date_range_on_invoice - if price_in_cents is not APIHelper.SKIP: - self.price_in_cents = price_in_cents if display_on_hosted_page is not APIHelper.SKIP: self.display_on_hosted_page = display_on_hosted_page if allow_fractional_quantities is not APIHelper.SKIP: @@ -174,6 +155,8 @@ def __init__(self, self.interval_unit = interval_unit # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -192,19 +175,15 @@ def from_dictionary(cls, """ from advancedbilling.utilities.union_type_lookup import UnionTypeLookUp - if dictionary is None: + 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 - prices = None - 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 price_points = None @@ -212,35 +191,56 @@ def from_dictionary(cls, 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('OnOffComponentUnitPrice'), 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 - price_in_cents = dictionary.get("price_in_cents") if dictionary.get("price_in_cents") 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 - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, description, handle, taxable, - prices, upgrade_charge, downgrade_credit, price_points, - unit_price, tax_code, hide_date_range_on_invoice, - price_in_cents, display_on_hosted_page, allow_fractional_quantities, public_signup_page_ids, interval, interval_unit, - dictionary) + additional_properties) + + @classmethod + def validate(cls, dictionary): + """Validates 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 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 diff --git a/advancedbilling/models/organization_address.py b/advancedbilling/models/organization_address.py index bfa87ac8..24bf3b97 100644 --- a/advancedbilling/models/organization_address.py +++ b/advancedbilling/models/organization_address.py @@ -24,6 +24,8 @@ class OrganizationAddress(object): country (str): TODO: type description here. name (str): TODO: type description here. phone (str): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -70,7 +72,7 @@ def __init__(self, country=APIHelper.SKIP, name=APIHelper.SKIP, phone=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the OrganizationAddress class""" # Initialize members of the class @@ -92,6 +94,8 @@ def __init__(self, self.phone = phone # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -109,7 +113,7 @@ def from_dictionary(cls, """ - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -122,9 +126,7 @@ def from_dictionary(cls, 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 - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, @@ -134,4 +136,4 @@ def from_dictionary(cls, country, name, phone, - dictionary) + additional_properties) diff --git a/advancedbilling/models/origin_invoice.py b/advancedbilling/models/origin_invoice.py index 1bef10e7..644c2d79 100644 --- a/advancedbilling/models/origin_invoice.py +++ b/advancedbilling/models/origin_invoice.py @@ -18,6 +18,8 @@ class OriginInvoice(object): 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. """ @@ -35,7 +37,7 @@ class OriginInvoice(object): def __init__(self, uid=APIHelper.SKIP, number=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the OriginInvoice class""" # Initialize members of the class @@ -45,6 +47,8 @@ def __init__(self, self.number = number # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -62,20 +66,18 @@ def from_dictionary(cls, """ - if dictionary is None: + 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 # Clean out expected properties from dictionary - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, - dictionary) + additional_properties) @classmethod def validate(cls, dictionary): diff --git a/advancedbilling/models/overage_pricing.py b/advancedbilling/models/overage_pricing.py index 294e97ff..4b236b2d 100644 --- a/advancedbilling/models/overage_pricing.py +++ b/advancedbilling/models/overage_pricing.py @@ -23,6 +23,8 @@ class OveragePricing(object): Components](https://help.chargify.com/products/product-components.h tml) for an overview of pricing schemes. prices (List[Price]): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -39,7 +41,7 @@ class OveragePricing(object): def __init__(self, pricing_scheme=None, prices=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the OveragePricing class""" # Initialize members of the class @@ -48,6 +50,8 @@ def __init__(self, self.prices = prices # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -65,7 +69,7 @@ def from_dictionary(cls, """ - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -76,13 +80,11 @@ def from_dictionary(cls, else: prices = APIHelper.SKIP # Clean out expected properties from dictionary - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, - dictionary) + additional_properties) @classmethod def validate(cls, dictionary): diff --git a/advancedbilling/models/override_subscription.py b/advancedbilling/models/override_subscription.py index 021a98c5..426d5bdd 100644 --- a/advancedbilling/models/override_subscription.py +++ b/advancedbilling/models/override_subscription.py @@ -36,6 +36,8 @@ class OverrideSubscription(object): 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. """ @@ -62,7 +64,7 @@ def __init__(self, cancellation_message=APIHelper.SKIP, expires_at=APIHelper.SKIP, current_period_starts_at=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the OverrideSubscription class""" # Initialize members of the class @@ -78,6 +80,8 @@ def __init__(self, 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: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -95,7 +99,7 @@ def from_dictionary(cls, """ - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -105,13 +109,11 @@ def from_dictionary(cls, 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 - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, cancellation_message, expires_at, current_period_starts_at, - dictionary) + additional_properties) diff --git a/advancedbilling/models/override_subscription_request.py b/advancedbilling/models/override_subscription_request.py index 77a7f45a..b2e40cbe 100644 --- a/advancedbilling/models/override_subscription_request.py +++ b/advancedbilling/models/override_subscription_request.py @@ -17,6 +17,8 @@ class OverrideSubscriptionRequest(object): Attributes: subscription (OverrideSubscription): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -27,13 +29,15 @@ class OverrideSubscriptionRequest(object): def __init__(self, subscription=None, - additional_properties={}): + additional_properties=None): """Constructor for the OverrideSubscriptionRequest class""" # Initialize members of the class self.subscription = subscription # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -51,15 +55,13 @@ def from_dictionary(cls, """ - if dictionary is None: + 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 # Clean out expected properties from dictionary - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, - dictionary) + additional_properties) diff --git a/advancedbilling/models/paginated_metadata.py b/advancedbilling/models/paginated_metadata.py index 1530f753..827deda9 100644 --- a/advancedbilling/models/paginated_metadata.py +++ b/advancedbilling/models/paginated_metadata.py @@ -22,6 +22,8 @@ class PaginatedMetadata(object): total_pages (int): TODO: type description here. per_page (int): TODO: type description here. metadata (List[Metadata]): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -48,7 +50,7 @@ def __init__(self, total_pages=APIHelper.SKIP, per_page=APIHelper.SKIP, metadata=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the PaginatedMetadata class""" # Initialize members of the class @@ -64,6 +66,8 @@ def __init__(self, self.metadata = metadata # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -81,7 +85,7 @@ def from_dictionary(cls, """ - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -95,13 +99,11 @@ def from_dictionary(cls, else: metadata = APIHelper.SKIP # Clean out expected properties from dictionary - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, total_pages, per_page, metadata, - dictionary) + additional_properties) diff --git a/advancedbilling/models/paid_invoice.py b/advancedbilling/models/paid_invoice.py index 4350384c..ebdea2b7 100644 --- a/advancedbilling/models/paid_invoice.py +++ b/advancedbilling/models/paid_invoice.py @@ -24,6 +24,8 @@ class PaidInvoice(object): 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. """ @@ -47,7 +49,7 @@ def __init__(self, status=APIHelper.SKIP, due_amount=APIHelper.SKIP, paid_amount=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the PaidInvoice class""" # Initialize members of the class @@ -61,6 +63,8 @@ def __init__(self, self.paid_amount = paid_amount # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -78,7 +82,7 @@ def from_dictionary(cls, """ - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -87,12 +91,10 @@ def from_dictionary(cls, 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 - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, due_amount, paid_amount, - dictionary) + additional_properties) diff --git a/advancedbilling/models/pause_request.py b/advancedbilling/models/pause_request.py index 914880eb..c19a2211 100644 --- a/advancedbilling/models/pause_request.py +++ b/advancedbilling/models/pause_request.py @@ -18,6 +18,8 @@ class PauseRequest(object): Attributes: hold (AutoResume): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -32,7 +34,7 @@ class PauseRequest(object): def __init__(self, hold=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the PauseRequest class""" # Initialize members of the class @@ -40,6 +42,8 @@ def __init__(self, self.hold = hold # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -57,15 +61,13 @@ def from_dictionary(cls, """ - if dictionary is None: + 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 # Clean out expected properties from dictionary - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, - dictionary) + additional_properties) diff --git a/advancedbilling/models/pay_pal_vault.py b/advancedbilling/models/pay_pal_vault.py index 34cf56be..c367c08f 100644 --- a/advancedbilling/models/pay_pal_vault.py +++ b/advancedbilling/models/pay_pal_vault.py @@ -19,6 +19,8 @@ class PayPalVault(object): PAYPAL: TODO: type description here. MODUSLINK: TODO: type description here. PAYPAL_COMPLETE: TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ _all_values = ['braintree_blue', 'paypal', 'moduslink', 'paypal_complete'] diff --git a/advancedbilling/models/payer_attributes.py b/advancedbilling/models/payer_attributes.py index 82f09a34..1b6ccbf3 100644 --- a/advancedbilling/models/payer_attributes.py +++ b/advancedbilling/models/payer_attributes.py @@ -37,6 +37,8 @@ class PayerAttributes(object): 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. """ @@ -102,7 +104,7 @@ def __init__(self, tax_exempt=APIHelper.SKIP, tax_exempt_reason=APIHelper.SKIP, metafields=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the PayerAttributes class""" # Initialize members of the class @@ -144,6 +146,8 @@ def __init__(self, self.metafields = metafields # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -161,7 +165,7 @@ def from_dictionary(cls, """ - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -184,9 +188,7 @@ def from_dictionary(cls, 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 - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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,7 +208,7 @@ def from_dictionary(cls, tax_exempt, tax_exempt_reason, metafields, - dictionary) + additional_properties) @classmethod def validate(cls, dictionary): diff --git a/advancedbilling/models/payer_error.py b/advancedbilling/models/payer_error.py index 6ab17460..f193a748 100644 --- a/advancedbilling/models/payer_error.py +++ b/advancedbilling/models/payer_error.py @@ -19,6 +19,8 @@ class PayerError(object): last_name (List[str]): TODO: type description here. first_name (List[str]): TODO: type description here. email (List[str]): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -39,7 +41,7 @@ def __init__(self, last_name=APIHelper.SKIP, first_name=APIHelper.SKIP, email=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the PayerError class""" # Initialize members of the class @@ -51,6 +53,8 @@ def __init__(self, self.email = email # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -68,7 +72,7 @@ def from_dictionary(cls, """ - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -76,11 +80,9 @@ def from_dictionary(cls, 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 - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, email, - dictionary) + additional_properties) diff --git a/advancedbilling/models/payment_collection_method_changed.py b/advancedbilling/models/payment_collection_method_changed.py index c57163df..fe4548a7 100644 --- a/advancedbilling/models/payment_collection_method_changed.py +++ b/advancedbilling/models/payment_collection_method_changed.py @@ -18,6 +18,8 @@ class PaymentCollectionMethodChanged(object): Attributes: previous_value (str): TODO: type description here. current_value (str): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -30,7 +32,7 @@ class PaymentCollectionMethodChanged(object): def __init__(self, previous_value=None, current_value=None, - additional_properties={}): + additional_properties=None): """Constructor for the PaymentCollectionMethodChanged class""" # Initialize members of the class @@ -38,6 +40,8 @@ def __init__(self, self.current_value = current_value # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -55,20 +59,18 @@ def from_dictionary(cls, """ - if dictionary is None: + 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 # Clean out expected properties from dictionary - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, - dictionary) + additional_properties) @classmethod def validate(cls, dictionary): diff --git a/advancedbilling/models/payment_for_allocation.py b/advancedbilling/models/payment_for_allocation.py index 2e9a5ee7..923e59dc 100644 --- a/advancedbilling/models/payment_for_allocation.py +++ b/advancedbilling/models/payment_for_allocation.py @@ -20,6 +20,8 @@ class PaymentForAllocation(object): amount_in_cents (long|int): TODO: type description here. success (bool): TODO: type description here. memo (str): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -43,7 +45,7 @@ def __init__(self, amount_in_cents=APIHelper.SKIP, success=APIHelper.SKIP, memo=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the PaymentForAllocation class""" # Initialize members of the class @@ -57,6 +59,8 @@ def __init__(self, self.memo = memo # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -74,7 +78,7 @@ def from_dictionary(cls, """ - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -83,15 +87,13 @@ def from_dictionary(cls, 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 - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, success, memo, - dictionary) + additional_properties) @classmethod def validate(cls, dictionary): diff --git a/advancedbilling/models/payment_method_apple_pay.py b/advancedbilling/models/payment_method_apple_pay.py index 0129d1d2..b7f43c89 100644 --- a/advancedbilling/models/payment_method_apple_pay.py +++ b/advancedbilling/models/payment_method_apple_pay.py @@ -18,6 +18,8 @@ class PaymentMethodApplePay(object): Attributes: mtype (InvoiceEventPaymentMethod): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -28,13 +30,15 @@ class PaymentMethodApplePay(object): def __init__(self, mtype=None, - additional_properties={}): + additional_properties=None): """Constructor for the PaymentMethodApplePay class""" # Initialize members of the class self.mtype = mtype # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -52,18 +56,16 @@ def from_dictionary(cls, """ - if dictionary is None: + 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 # Clean out expected properties from dictionary - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, - dictionary) + additional_properties) @classmethod def validate(cls, dictionary): diff --git a/advancedbilling/models/payment_method_bank_account.py b/advancedbilling/models/payment_method_bank_account.py index 39accbd4..1bdba94c 100644 --- a/advancedbilling/models/payment_method_bank_account.py +++ b/advancedbilling/models/payment_method_bank_account.py @@ -20,6 +20,8 @@ class PaymentMethodBankAccount(object): masked_account_number (str): TODO: type description here. masked_routing_number (str): TODO: type description here. mtype (InvoiceEventPaymentMethod): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -34,7 +36,7 @@ def __init__(self, masked_account_number=None, masked_routing_number=None, mtype=None, - additional_properties={}): + additional_properties=None): """Constructor for the PaymentMethodBankAccount class""" # Initialize members of the class @@ -43,6 +45,8 @@ def __init__(self, self.mtype = mtype # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -60,7 +64,7 @@ def from_dictionary(cls, """ - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -68,14 +72,12 @@ def from_dictionary(cls, 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 - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, mtype, - dictionary) + additional_properties) @classmethod def validate(cls, dictionary): diff --git a/advancedbilling/models/payment_method_credit_card.py b/advancedbilling/models/payment_method_credit_card.py index bfaed93d..f45a8715 100644 --- a/advancedbilling/models/payment_method_credit_card.py +++ b/advancedbilling/models/payment_method_credit_card.py @@ -22,6 +22,8 @@ class PaymentMethodCreditCard(object): last_four (str): TODO: type description here. masked_card_number (str): TODO: type description here. mtype (InvoiceEventPaymentMethod): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -49,7 +51,7 @@ def __init__(self, mtype=None, card_expiration=APIHelper.SKIP, last_four=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the PaymentMethodCreditCard class""" # Initialize members of the class @@ -62,6 +64,8 @@ def __init__(self, self.mtype = mtype # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -79,7 +83,7 @@ def from_dictionary(cls, """ - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -89,16 +93,14 @@ def from_dictionary(cls, 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 - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, mtype, card_expiration, last_four, - dictionary) + additional_properties) @classmethod def validate(cls, dictionary): diff --git a/advancedbilling/models/payment_method_external.py b/advancedbilling/models/payment_method_external.py index be707e91..7f0e08c5 100644 --- a/advancedbilling/models/payment_method_external.py +++ b/advancedbilling/models/payment_method_external.py @@ -21,6 +21,8 @@ class PaymentMethodExternal(object): kind (str): TODO: type description here. memo (str): TODO: type description here. mtype (InvoiceEventPaymentMethod): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -42,7 +44,7 @@ def __init__(self, kind=None, memo=None, mtype=None, - additional_properties={}): + additional_properties=None): """Constructor for the PaymentMethodExternal class""" # Initialize members of the class @@ -52,6 +54,8 @@ def __init__(self, self.mtype = mtype # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -69,7 +73,7 @@ def from_dictionary(cls, """ - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -78,15 +82,13 @@ def from_dictionary(cls, 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 - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, memo, mtype, - dictionary) + additional_properties) @classmethod def validate(cls, dictionary): diff --git a/advancedbilling/models/payment_method_paypal.py b/advancedbilling/models/payment_method_paypal.py index 4c1bb678..b2debe94 100644 --- a/advancedbilling/models/payment_method_paypal.py +++ b/advancedbilling/models/payment_method_paypal.py @@ -19,6 +19,8 @@ class PaymentMethodPaypal(object): Attributes: email (str): TODO: type description here. mtype (InvoiceEventPaymentMethod): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -31,7 +33,7 @@ class PaymentMethodPaypal(object): def __init__(self, email=None, mtype=None, - additional_properties={}): + additional_properties=None): """Constructor for the PaymentMethodPaypal class""" # Initialize members of the class @@ -39,6 +41,8 @@ def __init__(self, self.mtype = mtype # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -56,20 +60,18 @@ def from_dictionary(cls, """ - if dictionary is None: + 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 # Clean out expected properties from dictionary - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, - dictionary) + additional_properties) @classmethod def validate(cls, dictionary): diff --git a/advancedbilling/models/payment_profile_attributes.py b/advancedbilling/models/payment_profile_attributes.py index bbd4e1ca..478b6bbd 100644 --- a/advancedbilling/models/payment_profile_attributes.py +++ b/advancedbilling/models/payment_profile_attributes.py @@ -101,6 +101,8 @@ class PaymentProfileAttributes(object): 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. """ @@ -191,7 +193,7 @@ def __init__(self, gateway_handle=APIHelper.SKIP, cvv=APIHelper.SKIP, last_four=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the PaymentProfileAttributes class""" # Initialize members of the class @@ -247,6 +249,8 @@ def __init__(self, self.last_four = last_four # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -265,7 +269,7 @@ def from_dictionary(cls, """ from advancedbilling.utilities.union_type_lookup import UnionTypeLookUp - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -295,9 +299,7 @@ def from_dictionary(cls, 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 - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, @@ -324,7 +326,7 @@ def from_dictionary(cls, gateway_handle, cvv, last_four, - dictionary) + additional_properties) @classmethod def validate(cls, dictionary): diff --git a/advancedbilling/models/payment_profile_response.py b/advancedbilling/models/payment_profile_response.py index ffb3b1ab..2b4fac83 100644 --- a/advancedbilling/models/payment_profile_response.py +++ b/advancedbilling/models/payment_profile_response.py @@ -19,6 +19,8 @@ class PaymentProfileResponse(object): payment_profile (ApplePayPaymentProfile | BankAccountPaymentProfile | CreditCardPaymentProfile | PaypalPaymentProfile): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -29,13 +31,15 @@ class PaymentProfileResponse(object): def __init__(self, payment_profile=None, - additional_properties={}): + additional_properties=None): """Constructor for the PaymentProfileResponse class""" # Initialize members of the class self.payment_profile = payment_profile # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -54,18 +58,16 @@ def from_dictionary(cls, """ from advancedbilling.utilities.union_type_lookup import UnionTypeLookUp - if dictionary is None: + 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 # Clean out expected properties from dictionary - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, - dictionary) + additional_properties) @classmethod def validate(cls, dictionary): diff --git a/advancedbilling/models/payment_related_events.py b/advancedbilling/models/payment_related_events.py index 6db16f5b..a78c1c8c 100644 --- a/advancedbilling/models/payment_related_events.py +++ b/advancedbilling/models/payment_related_events.py @@ -18,6 +18,8 @@ class PaymentRelatedEvents(object): Attributes: product_id (int): TODO: type description here. account_transaction_id (int): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -30,7 +32,7 @@ class PaymentRelatedEvents(object): def __init__(self, product_id=None, account_transaction_id=None, - additional_properties={}): + additional_properties=None): """Constructor for the PaymentRelatedEvents class""" # Initialize members of the class @@ -38,6 +40,8 @@ def __init__(self, self.account_transaction_id = account_transaction_id # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -55,20 +59,18 @@ def from_dictionary(cls, """ - if dictionary is None: + 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 # Clean out expected properties from dictionary - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, - dictionary) + additional_properties) @classmethod def validate(cls, dictionary): diff --git a/advancedbilling/models/payment_type.py b/advancedbilling/models/payment_type.py index f25152a1..38007a69 100644 --- a/advancedbilling/models/payment_type.py +++ b/advancedbilling/models/payment_type.py @@ -19,6 +19,8 @@ class PaymentType(object): BANK_ACCOUNT: TODO: type description here. PAYPAL_ACCOUNT: TODO: type description here. APPLE_PAY: TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ _all_values = ['credit_card', 'bank_account', 'paypal_account', 'apple_pay'] diff --git a/advancedbilling/models/paypal_payment_profile.py b/advancedbilling/models/paypal_payment_profile.py index b66f780d..8d7068ce 100644 --- a/advancedbilling/models/paypal_payment_profile.py +++ b/advancedbilling/models/paypal_payment_profile.py @@ -44,6 +44,8 @@ class PaypalPaymentProfile(object): site_gateway_setting_id (int): TODO: type description here. gateway_handle (str): TODO: type description here. paypal_email (str): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -117,7 +119,7 @@ def __init__(self, site_gateway_setting_id=APIHelper.SKIP, gateway_handle=APIHelper.SKIP, paypal_email=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the PaypalPaymentProfile class""" # Initialize members of the class @@ -156,6 +158,8 @@ def __init__(self, self.paypal_email = paypal_email # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -173,7 +177,7 @@ def from_dictionary(cls, """ - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -195,9 +199,7 @@ def from_dictionary(cls, 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 # Clean out expected properties from dictionary - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, @@ -216,7 +218,7 @@ def from_dictionary(cls, site_gateway_setting_id, gateway_handle, paypal_email, - dictionary) + additional_properties) @classmethod def validate(cls, dictionary): diff --git a/advancedbilling/models/pending_cancellation_change.py b/advancedbilling/models/pending_cancellation_change.py index 7b33c910..214eb2e8 100644 --- a/advancedbilling/models/pending_cancellation_change.py +++ b/advancedbilling/models/pending_cancellation_change.py @@ -18,6 +18,8 @@ class PendingCancellationChange(object): Attributes: cancellation_state (str): TODO: type description here. cancels_at (datetime): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -30,7 +32,7 @@ class PendingCancellationChange(object): def __init__(self, cancellation_state=None, cancels_at=None, - additional_properties={}): + additional_properties=None): """Constructor for the PendingCancellationChange class""" # Initialize members of the class @@ -38,6 +40,8 @@ def __init__(self, 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: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -55,20 +59,18 @@ def from_dictionary(cls, """ - if dictionary is None: + 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 # Clean out expected properties from dictionary - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, - dictionary) + additional_properties) @classmethod def validate(cls, dictionary): diff --git a/advancedbilling/models/portal_management_link.py b/advancedbilling/models/portal_management_link.py index 6a358c7e..0da9c8f9 100644 --- a/advancedbilling/models/portal_management_link.py +++ b/advancedbilling/models/portal_management_link.py @@ -22,6 +22,8 @@ class PortalManagementLink(object): new_link_available_at (datetime): TODO: type description here. expires_at (datetime): TODO: type description here. last_invite_sent_at (datetime): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -55,7 +57,7 @@ def __init__(self, new_link_available_at=APIHelper.SKIP, expires_at=APIHelper.SKIP, last_invite_sent_at=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the PortalManagementLink class""" # Initialize members of the class @@ -73,6 +75,8 @@ def __init__(self, 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: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -90,7 +94,7 @@ def from_dictionary(cls, """ - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -104,9 +108,7 @@ def from_dictionary(cls, else: last_invite_sent_at = APIHelper.SKIP # Clean out expected properties from dictionary - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, @@ -114,4 +116,4 @@ def from_dictionary(cls, new_link_available_at, expires_at, last_invite_sent_at, - dictionary) + additional_properties) diff --git a/advancedbilling/models/prepaid_component_price_point.py b/advancedbilling/models/prepaid_component_price_point.py deleted file mode 100644 index 9a9590af..00000000 --- a/advancedbilling/models/prepaid_component_price_point.py +++ /dev/null @@ -1,133 +0,0 @@ -# -*- coding: utf-8 -*- - -""" -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.models.overage_pricing import OveragePricing -from advancedbilling.models.price import Price - - -class PrepaidComponentPricePoint(object): - - """Implementation of the 'Prepaid Component Price Point' model. - - TODO: type model description here. - - Attributes: - name (str): TODO: type description here. - handle (str): TODO: type description here. - 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]): TODO: type description here. - overage_pricing (OveragePricing): TODO: type description here. - - """ - - # Create a mapping from Model property names to API property names - _names = { - "name": 'name', - "handle": 'handle', - "pricing_scheme": 'pricing_scheme', - "prices": 'prices', - "overage_pricing": 'overage_pricing' - } - - _optionals = [ - 'name', - 'handle', - 'pricing_scheme', - 'prices', - 'overage_pricing', - ] - - def __init__(self, - name=APIHelper.SKIP, - handle=APIHelper.SKIP, - pricing_scheme=APIHelper.SKIP, - prices=APIHelper.SKIP, - overage_pricing=APIHelper.SKIP, - additional_properties={}): - """Constructor for the PrepaidComponentPricePoint class""" - - # Initialize members of the class - if name is not APIHelper.SKIP: - self.name = name - if handle is not APIHelper.SKIP: - self.handle = handle - if pricing_scheme is not APIHelper.SKIP: - self.pricing_scheme = pricing_scheme - if prices is not APIHelper.SKIP: - self.prices = prices - if overage_pricing is not APIHelper.SKIP: - self.overage_pricing = overage_pricing - - # Add additional model properties to the instance - self.additional_properties = additional_properties - - @classmethod - def from_dictionary(cls, - dictionary): - """Creates 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 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 - prices = None - if dictionary.get('prices') is not None: - prices = [Price.from_dictionary(x) for x in dictionary.get('prices')] - else: - prices = APIHelper.SKIP - overage_pricing = OveragePricing.from_dictionary(dictionary.get('overage_pricing')) if 'overage_pricing' in dictionary.keys() else APIHelper.SKIP - # Clean out expected properties from dictionary - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] - # Return an object of this model - return cls(name, - handle, - pricing_scheme, - prices, - overage_pricing, - dictionary) - - @classmethod - def validate(cls, dictionary): - """Validates 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 True - - if not isinstance(dictionary, dict): - return False - - return True diff --git a/advancedbilling/models/prepaid_configuration.py b/advancedbilling/models/prepaid_configuration.py index b4828140..46530f6d 100644 --- a/advancedbilling/models/prepaid_configuration.py +++ b/advancedbilling/models/prepaid_configuration.py @@ -23,6 +23,8 @@ class PrepaidConfiguration(object): auto_replenish (bool): TODO: type description here. replenish_threshold_amount_in_cents (long|int): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -49,7 +51,7 @@ def __init__(self, replenish_to_amount_in_cents=APIHelper.SKIP, auto_replenish=APIHelper.SKIP, replenish_threshold_amount_in_cents=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the PrepaidConfiguration class""" # Initialize members of the class @@ -65,6 +67,8 @@ def __init__(self, self.replenish_threshold_amount_in_cents = replenish_threshold_amount_in_cents # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -82,7 +86,7 @@ def from_dictionary(cls, """ - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -92,13 +96,11 @@ def from_dictionary(cls, 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 - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, replenish_to_amount_in_cents, auto_replenish, replenish_threshold_amount_in_cents, - dictionary) + additional_properties) diff --git a/advancedbilling/models/prepaid_configuration_response.py b/advancedbilling/models/prepaid_configuration_response.py index 2a20cfe8..4c4834e1 100644 --- a/advancedbilling/models/prepaid_configuration_response.py +++ b/advancedbilling/models/prepaid_configuration_response.py @@ -18,6 +18,8 @@ class PrepaidConfigurationResponse(object): Attributes: prepaid_configuration (PrepaidConfiguration): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -28,13 +30,15 @@ class PrepaidConfigurationResponse(object): def __init__(self, prepaid_configuration=None, - additional_properties={}): + additional_properties=None): """Constructor for the PrepaidConfigurationResponse class""" # Initialize members of the class self.prepaid_configuration = prepaid_configuration # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -52,15 +56,13 @@ def from_dictionary(cls, """ - if dictionary is None: + 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 # Clean out expected properties from dictionary - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, - dictionary) + additional_properties) diff --git a/advancedbilling/models/prepaid_product_price_point_filter.py b/advancedbilling/models/prepaid_product_price_point_filter.py index 9bd660a7..9a974d3f 100644 --- a/advancedbilling/models/prepaid_product_price_point_filter.py +++ b/advancedbilling/models/prepaid_product_price_point_filter.py @@ -17,6 +17,8 @@ class PrepaidProductPricePointFilter(object): 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. """ @@ -26,13 +28,15 @@ class PrepaidProductPricePointFilter(object): } def __init__(self, - additional_properties={}): + additional_properties=None): """Constructor for the PrepaidProductPricePointFilter class""" # Initialize members of the class self.product_price_point_id = 'not_null' # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -50,14 +54,12 @@ def from_dictionary(cls, """ - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary # Clean out expected properties from dictionary - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_properties = {k: v for k, v in dictionary.items() if k not in cls._names.values()} # Return an object of this model - return cls(dictionary) + return cls(additional_properties) diff --git a/advancedbilling/models/prepaid_subscription_balance_changed.py b/advancedbilling/models/prepaid_subscription_balance_changed.py index 71e854e6..bd51539c 100644 --- a/advancedbilling/models/prepaid_subscription_balance_changed.py +++ b/advancedbilling/models/prepaid_subscription_balance_changed.py @@ -22,6 +22,8 @@ class PrepaidSubscriptionBalanceChanged(object): prepayment_account_balance_in_cents (long|int): TODO: type description here. current_usage_amount_in_cents (long|int): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -38,7 +40,7 @@ def __init__(self, current_account_balance_in_cents=None, prepayment_account_balance_in_cents=None, current_usage_amount_in_cents=None, - additional_properties={}): + additional_properties=None): """Constructor for the PrepaidSubscriptionBalanceChanged class""" # Initialize members of the class @@ -48,6 +50,8 @@ def __init__(self, self.current_usage_amount_in_cents = current_usage_amount_in_cents # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -65,7 +69,7 @@ def from_dictionary(cls, """ - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -74,15 +78,13 @@ def from_dictionary(cls, 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 - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, prepayment_account_balance_in_cents, current_usage_amount_in_cents, - dictionary) + additional_properties) @classmethod def validate(cls, dictionary): diff --git a/advancedbilling/models/prepaid_usage.py b/advancedbilling/models/prepaid_usage.py index 7d22b065..f51bdd42 100644 --- a/advancedbilling/models/prepaid_usage.py +++ b/advancedbilling/models/prepaid_usage.py @@ -28,6 +28,8 @@ class PrepaidUsage(object): memo (str): TODO: type description here. allocation_details (List[PrepaidUsageAllocationDetail]): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -56,7 +58,7 @@ def __init__(self, component_handle=None, memo=None, allocation_details=None, - additional_properties={}): + additional_properties=None): """Constructor for the PrepaidUsage class""" # Initialize members of the class @@ -72,6 +74,8 @@ def __init__(self, self.allocation_details = allocation_details # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -89,7 +93,7 @@ def from_dictionary(cls, """ - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -106,9 +110,7 @@ def from_dictionary(cls, 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 - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, @@ -120,7 +122,7 @@ def from_dictionary(cls, component_handle, memo, allocation_details, - dictionary) + additional_properties) @classmethod def validate(cls, dictionary): diff --git a/advancedbilling/models/prepaid_usage_allocation_detail.py b/advancedbilling/models/prepaid_usage_allocation_detail.py index a3474532..f9c32448 100644 --- a/advancedbilling/models/prepaid_usage_allocation_detail.py +++ b/advancedbilling/models/prepaid_usage_allocation_detail.py @@ -19,6 +19,8 @@ class PrepaidUsageAllocationDetail(object): allocation_id (int): TODO: type description here. charge_id (int): TODO: type description here. usage_quantity (int): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -39,7 +41,7 @@ def __init__(self, allocation_id=APIHelper.SKIP, charge_id=APIHelper.SKIP, usage_quantity=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the PrepaidUsageAllocationDetail class""" # Initialize members of the class @@ -51,6 +53,8 @@ def __init__(self, self.usage_quantity = usage_quantity # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -68,7 +72,7 @@ def from_dictionary(cls, """ - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -76,14 +80,12 @@ def from_dictionary(cls, 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 - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, usage_quantity, - dictionary) + additional_properties) @classmethod def validate(cls, dictionary): diff --git a/advancedbilling/models/prepaid_usage_component.py b/advancedbilling/models/prepaid_usage_component.py index 1dead388..f7761e66 100644 --- a/advancedbilling/models/prepaid_usage_component.py +++ b/advancedbilling/models/prepaid_usage_component.py @@ -7,8 +7,8 @@ https://www.apimatic.io ). """ 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.prepaid_component_price_point import PrepaidComponentPricePoint from advancedbilling.models.price import Price @@ -50,7 +50,7 @@ class PrepaidUsageComponent(object): upgrading/downgrading. Defaults to the component and then site setting if one is not provided. Available values: `full`, `prorated`, `none`. - price_points (List[PrepaidComponentPricePoint]): TODO: type + price_points (List[CreatePrepaidUsageComponentPricePoint]): TODO: type description here. unit_price (str | float | None): The amount the customer will be charged per unit when the pricing scheme is “per_unit”. For On/Off @@ -65,7 +65,6 @@ class PrepaidUsageComponent(object): 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. - price_in_cents (str): deprecated May 2011 - use unit_price instead overage_pricing (OveragePricing): TODO: type description here. rollover_prepaid_remainder (bool): Boolean which controls whether or not remaining units should be rolled over to the next period @@ -81,6 +80,8 @@ class PrepaidUsageComponent(object): display_on_hosted_page (bool): TODO: type description here. allow_fractional_quantities (bool): TODO: type description here. public_signup_page_ids (List[int]): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -88,10 +89,11 @@ class PrepaidUsageComponent(object): _names = { "name": 'name', "unit_name": 'unit_name', + "pricing_scheme": 'pricing_scheme', + "overage_pricing": 'overage_pricing', "description": 'description', "handle": 'handle', "taxable": 'taxable', - "pricing_scheme": 'pricing_scheme', "prices": 'prices', "upgrade_charge": 'upgrade_charge', "downgrade_credit": 'downgrade_credit', @@ -99,8 +101,6 @@ class PrepaidUsageComponent(object): "unit_price": 'unit_price', "tax_code": 'tax_code', "hide_date_range_on_invoice": 'hide_date_range_on_invoice', - "price_in_cents": 'price_in_cents', - "overage_pricing": 'overage_pricing', "rollover_prepaid_remainder": 'rollover_prepaid_remainder', "renew_prepaid_allocation": 'renew_prepaid_allocation', "expiration_interval": 'expiration_interval', @@ -111,11 +111,9 @@ class PrepaidUsageComponent(object): } _optionals = [ - 'unit_name', 'description', 'handle', 'taxable', - 'pricing_scheme', 'prices', 'upgrade_charge', 'downgrade_credit', @@ -123,8 +121,6 @@ class PrepaidUsageComponent(object): 'unit_price', 'tax_code', 'hide_date_range_on_invoice', - 'price_in_cents', - 'overage_pricing', 'rollover_prepaid_remainder', 'renew_prepaid_allocation', 'expiration_interval', @@ -142,11 +138,12 @@ class PrepaidUsageComponent(object): def __init__(self, name=None, - unit_name=APIHelper.SKIP, + unit_name=None, + pricing_scheme=None, + overage_pricing=None, description=APIHelper.SKIP, handle=APIHelper.SKIP, taxable=APIHelper.SKIP, - pricing_scheme=APIHelper.SKIP, prices=APIHelper.SKIP, upgrade_charge=APIHelper.SKIP, downgrade_credit=APIHelper.SKIP, @@ -154,8 +151,6 @@ def __init__(self, unit_price=APIHelper.SKIP, tax_code=APIHelper.SKIP, hide_date_range_on_invoice=APIHelper.SKIP, - price_in_cents=APIHelper.SKIP, - overage_pricing=APIHelper.SKIP, rollover_prepaid_remainder=APIHelper.SKIP, renew_prepaid_allocation=APIHelper.SKIP, expiration_interval=APIHelper.SKIP, @@ -163,21 +158,19 @@ def __init__(self, display_on_hosted_page=APIHelper.SKIP, allow_fractional_quantities=APIHelper.SKIP, public_signup_page_ids=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the PrepaidUsageComponent class""" # Initialize members of the class self.name = name - if unit_name is not APIHelper.SKIP: - self.unit_name = unit_name + self.unit_name = unit_name if description is not APIHelper.SKIP: self.description = description if handle is not APIHelper.SKIP: self.handle = handle if taxable is not APIHelper.SKIP: self.taxable = taxable - 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 if upgrade_charge is not APIHelper.SKIP: @@ -192,10 +185,7 @@ def __init__(self, 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 - if price_in_cents is not APIHelper.SKIP: - self.price_in_cents = price_in_cents - if overage_pricing is not APIHelper.SKIP: - self.overage_pricing = overage_pricing + self.overage_pricing = overage_pricing if rollover_prepaid_remainder is not APIHelper.SKIP: self.rollover_prepaid_remainder = rollover_prepaid_remainder if renew_prepaid_allocation is not APIHelper.SKIP: @@ -212,6 +202,8 @@ def __init__(self, self.public_signup_page_ids = public_signup_page_ids # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -230,16 +222,17 @@ def from_dictionary(cls, """ from advancedbilling.utilities.union_type_lookup import UnionTypeLookUp - if dictionary is None: + 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 APIHelper.SKIP + 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 - 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')] @@ -249,14 +242,12 @@ def from_dictionary(cls, 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 = [PrepaidComponentPricePoint.from_dictionary(x) for x in dictionary.get('price_points')] + 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 - price_in_cents = dictionary.get("price_in_cents") if dictionary.get("price_in_cents") else APIHelper.SKIP - overage_pricing = OveragePricing.from_dictionary(dictionary.get('overage_pricing')) if 'overage_pricing' 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 @@ -265,16 +256,15 @@ def from_dictionary(cls, 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 - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, + pricing_scheme, + overage_pricing, description, handle, taxable, - pricing_scheme, prices, upgrade_charge, downgrade_credit, @@ -282,8 +272,6 @@ def from_dictionary(cls, unit_price, tax_code, hide_date_range_on_invoice, - price_in_cents, - overage_pricing, rollover_prepaid_remainder, renew_prepaid_allocation, expiration_interval, @@ -291,4 +279,4 @@ def from_dictionary(cls, display_on_hosted_page, allow_fractional_quantities, public_signup_page_ids, - dictionary) + additional_properties) diff --git a/advancedbilling/models/prepayment.py b/advancedbilling/models/prepayment.py index 26d36b44..611be60c 100644 --- a/advancedbilling/models/prepayment.py +++ b/advancedbilling/models/prepayment.py @@ -26,6 +26,8 @@ class Prepayment(object): memo (str): TODO: type description here. payment_type (PrepaymentMethod): The payment type of the prepayment. created_at (datetime): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -60,7 +62,7 @@ def __init__(self, refunded_amount_in_cents=APIHelper.SKIP, details=APIHelper.SKIP, payment_type=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the Prepayment class""" # Initialize members of the class @@ -79,6 +81,8 @@ def __init__(self, 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 @@ -96,7 +100,7 @@ def from_dictionary(cls, """ - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -111,9 +115,7 @@ def from_dictionary(cls, 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 - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, @@ -125,4 +127,4 @@ def from_dictionary(cls, refunded_amount_in_cents, details, payment_type, - dictionary) + additional_properties) diff --git a/advancedbilling/models/prepayment_account_balance_changed.py b/advancedbilling/models/prepayment_account_balance_changed.py index 2c45fd98..38cc14a8 100644 --- a/advancedbilling/models/prepayment_account_balance_changed.py +++ b/advancedbilling/models/prepayment_account_balance_changed.py @@ -22,6 +22,8 @@ class PrepaymentAccountBalanceChanged(object): prepayment_balance_change_in_cents (long|int): TODO: type description here. currency_code (str): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -38,7 +40,7 @@ def __init__(self, prepayment_account_balance_in_cents=None, prepayment_balance_change_in_cents=None, currency_code=None, - additional_properties={}): + additional_properties=None): """Constructor for the PrepaymentAccountBalanceChanged class""" # Initialize members of the class @@ -48,6 +50,8 @@ def __init__(self, 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 @@ -65,7 +69,7 @@ def from_dictionary(cls, """ - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -74,15 +78,13 @@ def from_dictionary(cls, 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 - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, prepayment_balance_change_in_cents, currency_code, - dictionary) + additional_properties) @classmethod def validate(cls, dictionary): diff --git a/advancedbilling/models/prepayment_method.py b/advancedbilling/models/prepayment_method.py index ff7055dc..44efd386 100644 --- a/advancedbilling/models/prepayment_method.py +++ b/advancedbilling/models/prepayment_method.py @@ -22,6 +22,8 @@ class PrepaymentMethod(object): PAYPAL_ACCOUNT: TODO: type description here. CREDIT_CARD: TODO: type description here. OTHER: TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ CHECK = 'check' diff --git a/advancedbilling/models/prepayment_response.py b/advancedbilling/models/prepayment_response.py index f989f9e8..33009b88 100644 --- a/advancedbilling/models/prepayment_response.py +++ b/advancedbilling/models/prepayment_response.py @@ -17,6 +17,8 @@ class PrepaymentResponse(object): Attributes: prepayment (Prepayment): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -27,13 +29,15 @@ class PrepaymentResponse(object): def __init__(self, prepayment=None, - additional_properties={}): + additional_properties=None): """Constructor for the PrepaymentResponse class""" # Initialize members of the class self.prepayment = prepayment # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -51,15 +55,13 @@ def from_dictionary(cls, """ - if dictionary is None: + 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 # Clean out expected properties from dictionary - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, - dictionary) + additional_properties) diff --git a/advancedbilling/models/prepayments_response.py b/advancedbilling/models/prepayments_response.py index 8270a565..6ce95a9a 100644 --- a/advancedbilling/models/prepayments_response.py +++ b/advancedbilling/models/prepayments_response.py @@ -18,6 +18,8 @@ class PrepaymentsResponse(object): Attributes: prepayments (List[Prepayment]): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -32,7 +34,7 @@ class PrepaymentsResponse(object): def __init__(self, prepayments=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the PrepaymentsResponse class""" # Initialize members of the class @@ -40,6 +42,8 @@ def __init__(self, self.prepayments = prepayments # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -57,7 +61,7 @@ def from_dictionary(cls, """ - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -67,9 +71,7 @@ def from_dictionary(cls, else: prepayments = APIHelper.SKIP # Clean out expected properties from dictionary - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, - dictionary) + additional_properties) diff --git a/advancedbilling/models/preview_allocations_request.py b/advancedbilling/models/preview_allocations_request.py index 892dd2c5..1ec9d34b 100644 --- a/advancedbilling/models/preview_allocations_request.py +++ b/advancedbilling/models/preview_allocations_request.py @@ -31,6 +31,8 @@ class PreviewAllocationsRequest(object): 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. """ @@ -58,7 +60,7 @@ def __init__(self, effective_proration_date=APIHelper.SKIP, upgrade_charge=APIHelper.SKIP, downgrade_credit=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the PreviewAllocationsRequest class""" # Initialize members of the class @@ -71,6 +73,8 @@ def __init__(self, self.downgrade_credit = downgrade_credit # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -88,7 +92,7 @@ def from_dictionary(cls, """ - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -99,12 +103,10 @@ def from_dictionary(cls, 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 - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, upgrade_charge, downgrade_credit, - dictionary) + additional_properties) diff --git a/advancedbilling/models/price.py b/advancedbilling/models/price.py index e0e75969..c43e70ed 100644 --- a/advancedbilling/models/price.py +++ b/advancedbilling/models/price.py @@ -20,6 +20,8 @@ class Price(object): ending_quantity (int | str | None): TODO: type description here. 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. """ @@ -42,7 +44,7 @@ def __init__(self, starting_quantity=None, unit_price=None, ending_quantity=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the Price class""" # Initialize members of the class @@ -52,6 +54,8 @@ def __init__(self, self.unit_price = unit_price # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -70,7 +74,7 @@ def from_dictionary(cls, """ from advancedbilling.utilities.union_type_lookup import UnionTypeLookUp - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -81,14 +85,12 @@ def from_dictionary(cls, else: ending_quantity = APIHelper.SKIP # Clean out expected properties from dictionary - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, ending_quantity, - dictionary) + additional_properties) @classmethod def validate(cls, dictionary): diff --git a/advancedbilling/models/price_point_type.py b/advancedbilling/models/price_point_type.py index eef27c0d..b269fce5 100644 --- a/advancedbilling/models/price_point_type.py +++ b/advancedbilling/models/price_point_type.py @@ -23,6 +23,8 @@ class PricePointType(object): CATALOG: TODO: type description here. DEFAULT: TODO: type description here. CUSTOM: TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ _all_values = ['catalog', 'default', 'custom'] diff --git a/advancedbilling/models/pricing_scheme.py b/advancedbilling/models/pricing_scheme.py index 3d2aa075..3435e914 100644 --- a/advancedbilling/models/pricing_scheme.py +++ b/advancedbilling/models/pricing_scheme.py @@ -21,6 +21,8 @@ class PricingScheme(object): VOLUME: TODO: type description here. PER_UNIT: TODO: type description here. TIERED: TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ _all_values = ['stairstep', 'volume', 'per_unit', 'tiered'] diff --git a/advancedbilling/models/product.py b/advancedbilling/models/product.py index b1cbe60e..5d1f89e4 100644 --- a/advancedbilling/models/product.py +++ b/advancedbilling/models/product.py @@ -90,6 +90,8 @@ class Product(object): Software, Digital Services, Physical Goods, Other product_price_point_id (int): TODO: type description here. product_price_point_handle (str): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -233,7 +235,7 @@ def __init__(self, item_category=APIHelper.SKIP, product_price_point_id=APIHelper.SKIP, product_price_point_handle=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the Product class""" # Initialize members of the class @@ -313,6 +315,8 @@ def __init__(self, self.product_price_point_handle = product_price_point_handle # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -330,7 +334,7 @@ def from_dictionary(cls, """ - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -379,9 +383,7 @@ def from_dictionary(cls, 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 - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, @@ -420,4 +422,4 @@ def from_dictionary(cls, item_category, product_price_point_id, product_price_point_handle, - dictionary) + additional_properties) diff --git a/advancedbilling/models/product_family.py b/advancedbilling/models/product_family.py index f4838adf..16098567 100644 --- a/advancedbilling/models/product_family.py +++ b/advancedbilling/models/product_family.py @@ -23,6 +23,8 @@ class ProductFamily(object): description (str): TODO: type description here. created_at (datetime): TODO: type description here. updated_at (datetime): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -60,7 +62,7 @@ def __init__(self, description=APIHelper.SKIP, created_at=APIHelper.SKIP, updated_at=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the ProductFamily class""" # Initialize members of the class @@ -80,6 +82,8 @@ def __init__(self, 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: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -97,7 +101,7 @@ def from_dictionary(cls, """ - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -109,9 +113,7 @@ def from_dictionary(cls, 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 - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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,4 +122,4 @@ def from_dictionary(cls, description, created_at, updated_at, - dictionary) + additional_properties) diff --git a/advancedbilling/models/product_family_response.py b/advancedbilling/models/product_family_response.py index e26f1fc6..46503261 100644 --- a/advancedbilling/models/product_family_response.py +++ b/advancedbilling/models/product_family_response.py @@ -18,6 +18,8 @@ class ProductFamilyResponse(object): Attributes: product_family (ProductFamily): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -32,7 +34,7 @@ class ProductFamilyResponse(object): def __init__(self, product_family=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the ProductFamilyResponse class""" # Initialize members of the class @@ -40,6 +42,8 @@ def __init__(self, self.product_family = product_family # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -57,15 +61,13 @@ def from_dictionary(cls, """ - if dictionary is None: + 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 # Clean out expected properties from dictionary - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, - dictionary) + additional_properties) diff --git a/advancedbilling/models/product_price_point.py b/advancedbilling/models/product_price_point.py index b7a62f6a..7ab5f6b6 100644 --- a/advancedbilling/models/product_price_point.py +++ b/advancedbilling/models/product_price_point.py @@ -64,6 +64,8 @@ class ProductPricePoint(object): 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. """ @@ -161,7 +163,7 @@ def __init__(self, tax_included=APIHelper.SKIP, subscription_id=APIHelper.SKIP, currency_prices=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the ProductPricePoint class""" # Initialize members of the class @@ -215,6 +217,8 @@ def __init__(self, self.currency_prices = currency_prices # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -232,7 +236,7 @@ def from_dictionary(cls, """ - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -268,9 +272,7 @@ def from_dictionary(cls, else: currency_prices = APIHelper.SKIP # Clean out expected properties from dictionary - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, @@ -296,4 +298,4 @@ def from_dictionary(cls, tax_included, subscription_id, currency_prices, - dictionary) + additional_properties) diff --git a/advancedbilling/models/product_price_point_errors.py b/advancedbilling/models/product_price_point_errors.py index e14b06b8..00b97adf 100644 --- a/advancedbilling/models/product_price_point_errors.py +++ b/advancedbilling/models/product_price_point_errors.py @@ -22,6 +22,8 @@ class ProductPricePointErrors(object): name (List[str]): TODO: type description here. price (List[str]): TODO: type description here. price_in_cents (List[str]): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -51,7 +53,7 @@ def __init__(self, name=APIHelper.SKIP, price=APIHelper.SKIP, price_in_cents=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the ProductPricePointErrors class""" # Initialize members of the class @@ -69,6 +71,8 @@ def __init__(self, self.price_in_cents = price_in_cents # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -86,7 +90,7 @@ def from_dictionary(cls, """ - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -97,9 +101,7 @@ def from_dictionary(cls, 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 - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, @@ -107,4 +109,4 @@ def from_dictionary(cls, name, price, price_in_cents, - dictionary) + additional_properties) diff --git a/advancedbilling/models/product_price_point_response.py b/advancedbilling/models/product_price_point_response.py index bbd094e1..5a652231 100644 --- a/advancedbilling/models/product_price_point_response.py +++ b/advancedbilling/models/product_price_point_response.py @@ -17,6 +17,8 @@ class ProductPricePointResponse(object): Attributes: price_point (ProductPricePoint): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -27,13 +29,15 @@ class ProductPricePointResponse(object): def __init__(self, price_point=None, - additional_properties={}): + additional_properties=None): """Constructor for the ProductPricePointResponse class""" # 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 @@ -51,15 +55,13 @@ def from_dictionary(cls, """ - if dictionary is None: + 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 # Clean out expected properties from dictionary - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, - dictionary) + additional_properties) diff --git a/advancedbilling/models/product_response.py b/advancedbilling/models/product_response.py index fcf82da7..a3d90087 100644 --- a/advancedbilling/models/product_response.py +++ b/advancedbilling/models/product_response.py @@ -17,6 +17,8 @@ class ProductResponse(object): Attributes: product (Product): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -27,13 +29,15 @@ class ProductResponse(object): def __init__(self, product=None, - additional_properties={}): + additional_properties=None): """Constructor for the ProductResponse class""" # Initialize members of the class self.product = product # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -51,15 +55,13 @@ def from_dictionary(cls, """ - if dictionary is None: + 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 # Clean out expected properties from dictionary - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, - dictionary) + additional_properties) diff --git a/advancedbilling/models/proforma_error.py b/advancedbilling/models/proforma_error.py index a8ebfc24..a11f1490 100644 --- a/advancedbilling/models/proforma_error.py +++ b/advancedbilling/models/proforma_error.py @@ -19,6 +19,8 @@ class ProformaError(object): 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. """ @@ -33,7 +35,7 @@ class ProformaError(object): def __init__(self, subscription=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the ProformaError class""" # Initialize members of the class @@ -41,6 +43,8 @@ def __init__(self, self.subscription = subscription # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -58,15 +62,13 @@ def from_dictionary(cls, """ - if dictionary is None: + 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 # Clean out expected properties from dictionary - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, - dictionary) + additional_properties) diff --git a/advancedbilling/models/proforma_invoice.py b/advancedbilling/models/proforma_invoice.py index 161b41b9..e7be60d3 100644 --- a/advancedbilling/models/proforma_invoice.py +++ b/advancedbilling/models/proforma_invoice.py @@ -80,6 +80,8 @@ class ProformaInvoice(object): payments (List[ProformaInvoicePayment]): TODO: type description here. custom_fields (List[InvoiceCustomField]): TODO: type description here. public_url (str): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -207,7 +209,7 @@ def __init__(self, payments=APIHelper.SKIP, custom_fields=APIHelper.SKIP, public_url=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the ProformaInvoice class""" # Initialize members of the class @@ -285,6 +287,8 @@ def __init__(self, self.public_url = public_url # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -302,7 +306,7 @@ def from_dictionary(cls, """ - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -367,9 +371,7 @@ def from_dictionary(cls, custom_fields = APIHelper.SKIP public_url = dictionary.get("public_url") if "public_url" in dictionary.keys() else APIHelper.SKIP # Clean out expected properties from dictionary - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, @@ -407,4 +409,4 @@ def from_dictionary(cls, payments, custom_fields, public_url, - dictionary) + additional_properties) diff --git a/advancedbilling/models/proforma_invoice_credit.py b/advancedbilling/models/proforma_invoice_credit.py index 078ff0ac..63db02dd 100644 --- a/advancedbilling/models/proforma_invoice_credit.py +++ b/advancedbilling/models/proforma_invoice_credit.py @@ -20,6 +20,8 @@ class ProformaInvoiceCredit(object): memo (str): TODO: type description here. original_amount (str): TODO: type description here. applied_amount (str): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -43,7 +45,7 @@ def __init__(self, memo=APIHelper.SKIP, original_amount=APIHelper.SKIP, applied_amount=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the ProformaInvoiceCredit class""" # Initialize members of the class @@ -57,6 +59,8 @@ def __init__(self, self.applied_amount = applied_amount # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -74,7 +78,7 @@ def from_dictionary(cls, """ - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -83,12 +87,10 @@ def from_dictionary(cls, 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 - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, original_amount, applied_amount, - dictionary) + additional_properties) diff --git a/advancedbilling/models/proforma_invoice_discount.py b/advancedbilling/models/proforma_invoice_discount.py index fb625d5d..a8723169 100644 --- a/advancedbilling/models/proforma_invoice_discount.py +++ b/advancedbilling/models/proforma_invoice_discount.py @@ -27,6 +27,8 @@ class ProformaInvoiceDiscount(object): discount_amount (str): TODO: type description here. line_item_breakouts (List[InvoiceDiscountBreakout]): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -62,7 +64,7 @@ def __init__(self, eligible_amount=APIHelper.SKIP, discount_amount=APIHelper.SKIP, line_item_breakouts=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the ProformaInvoiceDiscount class""" # Initialize members of the class @@ -84,6 +86,8 @@ def __init__(self, self.line_item_breakouts = line_item_breakouts # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -101,7 +105,7 @@ def from_dictionary(cls, """ - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -118,9 +122,7 @@ def from_dictionary(cls, else: line_item_breakouts = APIHelper.SKIP # Clean out expected properties from dictionary - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, @@ -130,4 +132,4 @@ def from_dictionary(cls, eligible_amount, discount_amount, line_item_breakouts, - dictionary) + additional_properties) diff --git a/advancedbilling/models/proforma_invoice_discount_source_type.py b/advancedbilling/models/proforma_invoice_discount_source_type.py index 966e26a5..ef0d8bea 100644 --- a/advancedbilling/models/proforma_invoice_discount_source_type.py +++ b/advancedbilling/models/proforma_invoice_discount_source_type.py @@ -17,6 +17,8 @@ class ProformaInvoiceDiscountSourceType(object): Attributes: COUPON: TODO: type description here. REFERRAL: TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ COUPON = 'Coupon' diff --git a/advancedbilling/models/proforma_invoice_issued.py b/advancedbilling/models/proforma_invoice_issued.py index 3d88071d..2c54c8c7 100644 --- a/advancedbilling/models/proforma_invoice_issued.py +++ b/advancedbilling/models/proforma_invoice_issued.py @@ -32,6 +32,8 @@ class ProformaInvoiceIssued(object): product_name (str): TODO: type description here. line_items (List[InvoiceLineItemEventData]): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -62,7 +64,7 @@ def __init__(self, total_amount=None, product_name=None, line_items=None, - additional_properties={}): + additional_properties=None): """Constructor for the ProformaInvoiceIssued class""" # Initialize members of the class @@ -79,6 +81,8 @@ def __init__(self, self.line_items = line_items # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -96,7 +100,7 @@ def from_dictionary(cls, """ - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -114,9 +118,7 @@ def from_dictionary(cls, 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 - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, @@ -129,7 +131,7 @@ def from_dictionary(cls, total_amount, product_name, line_items, - dictionary) + additional_properties) @classmethod def validate(cls, dictionary): diff --git a/advancedbilling/models/proforma_invoice_payment.py b/advancedbilling/models/proforma_invoice_payment.py index e277cbe9..6b801add 100644 --- a/advancedbilling/models/proforma_invoice_payment.py +++ b/advancedbilling/models/proforma_invoice_payment.py @@ -20,6 +20,8 @@ class ProformaInvoicePayment(object): original_amount (str): TODO: type description here. applied_amount (str): TODO: type description here. prepayment (bool): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -43,7 +45,7 @@ def __init__(self, original_amount=APIHelper.SKIP, applied_amount=APIHelper.SKIP, prepayment=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the ProformaInvoicePayment class""" # Initialize members of the class @@ -57,6 +59,8 @@ def __init__(self, self.prepayment = prepayment # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -74,7 +78,7 @@ def from_dictionary(cls, """ - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -83,12 +87,10 @@ def from_dictionary(cls, 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 - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, applied_amount, prepayment, - dictionary) + additional_properties) diff --git a/advancedbilling/models/proforma_invoice_role.py b/advancedbilling/models/proforma_invoice_role.py index 54b26f0e..070556be 100644 --- a/advancedbilling/models/proforma_invoice_role.py +++ b/advancedbilling/models/proforma_invoice_role.py @@ -20,6 +20,8 @@ class ProformaInvoiceRole(object): PROFORMA: TODO: type description here. PROFORMA_ADHOC: TODO: type description here. PROFORMA_AUTOMATIC: TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ UNSET = 'unset' diff --git a/advancedbilling/models/proforma_invoice_status.py b/advancedbilling/models/proforma_invoice_status.py index 1ce02bbb..eae682d7 100644 --- a/advancedbilling/models/proforma_invoice_status.py +++ b/advancedbilling/models/proforma_invoice_status.py @@ -18,6 +18,8 @@ class ProformaInvoiceStatus(object): DRAFT: TODO: type description here. VOIDED: TODO: type description here. ARCHIVED: TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ DRAFT = 'draft' diff --git a/advancedbilling/models/proforma_invoice_tax.py b/advancedbilling/models/proforma_invoice_tax.py index 24b13603..95c35b4d 100644 --- a/advancedbilling/models/proforma_invoice_tax.py +++ b/advancedbilling/models/proforma_invoice_tax.py @@ -26,6 +26,8 @@ class ProformaInvoiceTax(object): tax_amount (str): TODO: type description here. line_item_breakouts (List[InvoiceTaxBreakout]): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -58,7 +60,7 @@ def __init__(self, taxable_amount=APIHelper.SKIP, tax_amount=APIHelper.SKIP, line_item_breakouts=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the ProformaInvoiceTax class""" # Initialize members of the class @@ -78,6 +80,8 @@ def __init__(self, self.line_item_breakouts = line_item_breakouts # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -95,7 +99,7 @@ def from_dictionary(cls, """ - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -111,9 +115,7 @@ def from_dictionary(cls, else: line_item_breakouts = APIHelper.SKIP # Clean out expected properties from dictionary - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, @@ -122,4 +124,4 @@ def from_dictionary(cls, taxable_amount, tax_amount, line_item_breakouts, - dictionary) + additional_properties) diff --git a/advancedbilling/models/proforma_invoice_tax_source_type.py b/advancedbilling/models/proforma_invoice_tax_source_type.py index 151e1c61..0d60e5a6 100644 --- a/advancedbilling/models/proforma_invoice_tax_source_type.py +++ b/advancedbilling/models/proforma_invoice_tax_source_type.py @@ -17,6 +17,8 @@ class ProformaInvoiceTaxSourceType(object): Attributes: TAX: TODO: type description here. AVALARA: TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ _all_values = ['Tax', 'Avalara'] diff --git a/advancedbilling/models/proration.py b/advancedbilling/models/proration.py index 32843c4c..42dbcdcf 100644 --- a/advancedbilling/models/proration.py +++ b/advancedbilling/models/proration.py @@ -18,6 +18,8 @@ class Proration(object): 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. """ @@ -32,7 +34,7 @@ class Proration(object): def __init__(self, preserve_period=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the Proration class""" # Initialize members of the class @@ -40,6 +42,8 @@ def __init__(self, self.preserve_period = preserve_period # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -57,15 +61,13 @@ def from_dictionary(cls, """ - if dictionary is None: + 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 # Clean out expected properties from dictionary - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, - dictionary) + additional_properties) diff --git a/advancedbilling/models/public_key.py b/advancedbilling/models/public_key.py index 13e57054..ff236494 100644 --- a/advancedbilling/models/public_key.py +++ b/advancedbilling/models/public_key.py @@ -19,6 +19,8 @@ class PublicKey(object): public_key (str): TODO: type description here. requires_security_token (bool): TODO: type description here. created_at (datetime): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -39,7 +41,7 @@ def __init__(self, public_key=APIHelper.SKIP, requires_security_token=APIHelper.SKIP, created_at=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the PublicKey class""" # Initialize members of the class @@ -51,6 +53,8 @@ def __init__(self, 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 @@ -68,7 +72,7 @@ def from_dictionary(cls, """ - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -76,11 +80,9 @@ def from_dictionary(cls, 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 - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, created_at, - dictionary) + additional_properties) diff --git a/advancedbilling/models/public_signup_page.py b/advancedbilling/models/public_signup_page.py index 68f73203..f2a4e0fb 100644 --- a/advancedbilling/models/public_signup_page.py +++ b/advancedbilling/models/public_signup_page.py @@ -23,6 +23,8 @@ class PublicSignupPage(object): (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. """ @@ -51,7 +53,7 @@ def __init__(self, return_url=APIHelper.SKIP, return_params=APIHelper.SKIP, url=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the PublicSignupPage class""" # Initialize members of the class @@ -65,6 +67,8 @@ def __init__(self, self.url = url # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -82,7 +86,7 @@ def from_dictionary(cls, """ - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -91,12 +95,10 @@ def from_dictionary(cls, 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 - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, return_params, url, - dictionary) + additional_properties) diff --git a/advancedbilling/models/quantity_based_component.py b/advancedbilling/models/quantity_based_component.py index 0ca4d5b5..3308134e 100644 --- a/advancedbilling/models/quantity_based_component.py +++ b/advancedbilling/models/quantity_based_component.py @@ -64,7 +64,6 @@ class QuantityBasedComponent(object): 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. - price_in_cents (str): deprecated May 2011 - use unit_price instead recurring (bool): TODO: type description here. display_on_hosted_page (bool): TODO: type description here. allow_fractional_quantities (bool): TODO: type description here. @@ -77,6 +76,8 @@ class QuantityBasedComponent(object): 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. """ @@ -95,7 +96,6 @@ class QuantityBasedComponent(object): "unit_price": 'unit_price', "tax_code": 'tax_code', "hide_date_range_on_invoice": 'hide_date_range_on_invoice', - "price_in_cents": 'price_in_cents', "recurring": 'recurring', "display_on_hosted_page": 'display_on_hosted_page', "allow_fractional_quantities": 'allow_fractional_quantities', @@ -115,7 +115,6 @@ class QuantityBasedComponent(object): 'unit_price', 'tax_code', 'hide_date_range_on_invoice', - 'price_in_cents', 'recurring', 'display_on_hosted_page', 'allow_fractional_quantities', @@ -144,14 +143,13 @@ def __init__(self, unit_price=APIHelper.SKIP, tax_code=APIHelper.SKIP, hide_date_range_on_invoice=APIHelper.SKIP, - price_in_cents=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={}): + additional_properties=None): """Constructor for the QuantityBasedComponent class""" # Initialize members of the class @@ -178,8 +176,6 @@ def __init__(self, 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 - if price_in_cents is not APIHelper.SKIP: - self.price_in_cents = price_in_cents if recurring is not APIHelper.SKIP: self.recurring = recurring if display_on_hosted_page is not APIHelper.SKIP: @@ -194,6 +190,8 @@ def __init__(self, self.interval_unit = interval_unit # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -212,7 +210,7 @@ def from_dictionary(cls, """ from advancedbilling.utilities.union_type_lookup import UnionTypeLookUp - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -237,7 +235,6 @@ def from_dictionary(cls, 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 - price_in_cents = dictionary.get("price_in_cents") if dictionary.get("price_in_cents") 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 @@ -245,9 +242,7 @@ def from_dictionary(cls, 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 - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, @@ -262,11 +257,10 @@ def from_dictionary(cls, unit_price, tax_code, hide_date_range_on_invoice, - price_in_cents, recurring, display_on_hosted_page, allow_fractional_quantities, public_signup_page_ids, interval, interval_unit, - dictionary) + additional_properties) diff --git a/advancedbilling/models/reactivate_subscription_group_request.py b/advancedbilling/models/reactivate_subscription_group_request.py index 0e4050f7..de0f0b4c 100644 --- a/advancedbilling/models/reactivate_subscription_group_request.py +++ b/advancedbilling/models/reactivate_subscription_group_request.py @@ -18,6 +18,8 @@ class ReactivateSubscriptionGroupRequest(object): Attributes: resume (bool): TODO: type description here. resume_members (bool): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -35,7 +37,7 @@ class ReactivateSubscriptionGroupRequest(object): def __init__(self, resume=APIHelper.SKIP, resume_members=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the ReactivateSubscriptionGroupRequest class""" # Initialize members of the class @@ -45,6 +47,8 @@ def __init__(self, self.resume_members = resume_members # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -62,17 +66,15 @@ def from_dictionary(cls, """ - if dictionary is None: + 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 # Clean out expected properties from dictionary - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, - dictionary) + additional_properties) diff --git a/advancedbilling/models/reactivate_subscription_group_response.py b/advancedbilling/models/reactivate_subscription_group_response.py index fb79d615..ae52c524 100644 --- a/advancedbilling/models/reactivate_subscription_group_response.py +++ b/advancedbilling/models/reactivate_subscription_group_response.py @@ -25,6 +25,8 @@ class ReactivateSubscriptionGroupResponse(object): next_assessment_at (datetime): TODO: type description here. state (str): TODO: type description here. cancel_at_end_of_period (bool): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -63,7 +65,7 @@ def __init__(self, next_assessment_at=APIHelper.SKIP, state=APIHelper.SKIP, cancel_at_end_of_period=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the ReactivateSubscriptionGroupResponse class""" # Initialize members of the class @@ -87,6 +89,8 @@ def __init__(self, self.cancel_at_end_of_period = cancel_at_end_of_period # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -104,7 +108,7 @@ def from_dictionary(cls, """ - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -118,9 +122,7 @@ def from_dictionary(cls, 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 - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, @@ -131,4 +133,4 @@ def from_dictionary(cls, next_assessment_at, state, cancel_at_end_of_period, - dictionary) + additional_properties) diff --git a/advancedbilling/models/reactivate_subscription_request.py b/advancedbilling/models/reactivate_subscription_request.py index 83dafe4b..3485ab78 100644 --- a/advancedbilling/models/reactivate_subscription_request.py +++ b/advancedbilling/models/reactivate_subscription_request.py @@ -33,6 +33,8 @@ class ReactivateSubscriptionRequest(object): 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. """ @@ -62,7 +64,7 @@ def __init__(self, coupon_code=APIHelper.SKIP, use_credits_and_prepayments=APIHelper.SKIP, resume=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the ReactivateSubscriptionRequest class""" # Initialize members of the class @@ -80,6 +82,8 @@ def __init__(self, self.resume = resume # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -98,7 +102,7 @@ def from_dictionary(cls, """ from advancedbilling.utilities.union_type_lookup import UnionTypeLookUp - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -109,9 +113,7 @@ def from_dictionary(cls, 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 - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, @@ -119,4 +121,4 @@ def from_dictionary(cls, coupon_code, use_credits_and_prepayments, resume, - dictionary) + additional_properties) diff --git a/advancedbilling/models/reactivation_billing.py b/advancedbilling/models/reactivation_billing.py index b54f7f4e..22bea3dc 100644 --- a/advancedbilling/models/reactivation_billing.py +++ b/advancedbilling/models/reactivation_billing.py @@ -23,6 +23,8 @@ class ReactivationBilling(object): 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. """ @@ -37,13 +39,15 @@ class ReactivationBilling(object): def __init__(self, reactivation_charge='prorated', - additional_properties={}): + additional_properties=None): """Constructor for the ReactivationBilling class""" # Initialize members of the class self.reactivation_charge = reactivation_charge # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -61,18 +65,16 @@ def from_dictionary(cls, """ - if dictionary is None: + 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' # Clean out expected properties from dictionary - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, - dictionary) + additional_properties) @classmethod def validate(cls, dictionary): diff --git a/advancedbilling/models/reactivation_charge.py b/advancedbilling/models/reactivation_charge.py index 407d0867..1601f485 100644 --- a/advancedbilling/models/reactivation_charge.py +++ b/advancedbilling/models/reactivation_charge.py @@ -23,6 +23,8 @@ class ReactivationCharge(object): PRORATED: TODO: type description here. IMMEDIATE: TODO: type description here. DELAYED: TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ _all_values = ['prorated', 'immediate', 'delayed'] diff --git a/advancedbilling/models/reason_code.py b/advancedbilling/models/reason_code.py index 1bccc5ed..dbf8b9c4 100644 --- a/advancedbilling/models/reason_code.py +++ b/advancedbilling/models/reason_code.py @@ -23,6 +23,8 @@ class ReasonCode(object): position (int): TODO: type description here. created_at (datetime): TODO: type description here. updated_at (datetime): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -55,7 +57,7 @@ def __init__(self, position=APIHelper.SKIP, created_at=APIHelper.SKIP, updated_at=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the ReasonCode class""" # Initialize members of the class @@ -75,6 +77,8 @@ def __init__(self, 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: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -92,7 +96,7 @@ def from_dictionary(cls, """ - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -104,9 +108,7 @@ def from_dictionary(cls, 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 - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, @@ -115,4 +117,4 @@ def from_dictionary(cls, position, created_at, updated_at, - dictionary) + additional_properties) diff --git a/advancedbilling/models/reason_code_response.py b/advancedbilling/models/reason_code_response.py index 5ce86c6b..5a5655e9 100644 --- a/advancedbilling/models/reason_code_response.py +++ b/advancedbilling/models/reason_code_response.py @@ -17,6 +17,8 @@ class ReasonCodeResponse(object): Attributes: reason_code (ReasonCode): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -27,13 +29,15 @@ class ReasonCodeResponse(object): def __init__(self, reason_code=None, - additional_properties={}): + additional_properties=None): """Constructor for the ReasonCodeResponse class""" # Initialize members of the class self.reason_code = reason_code # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -51,15 +55,13 @@ def from_dictionary(cls, """ - if dictionary is None: + 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 # Clean out expected properties from dictionary - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, - dictionary) + additional_properties) diff --git a/advancedbilling/models/record_payment_request.py b/advancedbilling/models/record_payment_request.py index 6d914919..0359c969 100644 --- a/advancedbilling/models/record_payment_request.py +++ b/advancedbilling/models/record_payment_request.py @@ -17,6 +17,8 @@ class RecordPaymentRequest(object): Attributes: payment (CreatePayment): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -27,13 +29,15 @@ class RecordPaymentRequest(object): def __init__(self, payment=None, - additional_properties={}): + additional_properties=None): """Constructor for the RecordPaymentRequest class""" # Initialize members of the class self.payment = payment # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -51,15 +55,13 @@ def from_dictionary(cls, """ - if dictionary is None: + 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 # Clean out expected properties from dictionary - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, - dictionary) + additional_properties) diff --git a/advancedbilling/models/record_payment_response.py b/advancedbilling/models/record_payment_response.py index 6e92349d..1985c160 100644 --- a/advancedbilling/models/record_payment_response.py +++ b/advancedbilling/models/record_payment_response.py @@ -20,6 +20,8 @@ class RecordPaymentResponse(object): Attributes: paid_invoices (List[PaidInvoice]): TODO: type description here. prepayment (InvoicePrePayment): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -41,7 +43,7 @@ class RecordPaymentResponse(object): def __init__(self, paid_invoices=APIHelper.SKIP, prepayment=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the RecordPaymentResponse class""" # Initialize members of the class @@ -51,6 +53,8 @@ def __init__(self, self.prepayment = prepayment # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -68,7 +72,7 @@ def from_dictionary(cls, """ - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -82,10 +86,8 @@ def from_dictionary(cls, else: prepayment = APIHelper.SKIP # Clean out expected properties from dictionary - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, - dictionary) + additional_properties) diff --git a/advancedbilling/models/recurring_scheme.py b/advancedbilling/models/recurring_scheme.py index f3ff86a4..086d1e7d 100644 --- a/advancedbilling/models/recurring_scheme.py +++ b/advancedbilling/models/recurring_scheme.py @@ -18,6 +18,8 @@ class RecurringScheme(object): DO_NOT_RECUR: TODO: type description here. RECUR_INDEFINITELY: TODO: type description here. RECUR_WITH_DURATION: TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ DO_NOT_RECUR = 'do_not_recur' diff --git a/advancedbilling/models/referral_code.py b/advancedbilling/models/referral_code.py index d7523c0d..51447493 100644 --- a/advancedbilling/models/referral_code.py +++ b/advancedbilling/models/referral_code.py @@ -20,6 +20,8 @@ class ReferralCode(object): site_id (int): TODO: type description here. subscription_id (int): TODO: type description here. code (str): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -43,7 +45,7 @@ def __init__(self, site_id=APIHelper.SKIP, subscription_id=APIHelper.SKIP, code=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the ReferralCode class""" # Initialize members of the class @@ -57,6 +59,8 @@ def __init__(self, self.code = code # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -74,7 +78,7 @@ def from_dictionary(cls, """ - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -83,12 +87,10 @@ def from_dictionary(cls, 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 - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, code, - dictionary) + additional_properties) diff --git a/advancedbilling/models/referral_validation_response.py b/advancedbilling/models/referral_validation_response.py index cb7901d0..6665adcf 100644 --- a/advancedbilling/models/referral_validation_response.py +++ b/advancedbilling/models/referral_validation_response.py @@ -18,6 +18,8 @@ class ReferralValidationResponse(object): Attributes: referral_code (ReferralCode): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -32,7 +34,7 @@ class ReferralValidationResponse(object): def __init__(self, referral_code=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the ReferralValidationResponse class""" # Initialize members of the class @@ -40,6 +42,8 @@ def __init__(self, self.referral_code = referral_code # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -57,15 +61,13 @@ def from_dictionary(cls, """ - if dictionary is None: + 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 # Clean out expected properties from dictionary - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, - dictionary) + additional_properties) diff --git a/advancedbilling/models/refund_consolidated_invoice.py b/advancedbilling/models/refund_consolidated_invoice.py index 4d80818f..6cbe2efd 100644 --- a/advancedbilling/models/refund_consolidated_invoice.py +++ b/advancedbilling/models/refund_consolidated_invoice.py @@ -27,6 +27,8 @@ class RefundConsolidatedInvoice(object): 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. """ @@ -53,7 +55,7 @@ def __init__(self, external=APIHelper.SKIP, apply_credit=APIHelper.SKIP, amount=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the RefundConsolidatedInvoice class""" # Initialize members of the class @@ -68,6 +70,8 @@ def __init__(self, self.amount = amount # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -86,7 +90,7 @@ def from_dictionary(cls, """ from advancedbilling.utilities.union_type_lookup import UnionTypeLookUp - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -97,9 +101,7 @@ def from_dictionary(cls, 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 - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, @@ -107,7 +109,7 @@ def from_dictionary(cls, external, apply_credit, amount, - dictionary) + additional_properties) @classmethod def validate(cls, dictionary): diff --git a/advancedbilling/models/refund_invoice.py b/advancedbilling/models/refund_invoice.py index b689eb13..abcbd626 100644 --- a/advancedbilling/models/refund_invoice.py +++ b/advancedbilling/models/refund_invoice.py @@ -28,6 +28,8 @@ class RefundInvoice(object): 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. """ @@ -54,7 +56,7 @@ def __init__(self, external=APIHelper.SKIP, apply_credit=APIHelper.SKIP, void_invoice=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the RefundInvoice class""" # Initialize members of the class @@ -69,6 +71,8 @@ def __init__(self, self.void_invoice = void_invoice # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -86,7 +90,7 @@ def from_dictionary(cls, """ - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -97,9 +101,7 @@ def from_dictionary(cls, 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 - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, @@ -107,7 +109,7 @@ def from_dictionary(cls, external, apply_credit, void_invoice, - dictionary) + additional_properties) @classmethod def validate(cls, dictionary): diff --git a/advancedbilling/models/refund_invoice_event.py b/advancedbilling/models/refund_invoice_event.py index 6153d730..a81663bb 100644 --- a/advancedbilling/models/refund_invoice_event.py +++ b/advancedbilling/models/refund_invoice_event.py @@ -25,6 +25,8 @@ class RefundInvoiceEvent(object): event_type (InvoiceEventType): TODO: type description here. event_data (RefundInvoiceEventData): Example schema for an `refund_invoice` event + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -43,7 +45,7 @@ def __init__(self, invoice=None, event_type='refund_invoice', event_data=None, - additional_properties={}): + additional_properties=None): """Constructor for the RefundInvoiceEvent class""" # Initialize members of the class @@ -54,6 +56,8 @@ def __init__(self, self.event_data = event_data # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -71,7 +75,7 @@ def from_dictionary(cls, """ - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -81,16 +85,14 @@ def from_dictionary(cls, 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 - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, invoice, event_type, event_data, - dictionary) + additional_properties) @classmethod def validate(cls, dictionary): diff --git a/advancedbilling/models/refund_invoice_event_data.py b/advancedbilling/models/refund_invoice_event_data.py index 4b750382..449d17a4 100644 --- a/advancedbilling/models/refund_invoice_event_data.py +++ b/advancedbilling/models/refund_invoice_event_data.py @@ -38,6 +38,8 @@ class RefundInvoiceEventData(object): 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. """ @@ -70,7 +72,7 @@ def __init__(self, consolidation_level=APIHelper.SKIP, memo=APIHelper.SKIP, original_amount=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the RefundInvoiceEventData class""" # Initialize members of the class @@ -88,6 +90,8 @@ def __init__(self, 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: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -105,7 +109,7 @@ def from_dictionary(cls, """ - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -119,9 +123,7 @@ def from_dictionary(cls, 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 - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, @@ -132,7 +134,7 @@ def from_dictionary(cls, consolidation_level, memo, original_amount, - dictionary) + additional_properties) @classmethod def validate(cls, dictionary): diff --git a/advancedbilling/models/refund_invoice_request.py b/advancedbilling/models/refund_invoice_request.py index cd7e263b..e6836680 100644 --- a/advancedbilling/models/refund_invoice_request.py +++ b/advancedbilling/models/refund_invoice_request.py @@ -18,6 +18,8 @@ class RefundInvoiceRequest(object): Attributes: refund (RefundInvoice | RefundConsolidatedInvoice): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -28,13 +30,15 @@ class RefundInvoiceRequest(object): def __init__(self, refund=None, - additional_properties={}): + additional_properties=None): """Constructor for the RefundInvoiceRequest class""" # Initialize members of the class self.refund = refund # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -53,18 +57,16 @@ def from_dictionary(cls, """ from advancedbilling.utilities.union_type_lookup import UnionTypeLookUp - if dictionary is None: + 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 # Clean out expected properties from dictionary - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, - dictionary) + additional_properties) @classmethod def validate(cls, dictionary): diff --git a/advancedbilling/models/refund_prepayment.py b/advancedbilling/models/refund_prepayment.py index eaa61e8e..6ba0acce 100644 --- a/advancedbilling/models/refund_prepayment.py +++ b/advancedbilling/models/refund_prepayment.py @@ -25,6 +25,8 @@ class RefundPrepayment(object): 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. """ @@ -49,7 +51,7 @@ def __init__(self, amount=None, memo=None, external=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the RefundPrepayment class""" # Initialize members of the class @@ -60,6 +62,8 @@ def __init__(self, self.external = external # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -78,7 +82,7 @@ def from_dictionary(cls, """ from advancedbilling.utilities.union_type_lookup import UnionTypeLookUp - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -87,15 +91,13 @@ def from_dictionary(cls, 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 - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, memo, external, - dictionary) + additional_properties) @classmethod def validate(cls, dictionary): diff --git a/advancedbilling/models/refund_prepayment_base_refund_error.py b/advancedbilling/models/refund_prepayment_base_refund_error.py index 18c50b04..70d89720 100644 --- a/advancedbilling/models/refund_prepayment_base_refund_error.py +++ b/advancedbilling/models/refund_prepayment_base_refund_error.py @@ -18,6 +18,8 @@ class RefundPrepaymentBaseRefundError(object): Attributes: refund (BaseRefundError): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -32,7 +34,7 @@ class RefundPrepaymentBaseRefundError(object): def __init__(self, refund=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the RefundPrepaymentBaseRefundError class""" # Initialize members of the class @@ -40,6 +42,8 @@ def __init__(self, self.refund = refund # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -57,15 +61,13 @@ def from_dictionary(cls, """ - if dictionary is None: + 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 # Clean out expected properties from dictionary - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, - dictionary) + additional_properties) diff --git a/advancedbilling/models/refund_prepayment_request.py b/advancedbilling/models/refund_prepayment_request.py index c591ca17..87beb616 100644 --- a/advancedbilling/models/refund_prepayment_request.py +++ b/advancedbilling/models/refund_prepayment_request.py @@ -17,6 +17,8 @@ class RefundPrepaymentRequest(object): Attributes: refund (RefundPrepayment): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -27,13 +29,15 @@ class RefundPrepaymentRequest(object): def __init__(self, refund=None, - additional_properties={}): + additional_properties=None): """Constructor for the RefundPrepaymentRequest class""" # Initialize members of the class self.refund = refund # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -51,15 +55,13 @@ def from_dictionary(cls, """ - if dictionary is None: + 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 # Clean out expected properties from dictionary - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, - dictionary) + additional_properties) diff --git a/advancedbilling/models/refund_success.py b/advancedbilling/models/refund_success.py index e1b8abca..b1cc6e6c 100644 --- a/advancedbilling/models/refund_success.py +++ b/advancedbilling/models/refund_success.py @@ -19,6 +19,8 @@ class RefundSuccess(object): refund_id (int): TODO: type description here. gateway_transaction_id (int): TODO: type description here. product_id (int): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -33,7 +35,7 @@ def __init__(self, refund_id=None, gateway_transaction_id=None, product_id=None, - additional_properties={}): + additional_properties=None): """Constructor for the RefundSuccess class""" # Initialize members of the class @@ -42,6 +44,8 @@ def __init__(self, self.product_id = product_id # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -59,7 +63,7 @@ def from_dictionary(cls, """ - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -67,14 +71,12 @@ def from_dictionary(cls, 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 - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, product_id, - dictionary) + additional_properties) @classmethod def validate(cls, dictionary): diff --git a/advancedbilling/models/remove_payment_event.py b/advancedbilling/models/remove_payment_event.py index a87140c7..94097eec 100644 --- a/advancedbilling/models/remove_payment_event.py +++ b/advancedbilling/models/remove_payment_event.py @@ -25,6 +25,8 @@ class RemovePaymentEvent(object): event_type (InvoiceEventType): TODO: type description here. event_data (RemovePaymentEventData): Example schema for an `remove_payment` event + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -43,7 +45,7 @@ def __init__(self, invoice=None, event_type='remove_payment', event_data=None, - additional_properties={}): + additional_properties=None): """Constructor for the RemovePaymentEvent class""" # Initialize members of the class @@ -54,6 +56,8 @@ def __init__(self, self.event_data = event_data # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -71,7 +75,7 @@ def from_dictionary(cls, """ - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -81,16 +85,14 @@ def from_dictionary(cls, 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 - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, invoice, event_type, event_data, - dictionary) + additional_properties) @classmethod def validate(cls, dictionary): diff --git a/advancedbilling/models/remove_payment_event_data.py b/advancedbilling/models/remove_payment_event_data.py index 438f0fc0..15af31fa 100644 --- a/advancedbilling/models/remove_payment_event_data.py +++ b/advancedbilling/models/remove_payment_event_data.py @@ -29,6 +29,8 @@ class RemovePaymentEventData(object): 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. """ @@ -55,7 +57,7 @@ def __init__(self, payment_method=None, prepayment=None, original_amount=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the RemovePaymentEventData class""" # Initialize members of the class @@ -69,6 +71,8 @@ def __init__(self, self.prepayment = prepayment # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -87,7 +91,7 @@ def from_dictionary(cls, """ from advancedbilling.utilities.union_type_lookup import UnionTypeLookUp - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -99,9 +103,7 @@ def from_dictionary(cls, 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 - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, @@ -110,7 +112,7 @@ def from_dictionary(cls, payment_method, prepayment, original_amount, - dictionary) + additional_properties) @classmethod def validate(cls, dictionary): diff --git a/advancedbilling/models/renewal_preview.py b/advancedbilling/models/renewal_preview.py index edac3aab..4aab299a 100644 --- a/advancedbilling/models/renewal_preview.py +++ b/advancedbilling/models/renewal_preview.py @@ -39,6 +39,8 @@ class RenewalPreview(object): 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. """ @@ -77,7 +79,7 @@ def __init__(self, total_amount_due_in_cents=APIHelper.SKIP, uncalculated_taxes=APIHelper.SKIP, line_items=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the RenewalPreview class""" # Initialize members of the class @@ -101,6 +103,8 @@ def __init__(self, self.line_items = line_items # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -118,7 +122,7 @@ def from_dictionary(cls, """ - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -136,9 +140,7 @@ def from_dictionary(cls, else: line_items = APIHelper.SKIP # Clean out expected properties from dictionary - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, @@ -149,4 +151,4 @@ def from_dictionary(cls, total_amount_due_in_cents, uncalculated_taxes, line_items, - dictionary) + additional_properties) diff --git a/advancedbilling/models/renewal_preview_component.py b/advancedbilling/models/renewal_preview_component.py index 0e14b501..89930667 100644 --- a/advancedbilling/models/renewal_preview_component.py +++ b/advancedbilling/models/renewal_preview_component.py @@ -28,6 +28,8 @@ class RenewalPreviewComponent(object): 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. """ @@ -48,7 +50,7 @@ def __init__(self, component_id=APIHelper.SKIP, quantity=APIHelper.SKIP, price_point_id=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the RenewalPreviewComponent class""" # Initialize members of the class @@ -60,6 +62,8 @@ def __init__(self, self.price_point_id = price_point_id # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -78,7 +82,7 @@ def from_dictionary(cls, """ from advancedbilling.utilities.union_type_lookup import UnionTypeLookUp - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -86,11 +90,9 @@ def from_dictionary(cls, 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 - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, price_point_id, - dictionary) + additional_properties) diff --git a/advancedbilling/models/renewal_preview_line_item.py b/advancedbilling/models/renewal_preview_line_item.py index dd91bcb5..b76323d1 100644 --- a/advancedbilling/models/renewal_preview_line_item.py +++ b/advancedbilling/models/renewal_preview_line_item.py @@ -31,6 +31,8 @@ class RenewalPreviewLineItem(object): product_handle (str): TODO: type description here. period_range_start (str): TODO: type description here. period_range_end (str): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -84,7 +86,7 @@ def __init__(self, product_handle=APIHelper.SKIP, period_range_start=APIHelper.SKIP, period_range_end=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the RenewalPreviewLineItem class""" # Initialize members of the class @@ -118,6 +120,8 @@ def __init__(self, self.period_range_end = period_range_end # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -135,7 +139,7 @@ def from_dictionary(cls, """ - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -154,9 +158,7 @@ def from_dictionary(cls, 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 - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, @@ -172,4 +174,4 @@ def from_dictionary(cls, product_handle, period_range_start, period_range_end, - dictionary) + additional_properties) diff --git a/advancedbilling/models/renewal_preview_request.py b/advancedbilling/models/renewal_preview_request.py index 47aeb322..714b5f19 100644 --- a/advancedbilling/models/renewal_preview_request.py +++ b/advancedbilling/models/renewal_preview_request.py @@ -23,6 +23,8 @@ class RenewalPreviewRequest(object): 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. """ @@ -37,7 +39,7 @@ class RenewalPreviewRequest(object): def __init__(self, components=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the RenewalPreviewRequest class""" # Initialize members of the class @@ -45,6 +47,8 @@ def __init__(self, self.components = components # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -62,7 +66,7 @@ def from_dictionary(cls, """ - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -72,9 +76,7 @@ def from_dictionary(cls, else: components = APIHelper.SKIP # Clean out expected properties from dictionary - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, - dictionary) + additional_properties) diff --git a/advancedbilling/models/renewal_preview_response.py b/advancedbilling/models/renewal_preview_response.py index 6b0918b8..5c6592da 100644 --- a/advancedbilling/models/renewal_preview_response.py +++ b/advancedbilling/models/renewal_preview_response.py @@ -17,6 +17,8 @@ class RenewalPreviewResponse(object): Attributes: renewal_preview (RenewalPreview): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -27,13 +29,15 @@ class RenewalPreviewResponse(object): def __init__(self, renewal_preview=None, - additional_properties={}): + additional_properties=None): """Constructor for the RenewalPreviewResponse class""" # Initialize members of the class self.renewal_preview = renewal_preview # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -51,15 +55,13 @@ def from_dictionary(cls, """ - if dictionary is None: + 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 # Clean out expected properties from dictionary - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, - dictionary) + additional_properties) diff --git a/advancedbilling/models/replay_webhooks_request.py b/advancedbilling/models/replay_webhooks_request.py index da6259bf..5b8e4205 100644 --- a/advancedbilling/models/replay_webhooks_request.py +++ b/advancedbilling/models/replay_webhooks_request.py @@ -16,6 +16,8 @@ class ReplayWebhooksRequest(object): Attributes: ids (List[long|int]): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -26,13 +28,15 @@ class ReplayWebhooksRequest(object): def __init__(self, ids=None, - additional_properties={}): + additional_properties=None): """Constructor for the ReplayWebhooksRequest class""" # Initialize members of the class self.ids = ids # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -50,15 +54,13 @@ def from_dictionary(cls, """ - if dictionary is None: + 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 # Clean out expected properties from dictionary - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, - dictionary) + additional_properties) diff --git a/advancedbilling/models/replay_webhooks_response.py b/advancedbilling/models/replay_webhooks_response.py index b2ec8456..d68b3339 100644 --- a/advancedbilling/models/replay_webhooks_response.py +++ b/advancedbilling/models/replay_webhooks_response.py @@ -17,6 +17,8 @@ class ReplayWebhooksResponse(object): Attributes: status (str): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -31,7 +33,7 @@ class ReplayWebhooksResponse(object): def __init__(self, status=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the ReplayWebhooksResponse class""" # Initialize members of the class @@ -39,6 +41,8 @@ def __init__(self, self.status = status # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -56,15 +60,13 @@ def from_dictionary(cls, """ - if dictionary is None: + 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 # Clean out expected properties from dictionary - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, - dictionary) + additional_properties) diff --git a/advancedbilling/models/resent_invitation.py b/advancedbilling/models/resent_invitation.py index 531efc1e..afbce137 100644 --- a/advancedbilling/models/resent_invitation.py +++ b/advancedbilling/models/resent_invitation.py @@ -22,6 +22,8 @@ class ResentInvitation(object): uninvited_count (int): TODO: type description here. last_invite_sent_at (datetime): TODO: type description here. last_invite_accepted_at (datetime): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -51,7 +53,7 @@ def __init__(self, uninvited_count=APIHelper.SKIP, last_invite_sent_at=APIHelper.SKIP, last_invite_accepted_at=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the ResentInvitation class""" # Initialize members of the class @@ -69,6 +71,8 @@ def __init__(self, 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: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -86,7 +90,7 @@ def from_dictionary(cls, """ - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -97,9 +101,7 @@ def from_dictionary(cls, 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 - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, @@ -107,4 +109,4 @@ def from_dictionary(cls, uninvited_count, last_invite_sent_at, last_invite_accepted_at, - dictionary) + additional_properties) diff --git a/advancedbilling/models/resource_type.py b/advancedbilling/models/resource_type.py index 10023125..a2072236 100644 --- a/advancedbilling/models/resource_type.py +++ b/advancedbilling/models/resource_type.py @@ -17,6 +17,8 @@ class ResourceType(object): Attributes: SUBSCRIPTIONS: TODO: type description here. CUSTOMERS: TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ SUBSCRIPTIONS = 'subscriptions' diff --git a/advancedbilling/models/restriction_type.py b/advancedbilling/models/restriction_type.py index 2fa640e5..68e4507d 100644 --- a/advancedbilling/models/restriction_type.py +++ b/advancedbilling/models/restriction_type.py @@ -17,6 +17,8 @@ class RestrictionType(object): Attributes: COMPONENT: TODO: type description here. PRODUCT: TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ COMPONENT = 'Component' diff --git a/advancedbilling/models/resume_options.py b/advancedbilling/models/resume_options.py index 5fe30a8a..2427b60c 100644 --- a/advancedbilling/models/resume_options.py +++ b/advancedbilling/models/resume_options.py @@ -23,6 +23,8 @@ class ResumeOptions(object): 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. """ @@ -40,7 +42,7 @@ class ResumeOptions(object): def __init__(self, require_resume=APIHelper.SKIP, forgive_balance=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the ResumeOptions class""" # Initialize members of the class @@ -50,6 +52,8 @@ def __init__(self, self.forgive_balance = forgive_balance # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -67,20 +71,18 @@ def from_dictionary(cls, """ - if dictionary is None: + 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 # Clean out expected properties from dictionary - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, - dictionary) + additional_properties) @classmethod def validate(cls, dictionary): diff --git a/advancedbilling/models/resumption_charge.py b/advancedbilling/models/resumption_charge.py index 57502d77..5f1be702 100644 --- a/advancedbilling/models/resumption_charge.py +++ b/advancedbilling/models/resumption_charge.py @@ -19,6 +19,8 @@ class ResumptionCharge(object): PRORATED: TODO: type description here. IMMEDIATE: TODO: type description here. DELAYED: TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ _all_values = ['prorated', 'immediate', 'delayed'] diff --git a/advancedbilling/models/revoked_invitation.py b/advancedbilling/models/revoked_invitation.py index 4616e183..3840faaa 100644 --- a/advancedbilling/models/revoked_invitation.py +++ b/advancedbilling/models/revoked_invitation.py @@ -19,6 +19,8 @@ class RevokedInvitation(object): last_sent_at (str): TODO: type description here. last_accepted_at (str): TODO: type description here. uninvited_count (int): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -39,7 +41,7 @@ def __init__(self, last_sent_at=APIHelper.SKIP, last_accepted_at=APIHelper.SKIP, uninvited_count=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the RevokedInvitation class""" # Initialize members of the class @@ -51,6 +53,8 @@ def __init__(self, self.uninvited_count = uninvited_count # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -68,7 +72,7 @@ def from_dictionary(cls, """ - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -76,11 +80,9 @@ def from_dictionary(cls, 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 - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, uninvited_count, - dictionary) + additional_properties) diff --git a/advancedbilling/models/sale_rep.py b/advancedbilling/models/sale_rep.py index b1f6ca62..38029645 100644 --- a/advancedbilling/models/sale_rep.py +++ b/advancedbilling/models/sale_rep.py @@ -22,6 +22,8 @@ class SaleRep(object): subscriptions_count (int): TODO: type description here. test_mode (bool): TODO: type description here. subscriptions (List[SaleRepSubscription]): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -48,7 +50,7 @@ def __init__(self, subscriptions_count=APIHelper.SKIP, test_mode=APIHelper.SKIP, subscriptions=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the SaleRep class""" # Initialize members of the class @@ -64,6 +66,8 @@ def __init__(self, self.subscriptions = subscriptions # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -81,7 +85,7 @@ def from_dictionary(cls, """ - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -95,13 +99,11 @@ def from_dictionary(cls, else: subscriptions = APIHelper.SKIP # Clean out expected properties from dictionary - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, subscriptions_count, test_mode, subscriptions, - dictionary) + additional_properties) diff --git a/advancedbilling/models/sale_rep_item_mrr.py b/advancedbilling/models/sale_rep_item_mrr.py index 38148b90..90f45fed 100644 --- a/advancedbilling/models/sale_rep_item_mrr.py +++ b/advancedbilling/models/sale_rep_item_mrr.py @@ -19,6 +19,8 @@ class SaleRepItemMrr(object): mrr (str): TODO: type description here. usage (str): TODO: type description here. recurring (str): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -39,7 +41,7 @@ def __init__(self, mrr=APIHelper.SKIP, usage=APIHelper.SKIP, recurring=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the SaleRepItemMrr class""" # Initialize members of the class @@ -51,6 +53,8 @@ def __init__(self, self.recurring = recurring # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -68,7 +72,7 @@ def from_dictionary(cls, """ - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -76,11 +80,9 @@ def from_dictionary(cls, 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 - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, recurring, - dictionary) + additional_properties) diff --git a/advancedbilling/models/sale_rep_settings.py b/advancedbilling/models/sale_rep_settings.py index 6fa41920..c3b56a6f 100644 --- a/advancedbilling/models/sale_rep_settings.py +++ b/advancedbilling/models/sale_rep_settings.py @@ -23,6 +23,8 @@ class SaleRepSettings(object): subscription_mrr (str): TODO: type description here. sales_rep_id (int): TODO: type description here. sales_rep_name (str): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -55,7 +57,7 @@ def __init__(self, subscription_mrr=APIHelper.SKIP, sales_rep_id=APIHelper.SKIP, sales_rep_name=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the SaleRepSettings class""" # Initialize members of the class @@ -75,6 +77,8 @@ def __init__(self, self.sales_rep_name = sales_rep_name # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -92,7 +96,7 @@ def from_dictionary(cls, """ - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -104,9 +108,7 @@ def from_dictionary(cls, 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 - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, @@ -115,4 +117,4 @@ def from_dictionary(cls, subscription_mrr, sales_rep_id, sales_rep_name, - dictionary) + additional_properties) diff --git a/advancedbilling/models/sale_rep_subscription.py b/advancedbilling/models/sale_rep_subscription.py index a0dfc2cd..b04ad787 100644 --- a/advancedbilling/models/sale_rep_subscription.py +++ b/advancedbilling/models/sale_rep_subscription.py @@ -26,6 +26,8 @@ class SaleRepSubscription(object): recurring (str): TODO: type description here. last_payment (str): TODO: type description here. churn_date (str): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -71,7 +73,7 @@ def __init__(self, recurring=APIHelper.SKIP, last_payment=APIHelper.SKIP, churn_date=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the SaleRepSubscription class""" # Initialize members of the class @@ -97,6 +99,8 @@ def __init__(self, self.churn_date = churn_date # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -114,7 +118,7 @@ def from_dictionary(cls, """ - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -129,9 +133,7 @@ def from_dictionary(cls, 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 - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, @@ -143,4 +145,4 @@ def from_dictionary(cls, recurring, last_payment, churn_date, - dictionary) + additional_properties) diff --git a/advancedbilling/models/segment.py b/advancedbilling/models/segment.py index 2bf6fae4..ea304919 100644 --- a/advancedbilling/models/segment.py +++ b/advancedbilling/models/segment.py @@ -36,6 +36,8 @@ class Segment(object): created_at (datetime): TODO: type description here. updated_at (datetime): TODO: type description here. prices (List[SegmentPrice]): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -83,7 +85,7 @@ def __init__(self, created_at=APIHelper.SKIP, updated_at=APIHelper.SKIP, prices=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the Segment class""" # Initialize members of the class @@ -113,6 +115,8 @@ def __init__(self, self.prices = prices # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -131,7 +135,7 @@ def from_dictionary(cls, """ from advancedbilling.utilities.union_type_lookup import UnionTypeLookUp - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -152,9 +156,7 @@ def from_dictionary(cls, else: prices = APIHelper.SKIP # Clean out expected properties from dictionary - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, @@ -168,4 +170,4 @@ def from_dictionary(cls, created_at, updated_at, prices, - dictionary) + additional_properties) diff --git a/advancedbilling/models/segment_price.py b/advancedbilling/models/segment_price.py index 72ca9486..4b38ff7b 100644 --- a/advancedbilling/models/segment_price.py +++ b/advancedbilling/models/segment_price.py @@ -24,6 +24,8 @@ class SegmentPrice(object): price_point_id (int): TODO: type description here. formatted_unit_price (str): TODO: type description here. segment_id (int): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -63,7 +65,7 @@ def __init__(self, price_point_id=APIHelper.SKIP, formatted_unit_price=APIHelper.SKIP, segment_id=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the SegmentPrice class""" # Initialize members of the class @@ -85,6 +87,8 @@ def __init__(self, self.segment_id = segment_id # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -102,7 +106,7 @@ def from_dictionary(cls, """ - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -115,9 +119,7 @@ def from_dictionary(cls, 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 - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, @@ -127,7 +129,7 @@ def from_dictionary(cls, price_point_id, formatted_unit_price, segment_id, - dictionary) + additional_properties) @classmethod def validate(cls, dictionary): diff --git a/advancedbilling/models/segment_response.py b/advancedbilling/models/segment_response.py index a2bb32cf..5967e817 100644 --- a/advancedbilling/models/segment_response.py +++ b/advancedbilling/models/segment_response.py @@ -18,6 +18,8 @@ class SegmentResponse(object): Attributes: segment (Segment): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -32,7 +34,7 @@ class SegmentResponse(object): def __init__(self, segment=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the SegmentResponse class""" # Initialize members of the class @@ -40,6 +42,8 @@ def __init__(self, self.segment = segment # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -57,15 +61,13 @@ def from_dictionary(cls, """ - if dictionary is None: + 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 # Clean out expected properties from dictionary - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, - dictionary) + additional_properties) diff --git a/advancedbilling/models/send_invoice_request.py b/advancedbilling/models/send_invoice_request.py index a1eea4f3..9eabf37f 100644 --- a/advancedbilling/models/send_invoice_request.py +++ b/advancedbilling/models/send_invoice_request.py @@ -19,6 +19,8 @@ class SendInvoiceRequest(object): recipient_emails (List[str]): TODO: type description here. cc_recipient_emails (List[str]): TODO: type description here. bcc_recipient_emails (List[str]): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -39,7 +41,7 @@ def __init__(self, recipient_emails=APIHelper.SKIP, cc_recipient_emails=APIHelper.SKIP, bcc_recipient_emails=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the SendInvoiceRequest class""" # Initialize members of the class @@ -51,6 +53,8 @@ def __init__(self, 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 @@ -68,7 +72,7 @@ def from_dictionary(cls, """ - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -76,11 +80,9 @@ def from_dictionary(cls, 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 - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, - dictionary) + additional_properties) diff --git a/advancedbilling/models/service_credit.py b/advancedbilling/models/service_credit.py index e555f46d..22b0e396 100644 --- a/advancedbilling/models/service_credit.py +++ b/advancedbilling/models/service_credit.py @@ -22,6 +22,8 @@ class ServiceCredit(object): 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. """ @@ -48,7 +50,7 @@ def __init__(self, ending_balance_in_cents=APIHelper.SKIP, entry_type=APIHelper.SKIP, memo=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the ServiceCredit class""" # Initialize members of the class @@ -64,6 +66,8 @@ def __init__(self, self.memo = memo # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -81,7 +85,7 @@ def from_dictionary(cls, """ - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -91,13 +95,11 @@ def from_dictionary(cls, 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 - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, ending_balance_in_cents, entry_type, memo, - dictionary) + additional_properties) diff --git a/advancedbilling/models/service_credit_response.py b/advancedbilling/models/service_credit_response.py index 6a9c368e..119db264 100644 --- a/advancedbilling/models/service_credit_response.py +++ b/advancedbilling/models/service_credit_response.py @@ -17,6 +17,8 @@ class ServiceCreditResponse(object): Attributes: service_credit (ServiceCredit): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -27,13 +29,15 @@ class ServiceCreditResponse(object): def __init__(self, service_credit=None, - additional_properties={}): + additional_properties=None): """Constructor for the ServiceCreditResponse class""" # Initialize members of the class self.service_credit = service_credit # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -51,15 +55,13 @@ def from_dictionary(cls, """ - if dictionary is None: + 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 # Clean out expected properties from dictionary - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, - dictionary) + additional_properties) diff --git a/advancedbilling/models/service_credit_type.py b/advancedbilling/models/service_credit_type.py index 7135847e..1492ee64 100644 --- a/advancedbilling/models/service_credit_type.py +++ b/advancedbilling/models/service_credit_type.py @@ -17,6 +17,8 @@ class ServiceCreditType(object): Attributes: CREDIT: TODO: type description here. DEBIT: TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ CREDIT = 'Credit' diff --git a/advancedbilling/models/signup_proforma_preview.py b/advancedbilling/models/signup_proforma_preview.py index bbbe4f63..6a4eebc6 100644 --- a/advancedbilling/models/signup_proforma_preview.py +++ b/advancedbilling/models/signup_proforma_preview.py @@ -20,6 +20,8 @@ class SignupProformaPreview(object): current_proforma_invoice (ProformaInvoice): TODO: type description here. next_proforma_invoice (ProformaInvoice): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -37,7 +39,7 @@ class SignupProformaPreview(object): def __init__(self, current_proforma_invoice=APIHelper.SKIP, next_proforma_invoice=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the SignupProformaPreview class""" # Initialize members of the class @@ -47,6 +49,8 @@ def __init__(self, self.next_proforma_invoice = next_proforma_invoice # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -64,17 +68,15 @@ def from_dictionary(cls, """ - if dictionary is None: + 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 # Clean out expected properties from dictionary - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, - dictionary) + additional_properties) diff --git a/advancedbilling/models/signup_proforma_preview_response.py b/advancedbilling/models/signup_proforma_preview_response.py index 13f71498..846ceb4c 100644 --- a/advancedbilling/models/signup_proforma_preview_response.py +++ b/advancedbilling/models/signup_proforma_preview_response.py @@ -18,6 +18,8 @@ class SignupProformaPreviewResponse(object): Attributes: proforma_invoice_preview (SignupProformaPreview): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -28,13 +30,15 @@ class SignupProformaPreviewResponse(object): def __init__(self, proforma_invoice_preview=None, - additional_properties={}): + additional_properties=None): """Constructor for the SignupProformaPreviewResponse class""" # Initialize members of the class self.proforma_invoice_preview = proforma_invoice_preview # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -52,15 +56,13 @@ def from_dictionary(cls, """ - if dictionary is None: + 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 # Clean out expected properties from dictionary - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, - dictionary) + additional_properties) diff --git a/advancedbilling/models/site.py b/advancedbilling/models/site.py index 9e4a690a..ce82de19 100644 --- a/advancedbilling/models/site.py +++ b/advancedbilling/models/site.py @@ -37,6 +37,8 @@ class Site(object): tax_configuration (TaxConfiguration): TODO: type description here. net_terms (NetTerms): TODO: type description here. test (bool): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -96,7 +98,7 @@ def __init__(self, tax_configuration=APIHelper.SKIP, net_terms=APIHelper.SKIP, test=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the Site class""" # Initialize members of the class @@ -134,6 +136,8 @@ def __init__(self, self.test = test # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -151,7 +155,7 @@ def from_dictionary(cls, """ - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -172,9 +176,7 @@ def from_dictionary(cls, 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 - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, @@ -192,4 +194,4 @@ def from_dictionary(cls, tax_configuration, net_terms, test, - dictionary) + additional_properties) diff --git a/advancedbilling/models/site_response.py b/advancedbilling/models/site_response.py index c357f9b5..69fc6f10 100644 --- a/advancedbilling/models/site_response.py +++ b/advancedbilling/models/site_response.py @@ -17,6 +17,8 @@ class SiteResponse(object): Attributes: site (Site): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -27,13 +29,15 @@ class SiteResponse(object): def __init__(self, site=None, - additional_properties={}): + additional_properties=None): """Constructor for the SiteResponse class""" # Initialize members of the class self.site = site # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -51,15 +55,13 @@ def from_dictionary(cls, """ - if dictionary is None: + 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 # Clean out expected properties from dictionary - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, - dictionary) + additional_properties) diff --git a/advancedbilling/models/site_statistics.py b/advancedbilling/models/site_statistics.py index 5cdabae1..09e0ef6f 100644 --- a/advancedbilling/models/site_statistics.py +++ b/advancedbilling/models/site_statistics.py @@ -27,6 +27,8 @@ class SiteStatistics(object): total_past_due_subscriptions (int): TODO: type description here. total_unpaid_subscriptions (int): TODO: type description here. total_dunning_subscriptions (int): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -71,7 +73,7 @@ def __init__(self, total_past_due_subscriptions=APIHelper.SKIP, total_unpaid_subscriptions=APIHelper.SKIP, total_dunning_subscriptions=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the SiteStatistics class""" # Initialize members of the class @@ -99,6 +101,8 @@ def __init__(self, self.total_dunning_subscriptions = total_dunning_subscriptions # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -116,7 +120,7 @@ def from_dictionary(cls, """ - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -132,9 +136,7 @@ def from_dictionary(cls, 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 - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, @@ -147,4 +149,4 @@ def from_dictionary(cls, total_past_due_subscriptions, total_unpaid_subscriptions, total_dunning_subscriptions, - dictionary) + additional_properties) diff --git a/advancedbilling/models/site_summary.py b/advancedbilling/models/site_summary.py index c384dd98..399eee2c 100644 --- a/advancedbilling/models/site_summary.py +++ b/advancedbilling/models/site_summary.py @@ -22,6 +22,8 @@ class SiteSummary(object): site_id (int): TODO: type description here. site_currency (str): TODO: type description here. stats (SiteStatistics): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -48,7 +50,7 @@ def __init__(self, site_id=APIHelper.SKIP, site_currency=APIHelper.SKIP, stats=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the SiteSummary class""" # Initialize members of the class @@ -64,6 +66,8 @@ def __init__(self, self.stats = stats # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -81,7 +85,7 @@ def from_dictionary(cls, """ - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -91,13 +95,11 @@ def from_dictionary(cls, 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 - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, site_id, site_currency, stats, - dictionary) + additional_properties) diff --git a/advancedbilling/models/snap_day.py b/advancedbilling/models/snap_day.py index 02ecc36a..b18f9e80 100644 --- a/advancedbilling/models/snap_day.py +++ b/advancedbilling/models/snap_day.py @@ -17,6 +17,8 @@ class SnapDay(object): Attributes: END: TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ _all_values = ['end'] diff --git a/advancedbilling/models/sorting_direction.py b/advancedbilling/models/sorting_direction.py index fcabbfaf..b83a72d9 100644 --- a/advancedbilling/models/sorting_direction.py +++ b/advancedbilling/models/sorting_direction.py @@ -17,6 +17,8 @@ class SortingDirection(object): Attributes: ASC: TODO: type description here. DESC: TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ ASC = 'asc' diff --git a/advancedbilling/models/subscription.py b/advancedbilling/models/subscription.py index 8796852a..92656b25 100644 --- a/advancedbilling/models/subscription.py +++ b/advancedbilling/models/subscription.py @@ -231,6 +231,8 @@ class Subscription(object): 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. """ @@ -466,7 +468,7 @@ def __init__(self, prepayment_balance_in_cents=APIHelper.SKIP, prepaid_configuration=APIHelper.SKIP, self_service_page_token=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the Subscription class""" # Initialize members of the class @@ -596,6 +598,8 @@ def __init__(self, self.self_service_page_token = self_service_page_token # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -613,7 +617,7 @@ def from_dictionary(cls, """ - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -726,9 +730,7 @@ def from_dictionary(cls, prepaid_configuration = 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 - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, @@ -792,4 +794,4 @@ def from_dictionary(cls, prepayment_balance_in_cents, prepaid_configuration, self_service_page_token, - dictionary) + additional_properties) diff --git a/advancedbilling/models/subscription_component.py b/advancedbilling/models/subscription_component.py index 16a72d94..d3da60a2 100644 --- a/advancedbilling/models/subscription_component.py +++ b/advancedbilling/models/subscription_component.py @@ -65,6 +65,8 @@ class SubscriptionComponent(object): 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. """ @@ -187,7 +189,7 @@ def __init__(self, display_on_hosted_page=APIHelper.SKIP, interval=APIHelper.SKIP, interval_unit=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the SubscriptionComponent class""" # Initialize members of the class @@ -257,6 +259,8 @@ def __init__(self, self.interval_unit = interval_unit # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -275,7 +279,7 @@ def from_dictionary(cls, """ from advancedbilling.utilities.union_type_lookup import UnionTypeLookUp - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -319,9 +323,7 @@ def from_dictionary(cls, 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 - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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,4 +357,4 @@ def from_dictionary(cls, display_on_hosted_page, interval, interval_unit, - dictionary) + additional_properties) diff --git a/advancedbilling/models/subscription_component_allocation_error_item.py b/advancedbilling/models/subscription_component_allocation_error_item.py index 17db0221..e93d7a9e 100644 --- a/advancedbilling/models/subscription_component_allocation_error_item.py +++ b/advancedbilling/models/subscription_component_allocation_error_item.py @@ -18,6 +18,8 @@ class SubscriptionComponentAllocationErrorItem(object): Attributes: kind (str): TODO: type description here. message (str): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -35,7 +37,7 @@ class SubscriptionComponentAllocationErrorItem(object): def __init__(self, kind=APIHelper.SKIP, message=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the SubscriptionComponentAllocationErrorItem class""" # Initialize members of the class @@ -45,6 +47,8 @@ def __init__(self, self.message = message # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -62,17 +66,15 @@ def from_dictionary(cls, """ - if dictionary is None: + 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 # Clean out expected properties from dictionary - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, - dictionary) + additional_properties) diff --git a/advancedbilling/models/subscription_component_response.py b/advancedbilling/models/subscription_component_response.py index 6d0a6870..eaa96429 100644 --- a/advancedbilling/models/subscription_component_response.py +++ b/advancedbilling/models/subscription_component_response.py @@ -18,6 +18,8 @@ class SubscriptionComponentResponse(object): Attributes: component (SubscriptionComponent): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -32,7 +34,7 @@ class SubscriptionComponentResponse(object): def __init__(self, component=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the SubscriptionComponentResponse class""" # Initialize members of the class @@ -40,6 +42,8 @@ def __init__(self, self.component = component # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -57,15 +61,13 @@ def from_dictionary(cls, """ - if dictionary is None: + 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 # Clean out expected properties from dictionary - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, - dictionary) + additional_properties) diff --git a/advancedbilling/models/subscription_component_subscription.py b/advancedbilling/models/subscription_component_subscription.py index 3f9a0e09..1c36d797 100644 --- a/advancedbilling/models/subscription_component_subscription.py +++ b/advancedbilling/models/subscription_component_subscription.py @@ -83,6 +83,8 @@ class SubscriptionComponentSubscription(object): Subscription-States) for more info about subscription states and state transitions. updated_at (datetime): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -100,7 +102,7 @@ class SubscriptionComponentSubscription(object): def __init__(self, state=APIHelper.SKIP, updated_at=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the SubscriptionComponentSubscription class""" # Initialize members of the class @@ -110,6 +112,8 @@ def __init__(self, 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: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -127,20 +131,18 @@ def from_dictionary(cls, """ - if dictionary is None: + 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 # Clean out expected properties from dictionary - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, - dictionary) + additional_properties) @classmethod def validate(cls, dictionary): diff --git a/advancedbilling/models/subscription_custom_price.py b/advancedbilling/models/subscription_custom_price.py index ee7c2f4a..c930105f 100644 --- a/advancedbilling/models/subscription_custom_price.py +++ b/advancedbilling/models/subscription_custom_price.py @@ -33,6 +33,8 @@ class SubscriptionCustomPrice(object): 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. """ @@ -85,7 +87,7 @@ def __init__(self, expiration_interval=APIHelper.SKIP, expiration_interval_unit=APIHelper.SKIP, tax_included=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the SubscriptionCustomPrice class""" # Initialize members of the class @@ -114,6 +116,8 @@ def __init__(self, self.tax_included = tax_included # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -132,7 +136,7 @@ def from_dictionary(cls, """ from advancedbilling.utilities.union_type_lookup import UnionTypeLookUp - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -150,9 +154,7 @@ def from_dictionary(cls, 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 - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, @@ -167,7 +169,7 @@ def from_dictionary(cls, expiration_interval, expiration_interval_unit, tax_included, - dictionary) + additional_properties) @classmethod def validate(cls, dictionary): diff --git a/advancedbilling/models/subscription_date_field.py b/advancedbilling/models/subscription_date_field.py index 4f25e52e..2b43d1fd 100644 --- a/advancedbilling/models/subscription_date_field.py +++ b/advancedbilling/models/subscription_date_field.py @@ -24,6 +24,8 @@ class SubscriptionDateField(object): TRIAL_STARTED_AT: TODO: type description here. TRIAL_ENDED_AT: TODO: type description here. UPDATED_AT: TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ CURRENT_PERIOD_ENDS_AT = 'current_period_ends_at' diff --git a/advancedbilling/models/subscription_filter.py b/advancedbilling/models/subscription_filter.py index 7ec68553..05753610 100644 --- a/advancedbilling/models/subscription_filter.py +++ b/advancedbilling/models/subscription_filter.py @@ -56,6 +56,8 @@ class SubscriptionFilter(object): 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. """ @@ -85,7 +87,7 @@ def __init__(self, end_date=APIHelper.SKIP, start_datetime=APIHelper.SKIP, end_datetime=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the SubscriptionFilter class""" # Initialize members of the class @@ -103,6 +105,8 @@ def __init__(self, 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: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -120,7 +124,7 @@ def from_dictionary(cls, """ - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -131,9 +135,7 @@ def from_dictionary(cls, 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 - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, @@ -141,4 +143,4 @@ def from_dictionary(cls, end_date, start_datetime, end_datetime, - dictionary) + additional_properties) diff --git a/advancedbilling/models/subscription_group.py b/advancedbilling/models/subscription_group.py index 1b43f780..e170f8ce 100644 --- a/advancedbilling/models/subscription_group.py +++ b/advancedbilling/models/subscription_group.py @@ -27,6 +27,8 @@ class SubscriptionGroup(object): `remittance`, `automatic`, `prepaid`. subscription_ids (List[int]): TODO: type description here. created_at (datetime): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -53,7 +55,7 @@ def __init__(self, payment_collection_method=APIHelper.SKIP, subscription_ids=APIHelper.SKIP, created_at=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the SubscriptionGroup class""" # Initialize members of the class @@ -69,6 +71,8 @@ def __init__(self, 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 @@ -86,7 +90,7 @@ def from_dictionary(cls, """ - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -96,13 +100,11 @@ def from_dictionary(cls, 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 - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, payment_profile, payment_collection_method, subscription_ids, created_at, - dictionary) + additional_properties) diff --git a/advancedbilling/models/subscription_group_balances.py b/advancedbilling/models/subscription_group_balances.py index eec90ce8..447033b7 100644 --- a/advancedbilling/models/subscription_group_balances.py +++ b/advancedbilling/models/subscription_group_balances.py @@ -21,6 +21,8 @@ class SubscriptionGroupBalances(object): service_credits (AccountBalance): TODO: type description here. open_invoices (AccountBalance): TODO: type description here. pending_discounts (AccountBalance): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -44,7 +46,7 @@ def __init__(self, service_credits=APIHelper.SKIP, open_invoices=APIHelper.SKIP, pending_discounts=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the SubscriptionGroupBalances class""" # Initialize members of the class @@ -58,6 +60,8 @@ def __init__(self, self.pending_discounts = pending_discounts # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -75,7 +79,7 @@ def from_dictionary(cls, """ - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -84,12 +88,10 @@ def from_dictionary(cls, 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 - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, open_invoices, pending_discounts, - dictionary) + additional_properties) diff --git a/advancedbilling/models/subscription_group_bank_account.py b/advancedbilling/models/subscription_group_bank_account.py index 7a2d61d5..ada0199b 100644 --- a/advancedbilling/models/subscription_group_bank_account.py +++ b/advancedbilling/models/subscription_group_bank_account.py @@ -43,6 +43,8 @@ class SubscriptionGroupBankAccount(object): current_vault (BankAccountVault): The vault that stores the payment profile with the provided vault_token. Use `bogus` for testing. gateway_handle (str): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -102,7 +104,7 @@ def __init__(self, chargify_token=APIHelper.SKIP, current_vault=APIHelper.SKIP, gateway_handle=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the SubscriptionGroupBankAccount class""" # Initialize members of the class @@ -140,6 +142,8 @@ def __init__(self, self.gateway_handle = gateway_handle # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -157,7 +161,7 @@ def from_dictionary(cls, """ - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -178,9 +182,7 @@ def from_dictionary(cls, 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 - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, @@ -198,7 +200,7 @@ def from_dictionary(cls, chargify_token, current_vault, gateway_handle, - dictionary) + additional_properties) @classmethod def validate(cls, dictionary): diff --git a/advancedbilling/models/subscription_group_component_custom_price.py b/advancedbilling/models/subscription_group_component_custom_price.py index ba3a094e..e909a345 100644 --- a/advancedbilling/models/subscription_group_component_custom_price.py +++ b/advancedbilling/models/subscription_group_component_custom_price.py @@ -26,6 +26,8 @@ class SubscriptionGroupComponentCustomPrice(object): prices (List[Price]): TODO: type description here. overage_pricing (List[ComponentCustomPrice]): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -46,7 +48,7 @@ def __init__(self, pricing_scheme=APIHelper.SKIP, prices=APIHelper.SKIP, overage_pricing=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the SubscriptionGroupComponentCustomPrice class""" # Initialize members of the class @@ -58,6 +60,8 @@ def __init__(self, self.overage_pricing = overage_pricing # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -75,7 +79,7 @@ def from_dictionary(cls, """ - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -91,14 +95,12 @@ def from_dictionary(cls, else: overage_pricing = APIHelper.SKIP # Clean out expected properties from dictionary - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, overage_pricing, - dictionary) + additional_properties) @classmethod def validate(cls, dictionary): diff --git a/advancedbilling/models/subscription_group_credit_card.py b/advancedbilling/models/subscription_group_credit_card.py index a2bf82d5..0d58ee78 100644 --- a/advancedbilling/models/subscription_group_credit_card.py +++ b/advancedbilling/models/subscription_group_credit_card.py @@ -37,6 +37,8 @@ class SubscriptionGroupCreditCard(object): customer_vault_token (str): TODO: type description here. cvv (str): TODO: type description here. payment_type (str): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -108,7 +110,7 @@ def __init__(self, customer_vault_token=APIHelper.SKIP, cvv=APIHelper.SKIP, payment_type=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the SubscriptionGroupCreditCard class""" # Initialize members of the class @@ -154,6 +156,8 @@ def __init__(self, self.payment_type = payment_type # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -172,7 +176,7 @@ def from_dictionary(cls, """ from advancedbilling.utilities.union_type_lookup import UnionTypeLookUp - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -197,9 +201,7 @@ def from_dictionary(cls, 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 - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, @@ -221,7 +223,7 @@ def from_dictionary(cls, customer_vault_token, cvv, payment_type, - dictionary) + additional_properties) @classmethod def validate(cls, dictionary): diff --git a/advancedbilling/models/subscription_group_customer.py b/advancedbilling/models/subscription_group_customer.py index 914ece96..16629247 100644 --- a/advancedbilling/models/subscription_group_customer.py +++ b/advancedbilling/models/subscription_group_customer.py @@ -21,6 +21,8 @@ class SubscriptionGroupCustomer(object): organization (str): TODO: type description here. email (str): TODO: type description here. reference (str): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -47,7 +49,7 @@ def __init__(self, organization=APIHelper.SKIP, email=APIHelper.SKIP, reference=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the SubscriptionGroupCustomer class""" # Initialize members of the class @@ -63,6 +65,8 @@ def __init__(self, self.reference = reference # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -80,7 +84,7 @@ def from_dictionary(cls, """ - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -90,13 +94,11 @@ def from_dictionary(cls, 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 - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, organization, email, reference, - dictionary) + additional_properties) diff --git a/advancedbilling/models/subscription_group_include.py b/advancedbilling/models/subscription_group_include.py index 77a76968..8b5229af 100644 --- a/advancedbilling/models/subscription_group_include.py +++ b/advancedbilling/models/subscription_group_include.py @@ -16,6 +16,8 @@ class SubscriptionGroupInclude(object): Attributes: CURRENT_BILLING_AMOUNT_IN_CENTS: TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ CURRENT_BILLING_AMOUNT_IN_CENTS = 'current_billing_amount_in_cents' diff --git a/advancedbilling/models/subscription_group_item.py b/advancedbilling/models/subscription_group_item.py index a0d018c2..60bbb954 100644 --- a/advancedbilling/models/subscription_group_item.py +++ b/advancedbilling/models/subscription_group_item.py @@ -26,6 +26,8 @@ class SubscriptionGroupItem(object): coupon_code (str): TODO: type description here. total_revenue_in_cents (long|int): TODO: type description here. balance_in_cents (long|int): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -73,7 +75,7 @@ def __init__(self, coupon_code=APIHelper.SKIP, total_revenue_in_cents=APIHelper.SKIP, balance_in_cents=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the SubscriptionGroupItem class""" # Initialize members of the class @@ -99,6 +101,8 @@ def __init__(self, self.balance_in_cents = balance_in_cents # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -116,7 +120,7 @@ def from_dictionary(cls, """ - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -131,9 +135,7 @@ def from_dictionary(cls, 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 - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, @@ -145,4 +147,4 @@ def from_dictionary(cls, coupon_code, total_revenue_in_cents, balance_in_cents, - dictionary) + additional_properties) diff --git a/advancedbilling/models/subscription_group_member_error.py b/advancedbilling/models/subscription_group_member_error.py deleted file mode 100644 index 6d70d162..00000000 --- a/advancedbilling/models/subscription_group_member_error.py +++ /dev/null @@ -1,86 +0,0 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing - -This file was automatically generated for Maxio by APIMATIC v3.0 ( - https://www.apimatic.io ). -""" -from advancedbilling.api_helper import APIHelper - - -class SubscriptionGroupMemberError(object): - - """Implementation of the 'Subscription Group Member Error' model. - - TODO: type model description here. - - Attributes: - id (int): TODO: type description here. - mtype (str): TODO: type description here. - message (str): TODO: type description here. - - """ - - # Create a mapping from Model property names to API property names - _names = { - "id": 'id', - "mtype": 'type', - "message": 'message' - } - - _optionals = [ - 'id', - 'mtype', - 'message', - ] - - def __init__(self, - id=APIHelper.SKIP, - mtype=APIHelper.SKIP, - message=APIHelper.SKIP, - additional_properties={}): - """Constructor for the SubscriptionGroupMemberError class""" - - # Initialize members of the class - if id is not APIHelper.SKIP: - self.id = id - if mtype is not APIHelper.SKIP: - self.mtype = mtype - if message is not APIHelper.SKIP: - self.message = message - - # Add additional model properties to the instance - self.additional_properties = additional_properties - - @classmethod - def from_dictionary(cls, - dictionary): - """Creates 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 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 - message = dictionary.get("message") if dictionary.get("message") else APIHelper.SKIP - # Clean out expected properties from dictionary - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] - # Return an object of this model - return cls(id, - mtype, - message, - dictionary) diff --git a/advancedbilling/models/subscription_group_members_array_error.py b/advancedbilling/models/subscription_group_members_array_error.py index 984048fc..3cfbf5c0 100644 --- a/advancedbilling/models/subscription_group_members_array_error.py +++ b/advancedbilling/models/subscription_group_members_array_error.py @@ -17,6 +17,8 @@ class SubscriptionGroupMembersArrayError(object): Attributes: members (List[str]): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -27,13 +29,15 @@ class SubscriptionGroupMembersArrayError(object): def __init__(self, members=None, - additional_properties={}): + additional_properties=None): """Constructor for the SubscriptionGroupMembersArrayError class""" # Initialize members of the class self.members = members # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -51,18 +55,16 @@ def from_dictionary(cls, """ - if dictionary is None: + 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 # Clean out expected properties from dictionary - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, - dictionary) + additional_properties) @classmethod def validate(cls, dictionary): diff --git a/advancedbilling/models/subscription_group_payment_profile.py b/advancedbilling/models/subscription_group_payment_profile.py index 03ac6d74..f7544c10 100644 --- a/advancedbilling/models/subscription_group_payment_profile.py +++ b/advancedbilling/models/subscription_group_payment_profile.py @@ -20,6 +20,8 @@ class SubscriptionGroupPaymentProfile(object): first_name (str): TODO: type description here. last_name (str): TODO: type description here. masked_card_number (str): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -43,7 +45,7 @@ def __init__(self, first_name=APIHelper.SKIP, last_name=APIHelper.SKIP, masked_card_number=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the SubscriptionGroupPaymentProfile class""" # Initialize members of the class @@ -57,6 +59,8 @@ def __init__(self, self.masked_card_number = masked_card_number # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -74,7 +78,7 @@ def from_dictionary(cls, """ - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -83,12 +87,10 @@ def from_dictionary(cls, 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 - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, last_name, masked_card_number, - dictionary) + additional_properties) diff --git a/advancedbilling/models/subscription_group_prepayment.py b/advancedbilling/models/subscription_group_prepayment.py index e777563c..4b936081 100644 --- a/advancedbilling/models/subscription_group_prepayment.py +++ b/advancedbilling/models/subscription_group_prepayment.py @@ -20,6 +20,8 @@ class SubscriptionGroupPrepayment(object): memo (str): TODO: type description here. method (SubscriptionGroupPrepaymentMethod): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -36,7 +38,7 @@ def __init__(self, details=None, memo=None, method=None, - additional_properties={}): + additional_properties=None): """Constructor for the SubscriptionGroupPrepayment class""" # Initialize members of the class @@ -46,6 +48,8 @@ def __init__(self, self.method = method # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -63,7 +67,7 @@ def from_dictionary(cls, """ - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -72,12 +76,10 @@ def from_dictionary(cls, 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 - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, memo, method, - dictionary) + additional_properties) diff --git a/advancedbilling/models/subscription_group_prepayment_method.py b/advancedbilling/models/subscription_group_prepayment_method.py index a1fe6b8c..b6859093 100644 --- a/advancedbilling/models/subscription_group_prepayment_method.py +++ b/advancedbilling/models/subscription_group_prepayment_method.py @@ -21,6 +21,8 @@ class SubscriptionGroupPrepaymentMethod(object): ACH: TODO: type description here. PAYPAL_ACCOUNT: TODO: type description here. OTHER: TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ CHECK = 'check' diff --git a/advancedbilling/models/subscription_group_prepayment_request.py b/advancedbilling/models/subscription_group_prepayment_request.py index 990772b7..32ef6125 100644 --- a/advancedbilling/models/subscription_group_prepayment_request.py +++ b/advancedbilling/models/subscription_group_prepayment_request.py @@ -17,6 +17,8 @@ class SubscriptionGroupPrepaymentRequest(object): Attributes: prepayment (SubscriptionGroupPrepayment): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -27,13 +29,15 @@ class SubscriptionGroupPrepaymentRequest(object): def __init__(self, prepayment=None, - additional_properties={}): + additional_properties=None): """Constructor for the SubscriptionGroupPrepaymentRequest class""" # Initialize members of the class self.prepayment = prepayment # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -51,15 +55,13 @@ def from_dictionary(cls, """ - if dictionary is None: + 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 # Clean out expected properties from dictionary - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, - dictionary) + additional_properties) diff --git a/advancedbilling/models/subscription_group_prepayment_response.py b/advancedbilling/models/subscription_group_prepayment_response.py index eec9e122..bd72fd16 100644 --- a/advancedbilling/models/subscription_group_prepayment_response.py +++ b/advancedbilling/models/subscription_group_prepayment_response.py @@ -22,6 +22,8 @@ class SubscriptionGroupPrepaymentResponse(object): 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. """ @@ -52,7 +54,7 @@ def __init__(self, ending_balance_in_cents=APIHelper.SKIP, entry_type=APIHelper.SKIP, memo=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the SubscriptionGroupPrepaymentResponse class""" # Initialize members of the class @@ -68,6 +70,8 @@ def __init__(self, self.memo = memo # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -85,7 +89,7 @@ def from_dictionary(cls, """ - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -95,13 +99,11 @@ def from_dictionary(cls, 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 - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, ending_balance_in_cents, entry_type, memo, - dictionary) + additional_properties) diff --git a/advancedbilling/models/subscription_group_response.py b/advancedbilling/models/subscription_group_response.py index d189bf36..c713e8f2 100644 --- a/advancedbilling/models/subscription_group_response.py +++ b/advancedbilling/models/subscription_group_response.py @@ -17,6 +17,8 @@ class SubscriptionGroupResponse(object): Attributes: subscription_group (SubscriptionGroup): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -27,13 +29,15 @@ class SubscriptionGroupResponse(object): def __init__(self, subscription_group=None, - additional_properties={}): + additional_properties=None): """Constructor for the SubscriptionGroupResponse class""" # Initialize members of the class self.subscription_group = subscription_group # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -51,15 +55,13 @@ def from_dictionary(cls, """ - if dictionary is None: + 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 # Clean out expected properties from dictionary - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, - dictionary) + additional_properties) diff --git a/advancedbilling/models/subscription_group_signup.py b/advancedbilling/models/subscription_group_signup.py index 7e73bbe3..7b11ac4e 100644 --- a/advancedbilling/models/subscription_group_signup.py +++ b/advancedbilling/models/subscription_group_signup.py @@ -35,6 +35,8 @@ class SubscriptionGroupSignup(object): description here. subscriptions (List[SubscriptionGroupSignupItem]): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -69,7 +71,7 @@ def __init__(self, payer_attributes=APIHelper.SKIP, credit_card_attributes=APIHelper.SKIP, bank_account_attributes=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the SubscriptionGroupSignup class""" # Initialize members of the class @@ -90,6 +92,8 @@ def __init__(self, self.subscriptions = subscriptions # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -107,7 +111,7 @@ def from_dictionary(cls, """ - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -122,9 +126,7 @@ def from_dictionary(cls, 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 - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, @@ -134,4 +136,4 @@ def from_dictionary(cls, payer_attributes, credit_card_attributes, bank_account_attributes, - dictionary) + additional_properties) diff --git a/advancedbilling/models/subscription_group_signup_component.py b/advancedbilling/models/subscription_group_signup_component.py index 472e24c6..b3b3878e 100644 --- a/advancedbilling/models/subscription_group_signup_component.py +++ b/advancedbilling/models/subscription_group_signup_component.py @@ -25,6 +25,8 @@ class SubscriptionGroupSignupComponent(object): 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. """ @@ -51,7 +53,7 @@ def __init__(self, unit_balance=APIHelper.SKIP, price_point_id=APIHelper.SKIP, custom_price=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the SubscriptionGroupSignupComponent class""" # Initialize members of the class @@ -67,6 +69,8 @@ def __init__(self, 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 @@ -85,7 +89,7 @@ def from_dictionary(cls, """ from advancedbilling.utilities.union_type_lookup import UnionTypeLookUp - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -95,16 +99,14 @@ def from_dictionary(cls, 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 - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, unit_balance, price_point_id, custom_price, - dictionary) + additional_properties) @classmethod def validate(cls, dictionary): diff --git a/advancedbilling/models/subscription_group_signup_error.py b/advancedbilling/models/subscription_group_signup_error.py index 9cdfad73..7740ae36 100644 --- a/advancedbilling/models/subscription_group_signup_error.py +++ b/advancedbilling/models/subscription_group_signup_error.py @@ -26,6 +26,8 @@ class SubscriptionGroupSignupError(object): subscription_group (List[str]): TODO: type description here. payment_profile_id (str): TODO: type description here. payer_id (str): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -55,7 +57,7 @@ def __init__(self, subscription_group=APIHelper.SKIP, payment_profile_id=APIHelper.SKIP, payer_id=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the SubscriptionGroupSignupError class""" # Initialize members of the class @@ -73,6 +75,8 @@ def __init__(self, self.payer_id = payer_id # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -90,7 +94,7 @@ def from_dictionary(cls, """ - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -101,9 +105,7 @@ def from_dictionary(cls, 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 - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, @@ -111,4 +113,4 @@ def from_dictionary(cls, subscription_group, payment_profile_id, payer_id, - dictionary) + additional_properties) diff --git a/advancedbilling/models/subscription_group_signup_failure.py b/advancedbilling/models/subscription_group_signup_event_data.py similarity index 75% rename from advancedbilling/models/subscription_group_signup_failure.py rename to advancedbilling/models/subscription_group_signup_event_data.py index 55917d91..da86b677 100644 --- a/advancedbilling/models/subscription_group_signup_failure.py +++ b/advancedbilling/models/subscription_group_signup_event_data.py @@ -7,19 +7,22 @@ https://www.apimatic.io ). """ from advancedbilling.api_helper import APIHelper +from advancedbilling.models.customer import Customer from advancedbilling.models.subscription_group_signup_failure_data import SubscriptionGroupSignupFailureData -class SubscriptionGroupSignupFailure(object): +class SubscriptionGroupSignupEventData(object): - """Implementation of the 'Subscription Group Signup Failure' model. + """Implementation of the 'Subscription Group Signup Event Data' model. TODO: type model description here. Attributes: subscription_group (SubscriptionGroupSignupFailureData): TODO: type description here. - customer (str): TODO: type description here. + customer (Customer): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -36,14 +39,16 @@ class SubscriptionGroupSignupFailure(object): def __init__(self, subscription_group=None, customer=None, - additional_properties={}): - """Constructor for the SubscriptionGroupSignupFailure class""" + additional_properties=None): + """Constructor for the SubscriptionGroupSignupEventData class""" # Initialize members of the class self.subscription_group = subscription_group self.customer = customer # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -61,20 +66,18 @@ def from_dictionary(cls, """ - if dictionary is None: + 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 = 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 - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, - dictionary) + additional_properties) @classmethod def validate(cls, dictionary): @@ -95,8 +98,9 @@ def validate(cls, dictionary): type_callable=lambda value: SubscriptionGroupSignupFailureData.validate(value), is_model_dict=True) \ and APIHelper.is_valid_type(value=dictionary.customer, - type_callable=lambda value: isinstance(value, str), - is_value_nullable=True) + type_callable=lambda value: Customer.validate(value), + is_value_nullable=True, + is_model_dict=True) if not isinstance(dictionary, dict): return False @@ -105,5 +109,6 @@ def validate(cls, dictionary): type_callable=lambda value: SubscriptionGroupSignupFailureData.validate(value), is_model_dict=True) \ and APIHelper.is_valid_type(value=dictionary.get('customer'), - type_callable=lambda value: isinstance(value, str), - is_value_nullable=True) + type_callable=lambda value: Customer.validate(value), + is_value_nullable=True, + is_model_dict=True) diff --git a/advancedbilling/models/subscription_group_signup_failure_data.py b/advancedbilling/models/subscription_group_signup_failure_data.py index 4d97f303..b99ae1c8 100644 --- a/advancedbilling/models/subscription_group_signup_failure_data.py +++ b/advancedbilling/models/subscription_group_signup_failure_data.py @@ -31,6 +31,8 @@ class SubscriptionGroupSignupFailureData(object): description here. subscriptions (List[SubscriptionGroupSignupItem]): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -66,7 +68,7 @@ def __init__(self, credit_card_attributes=APIHelper.SKIP, bank_account_attributes=APIHelper.SKIP, subscriptions=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the SubscriptionGroupSignupFailureData class""" # Initialize members of the class @@ -88,6 +90,8 @@ def __init__(self, self.subscriptions = subscriptions # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -105,7 +109,7 @@ def from_dictionary(cls, """ - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -122,9 +126,7 @@ def from_dictionary(cls, else: subscriptions = APIHelper.SKIP # Clean out expected properties from dictionary - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, @@ -134,7 +136,7 @@ def from_dictionary(cls, credit_card_attributes, bank_account_attributes, subscriptions, - dictionary) + additional_properties) @classmethod def validate(cls, dictionary): diff --git a/advancedbilling/models/subscription_group_signup_item.py b/advancedbilling/models/subscription_group_signup_item.py index 222c57e5..f46e14c2 100644 --- a/advancedbilling/models/subscription_group_signup_item.py +++ b/advancedbilling/models/subscription_group_signup_item.py @@ -54,6 +54,8 @@ class SubscriptionGroupSignupItem(object): 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. """ @@ -104,7 +106,7 @@ def __init__(self, custom_price=APIHelper.SKIP, calendar_billing=APIHelper.SKIP, metafields=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the SubscriptionGroupSignupItem class""" # Initialize members of the class @@ -136,6 +138,8 @@ def __init__(self, self.metafields = metafields # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -153,7 +157,7 @@ def from_dictionary(cls, """ - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -175,9 +179,7 @@ def from_dictionary(cls, 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 - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, @@ -192,7 +194,7 @@ def from_dictionary(cls, custom_price, calendar_billing, metafields, - dictionary) + additional_properties) @classmethod def validate(cls, dictionary): diff --git a/advancedbilling/models/subscription_group_signup_request.py b/advancedbilling/models/subscription_group_signup_request.py index c253c324..7d24b42d 100644 --- a/advancedbilling/models/subscription_group_signup_request.py +++ b/advancedbilling/models/subscription_group_signup_request.py @@ -18,6 +18,8 @@ class SubscriptionGroupSignupRequest(object): Attributes: subscription_group (SubscriptionGroupSignup): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -28,13 +30,15 @@ class SubscriptionGroupSignupRequest(object): def __init__(self, subscription_group=None, - additional_properties={}): + additional_properties=None): """Constructor for the SubscriptionGroupSignupRequest class""" # Initialize members of the class self.subscription_group = subscription_group # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -52,15 +56,13 @@ def from_dictionary(cls, """ - if dictionary is None: + 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 # Clean out expected properties from dictionary - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, - dictionary) + additional_properties) diff --git a/advancedbilling/models/subscription_group_signup_response.py b/advancedbilling/models/subscription_group_signup_response.py index 0f981951..c2e31fba 100644 --- a/advancedbilling/models/subscription_group_signup_response.py +++ b/advancedbilling/models/subscription_group_signup_response.py @@ -97,6 +97,8 @@ class SubscriptionGroupSignupResponse(object): 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. """ @@ -141,7 +143,7 @@ def __init__(self, cancel_at_end_of_period=APIHelper.SKIP, subscriptions=APIHelper.SKIP, payment_collection_method=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the SubscriptionGroupSignupResponse class""" # Initialize members of the class @@ -169,6 +171,8 @@ def __init__(self, self.payment_collection_method = payment_collection_method # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -186,7 +190,7 @@ def from_dictionary(cls, """ - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -206,9 +210,7 @@ def from_dictionary(cls, subscriptions = 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 - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, @@ -221,4 +223,4 @@ def from_dictionary(cls, cancel_at_end_of_period, subscriptions, payment_collection_method, - dictionary) + additional_properties) diff --git a/advancedbilling/models/subscription_group_signup_success.py b/advancedbilling/models/subscription_group_signup_success.py deleted file mode 100644 index 6d2e3208..00000000 --- a/advancedbilling/models/subscription_group_signup_success.py +++ /dev/null @@ -1,106 +0,0 @@ -# -*- coding: utf-8 -*- - -""" -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.models.customer import Customer -from advancedbilling.models.subscription_group_signup_success_data import SubscriptionGroupSignupSuccessData - - -class SubscriptionGroupSignupSuccess(object): - - """Implementation of the 'Subscription Group Signup Success' model. - - TODO: type model description here. - - Attributes: - subscription_group (SubscriptionGroupSignupSuccessData): TODO: type - description here. - customer (Customer): TODO: type description here. - - """ - - # Create a mapping from Model property names to API property names - _names = { - "subscription_group": 'subscription_group', - "customer": 'customer' - } - - def __init__(self, - subscription_group=None, - customer=None, - additional_properties={}): - """Constructor for the SubscriptionGroupSignupSuccess class""" - - # Initialize members of the class - self.subscription_group = subscription_group - self.customer = customer - - # Add additional model properties to the instance - self.additional_properties = additional_properties - - @classmethod - def from_dictionary(cls, - dictionary): - """Creates 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 dictionary is None: - return None - - # Extract variables from the dictionary - subscription_group = SubscriptionGroupSignupSuccessData.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 - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] - # Return an object of this model - return cls(subscription_group, - customer, - dictionary) - - @classmethod - def validate(cls, dictionary): - """Validates 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.subscription_group, - type_callable=lambda value: SubscriptionGroupSignupSuccessData.validate(value), - is_model_dict=True) \ - and APIHelper.is_valid_type(value=dictionary.customer, - type_callable=lambda value: Customer.validate(value), - 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: SubscriptionGroupSignupSuccessData.validate(value), - is_model_dict=True) \ - and APIHelper.is_valid_type(value=dictionary.get('customer'), - type_callable=lambda value: Customer.validate(value), - is_model_dict=True) diff --git a/advancedbilling/models/subscription_group_signup_success_data.py b/advancedbilling/models/subscription_group_signup_success_data.py deleted file mode 100644 index 8616c873..00000000 --- a/advancedbilling/models/subscription_group_signup_success_data.py +++ /dev/null @@ -1,169 +0,0 @@ -# -*- coding: utf-8 -*- - -""" -advanced_billing - -This file was automatically generated for Maxio by APIMATIC v3.0 ( - https://www.apimatic.io ). -""" -from advancedbilling.api_helper import APIHelper - - -class SubscriptionGroupSignupSuccessData(object): - - """Implementation of the 'Subscription Group Signup Success Data' model. - - TODO: type model description here. - - Attributes: - uid (str): TODO: type description here. - scheme (int): TODO: type description here. - customer_id (int): TODO: type description here. - payment_profile_id (int): TODO: type description here. - subscription_ids (List[int]): TODO: type description here. - primary_subscription_id (int): TODO: type description here. - next_assessment_at (datetime): TODO: type description here. - state (str): TODO: type description here. - cancel_at_end_of_period (bool): TODO: type description here. - - """ - - # 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' - } - - def __init__(self, - uid=None, - scheme=None, - customer_id=None, - payment_profile_id=None, - subscription_ids=None, - primary_subscription_id=None, - next_assessment_at=None, - state=None, - cancel_at_end_of_period=None, - additional_properties={}): - """Constructor for the SubscriptionGroupSignupSuccessData class""" - - # Initialize members of the class - self.uid = uid - self.scheme = scheme - self.customer_id = customer_id - self.payment_profile_id = payment_profile_id - self.subscription_ids = subscription_ids - self.primary_subscription_id = primary_subscription_id - self.next_assessment_at = APIHelper.apply_datetime_converter(next_assessment_at, APIHelper.RFC3339DateTime) if next_assessment_at else None - self.state = state - self.cancel_at_end_of_period = cancel_at_end_of_period - - # Add additional model properties to the instance - self.additional_properties = additional_properties - - @classmethod - def from_dictionary(cls, - dictionary): - """Creates 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 dictionary is None: - return None - - # Extract variables from the dictionary - uid = dictionary.get("uid") if dictionary.get("uid") else None - scheme = dictionary.get("scheme") if dictionary.get("scheme") else None - customer_id = dictionary.get("customer_id") if dictionary.get("customer_id") else None - payment_profile_id = dictionary.get("payment_profile_id") if dictionary.get("payment_profile_id") else None - subscription_ids = dictionary.get("subscription_ids") if dictionary.get("subscription_ids") else None - primary_subscription_id = dictionary.get("primary_subscription_id") if dictionary.get("primary_subscription_id") else None - next_assessment_at = APIHelper.RFC3339DateTime.from_value(dictionary.get("next_assessment_at")).datetime if dictionary.get("next_assessment_at") else None - state = dictionary.get("state") if dictionary.get("state") else None - cancel_at_end_of_period = dictionary.get("cancel_at_end_of_period") if "cancel_at_end_of_period" in dictionary.keys() else None - # Clean out expected properties from dictionary - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] - # Return an object of this model - return cls(uid, - scheme, - customer_id, - payment_profile_id, - subscription_ids, - primary_subscription_id, - next_assessment_at, - state, - cancel_at_end_of_period, - dictionary) - - @classmethod - def validate(cls, dictionary): - """Validates 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.uid, - type_callable=lambda value: isinstance(value, str)) \ - and APIHelper.is_valid_type(value=dictionary.scheme, - type_callable=lambda value: isinstance(value, int)) \ - and APIHelper.is_valid_type(value=dictionary.customer_id, - type_callable=lambda value: isinstance(value, int)) \ - and APIHelper.is_valid_type(value=dictionary.payment_profile_id, - type_callable=lambda value: isinstance(value, int)) \ - and APIHelper.is_valid_type(value=dictionary.subscription_ids, - type_callable=lambda value: isinstance(value, int)) \ - and APIHelper.is_valid_type(value=dictionary.primary_subscription_id, - type_callable=lambda value: isinstance(value, int)) \ - and APIHelper.is_valid_type(value=dictionary.next_assessment_at, - type_callable=lambda value: isinstance(value, APIHelper.RFC3339DateTime)) \ - and APIHelper.is_valid_type(value=dictionary.state, - type_callable=lambda value: isinstance(value, str)) \ - and APIHelper.is_valid_type(value=dictionary.cancel_at_end_of_period, - type_callable=lambda value: isinstance(value, bool)) - - 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('scheme'), - type_callable=lambda value: isinstance(value, int)) \ - and APIHelper.is_valid_type(value=dictionary.get('customer_id'), - type_callable=lambda value: isinstance(value, int)) \ - and APIHelper.is_valid_type(value=dictionary.get('payment_profile_id'), - type_callable=lambda value: isinstance(value, int)) \ - and APIHelper.is_valid_type(value=dictionary.get('subscription_ids'), - type_callable=lambda value: isinstance(value, int)) \ - and APIHelper.is_valid_type(value=dictionary.get('primary_subscription_id'), - type_callable=lambda value: isinstance(value, int)) \ - and APIHelper.is_valid_type(value=dictionary.get('next_assessment_at'), - type_callable=lambda value: isinstance(value, str)) \ - and APIHelper.is_valid_type(value=dictionary.get('state'), - type_callable=lambda value: isinstance(value, str)) \ - and APIHelper.is_valid_type(value=dictionary.get('cancel_at_end_of_period'), - type_callable=lambda value: isinstance(value, bool)) diff --git a/advancedbilling/models/subscription_group_single_error.py b/advancedbilling/models/subscription_group_single_error.py index 70711aa4..067379cb 100644 --- a/advancedbilling/models/subscription_group_single_error.py +++ b/advancedbilling/models/subscription_group_single_error.py @@ -17,6 +17,8 @@ class SubscriptionGroupSingleError(object): Attributes: subscription_group (str): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -27,13 +29,15 @@ class SubscriptionGroupSingleError(object): def __init__(self, subscription_group=None, - additional_properties={}): + additional_properties=None): """Constructor for the SubscriptionGroupSingleError class""" # Initialize members of the class self.subscription_group = subscription_group # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -51,18 +55,16 @@ def from_dictionary(cls, """ - if dictionary is None: + 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 # Clean out expected properties from dictionary - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, - dictionary) + additional_properties) @classmethod def validate(cls, dictionary): diff --git a/advancedbilling/models/subscription_group_subscription_error.py b/advancedbilling/models/subscription_group_subscription_error.py index dd8ac81d..b38ab3e6 100644 --- a/advancedbilling/models/subscription_group_subscription_error.py +++ b/advancedbilling/models/subscription_group_subscription_error.py @@ -27,6 +27,8 @@ class SubscriptionGroupSubscriptionError(object): payment_profile_expiration_year (List[str]): TODO: type description here. payment_profile_full_number (List[str]): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -62,7 +64,7 @@ def __init__(self, payment_profile_expiration_month=APIHelper.SKIP, payment_profile_expiration_year=APIHelper.SKIP, payment_profile_full_number=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the SubscriptionGroupSubscriptionError class""" # Initialize members of the class @@ -84,6 +86,8 @@ def __init__(self, self.payment_profile_full_number = payment_profile_full_number # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -101,7 +105,7 @@ def from_dictionary(cls, """ - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -114,9 +118,7 @@ def from_dictionary(cls, 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 - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, @@ -126,4 +128,4 @@ def from_dictionary(cls, payment_profile_expiration_month, payment_profile_expiration_year, payment_profile_full_number, - dictionary) + additional_properties) diff --git a/advancedbilling/models/subscription_group_update_error.py b/advancedbilling/models/subscription_group_update_error.py index 9433347e..b80df3cc 100644 --- a/advancedbilling/models/subscription_group_update_error.py +++ b/advancedbilling/models/subscription_group_update_error.py @@ -7,7 +7,6 @@ https://www.apimatic.io ). """ from advancedbilling.api_helper import APIHelper -from advancedbilling.models.subscription_group_member_error import SubscriptionGroupMemberError class SubscriptionGroupUpdateError(object): @@ -17,8 +16,9 @@ class SubscriptionGroupUpdateError(object): TODO: type model description here. Attributes: - members (List[SubscriptionGroupMemberError]): TODO: type description - here. + members (List[str]): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -33,7 +33,7 @@ class SubscriptionGroupUpdateError(object): def __init__(self, members=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the SubscriptionGroupUpdateError class""" # Initialize members of the class @@ -41,6 +41,8 @@ def __init__(self, self.members = members # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -58,19 +60,13 @@ def from_dictionary(cls, """ - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - members = None - if dictionary.get('members') is not None: - members = [SubscriptionGroupMemberError.from_dictionary(x) for x in dictionary.get('members')] - else: - members = APIHelper.SKIP + members = dictionary.get("members") if dictionary.get("members") else APIHelper.SKIP # Clean out expected properties from dictionary - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, - dictionary) + additional_properties) diff --git a/advancedbilling/models/subscription_groups_list_include.py b/advancedbilling/models/subscription_groups_list_include.py index b8d64fc5..9cd343c6 100644 --- a/advancedbilling/models/subscription_groups_list_include.py +++ b/advancedbilling/models/subscription_groups_list_include.py @@ -16,6 +16,8 @@ class SubscriptionGroupsListInclude(object): Attributes: ACCOUNT_BALANCES: TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ ACCOUNT_BALANCES = 'account_balances' diff --git a/advancedbilling/models/subscription_include.py b/advancedbilling/models/subscription_include.py index 4707cf5d..9cb45403 100644 --- a/advancedbilling/models/subscription_include.py +++ b/advancedbilling/models/subscription_include.py @@ -17,6 +17,8 @@ class SubscriptionInclude(object): Attributes: COUPONS: TODO: type description here. SELF_SERVICE_PAGE_TOKEN: TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ COUPONS = 'coupons' diff --git a/advancedbilling/models/subscription_included_coupon.py b/advancedbilling/models/subscription_included_coupon.py index ca12baa2..5dc85e06 100644 --- a/advancedbilling/models/subscription_included_coupon.py +++ b/advancedbilling/models/subscription_included_coupon.py @@ -23,6 +23,8 @@ class SubscriptionIncludedCoupon(object): recurring (bool): TODO: type description here. amount_in_cents (long|int): TODO: type description here. percentage (str): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -61,7 +63,7 @@ def __init__(self, recurring=APIHelper.SKIP, amount_in_cents=APIHelper.SKIP, percentage=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the SubscriptionIncludedCoupon class""" # Initialize members of the class @@ -81,6 +83,8 @@ def __init__(self, self.percentage = percentage # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -98,7 +102,7 @@ def from_dictionary(cls, """ - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -110,9 +114,7 @@ def from_dictionary(cls, 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 - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, @@ -121,4 +123,4 @@ def from_dictionary(cls, recurring, amount_in_cents, percentage, - dictionary) + additional_properties) diff --git a/advancedbilling/models/subscription_list_date_field.py b/advancedbilling/models/subscription_list_date_field.py index 17c933c6..2005faf3 100644 --- a/advancedbilling/models/subscription_list_date_field.py +++ b/advancedbilling/models/subscription_list_date_field.py @@ -16,6 +16,8 @@ class SubscriptionListDateField(object): Attributes: UPDATED_AT: TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ UPDATED_AT = 'updated_at' diff --git a/advancedbilling/models/subscription_list_include.py b/advancedbilling/models/subscription_list_include.py index 623adbd7..77f60cbb 100644 --- a/advancedbilling/models/subscription_list_include.py +++ b/advancedbilling/models/subscription_list_include.py @@ -16,6 +16,8 @@ class SubscriptionListInclude(object): Attributes: SELF_SERVICE_PAGE_TOKEN: TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ SELF_SERVICE_PAGE_TOKEN = 'self_service_page_token' diff --git a/advancedbilling/models/subscription_migration_preview.py b/advancedbilling/models/subscription_migration_preview.py index 554f06c2..323b7b87 100644 --- a/advancedbilling/models/subscription_migration_preview.py +++ b/advancedbilling/models/subscription_migration_preview.py @@ -26,6 +26,8 @@ class SubscriptionMigrationPreview(object): 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. """ @@ -49,7 +51,7 @@ def __init__(self, charge_in_cents=APIHelper.SKIP, payment_due_in_cents=APIHelper.SKIP, credit_applied_in_cents=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the SubscriptionMigrationPreview class""" # Initialize members of the class @@ -63,6 +65,8 @@ def __init__(self, self.credit_applied_in_cents = credit_applied_in_cents # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -80,7 +84,7 @@ def from_dictionary(cls, """ - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -89,12 +93,10 @@ def from_dictionary(cls, 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 - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, payment_due_in_cents, credit_applied_in_cents, - dictionary) + additional_properties) diff --git a/advancedbilling/models/subscription_migration_preview_options.py b/advancedbilling/models/subscription_migration_preview_options.py index eea78304..936235d1 100644 --- a/advancedbilling/models/subscription_migration_preview_options.py +++ b/advancedbilling/models/subscription_migration_preview_options.py @@ -50,6 +50,8 @@ class SubscriptionMigrationPreviewOptions(object): proration (Proration): TODO: type description here. 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. """ @@ -91,7 +93,7 @@ def __init__(self, product_price_point_handle=APIHelper.SKIP, proration=APIHelper.SKIP, proration_date=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the SubscriptionMigrationPreviewOptions class""" # Initialize members of the class @@ -113,6 +115,8 @@ def __init__(self, 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: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -130,7 +134,7 @@ def from_dictionary(cls, """ - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -145,9 +149,7 @@ def from_dictionary(cls, 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 - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, @@ -159,4 +161,4 @@ def from_dictionary(cls, product_price_point_handle, proration, proration_date, - dictionary) + additional_properties) diff --git a/advancedbilling/models/subscription_migration_preview_request.py b/advancedbilling/models/subscription_migration_preview_request.py index 5c188e0c..750a1cbc 100644 --- a/advancedbilling/models/subscription_migration_preview_request.py +++ b/advancedbilling/models/subscription_migration_preview_request.py @@ -18,6 +18,8 @@ class SubscriptionMigrationPreviewRequest(object): Attributes: migration (SubscriptionMigrationPreviewOptions): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -28,13 +30,15 @@ class SubscriptionMigrationPreviewRequest(object): def __init__(self, migration=None, - additional_properties={}): + additional_properties=None): """Constructor for the SubscriptionMigrationPreviewRequest class""" # Initialize members of the class self.migration = migration # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -52,15 +56,13 @@ def from_dictionary(cls, """ - if dictionary is None: + 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 # Clean out expected properties from dictionary - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, - dictionary) + additional_properties) diff --git a/advancedbilling/models/subscription_migration_preview_response.py b/advancedbilling/models/subscription_migration_preview_response.py index 67a0a6c2..cbd73226 100644 --- a/advancedbilling/models/subscription_migration_preview_response.py +++ b/advancedbilling/models/subscription_migration_preview_response.py @@ -17,6 +17,8 @@ class SubscriptionMigrationPreviewResponse(object): Attributes: migration (SubscriptionMigrationPreview): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -27,13 +29,15 @@ class SubscriptionMigrationPreviewResponse(object): def __init__(self, migration=None, - additional_properties={}): + additional_properties=None): """Constructor for the SubscriptionMigrationPreviewResponse class""" # Initialize members of the class self.migration = migration # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -51,15 +55,13 @@ def from_dictionary(cls, """ - if dictionary is None: + 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 # Clean out expected properties from dictionary - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, - dictionary) + additional_properties) diff --git a/advancedbilling/models/subscription_mrr.py b/advancedbilling/models/subscription_mrr.py index 20f92816..66b02f49 100644 --- a/advancedbilling/models/subscription_mrr.py +++ b/advancedbilling/models/subscription_mrr.py @@ -20,6 +20,8 @@ class SubscriptionMRR(object): subscription_id (int): TODO: type description here. mrr_amount_in_cents (long|int): TODO: type description here. breakouts (SubscriptionMRRBreakout): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -38,7 +40,7 @@ def __init__(self, subscription_id=None, mrr_amount_in_cents=None, breakouts=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the SubscriptionMRR class""" # Initialize members of the class @@ -48,6 +50,8 @@ def __init__(self, self.breakouts = breakouts # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -65,7 +69,7 @@ def from_dictionary(cls, """ - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -73,11 +77,9 @@ def from_dictionary(cls, 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 - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, breakouts, - dictionary) + additional_properties) diff --git a/advancedbilling/models/subscription_mrr_breakout.py b/advancedbilling/models/subscription_mrr_breakout.py index 8279784c..4d56f28f 100644 --- a/advancedbilling/models/subscription_mrr_breakout.py +++ b/advancedbilling/models/subscription_mrr_breakout.py @@ -17,6 +17,8 @@ class SubscriptionMRRBreakout(object): Attributes: plan_amount_in_cents (long|int): TODO: type description here. usage_amount_in_cents (long|int): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -29,7 +31,7 @@ class SubscriptionMRRBreakout(object): def __init__(self, plan_amount_in_cents=None, usage_amount_in_cents=None, - additional_properties={}): + additional_properties=None): """Constructor for the SubscriptionMRRBreakout class""" # Initialize members of the class @@ -37,6 +39,8 @@ def __init__(self, self.usage_amount_in_cents = usage_amount_in_cents # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -54,17 +58,15 @@ def from_dictionary(cls, """ - if dictionary is None: + 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 # Clean out expected properties from dictionary - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, - dictionary) + additional_properties) diff --git a/advancedbilling/models/subscription_mrr_response.py b/advancedbilling/models/subscription_mrr_response.py index a3434cdc..cf17369d 100644 --- a/advancedbilling/models/subscription_mrr_response.py +++ b/advancedbilling/models/subscription_mrr_response.py @@ -17,6 +17,8 @@ class SubscriptionMRRResponse(object): Attributes: subscriptions_mrr (List[SubscriptionMRR]): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -27,13 +29,15 @@ class SubscriptionMRRResponse(object): def __init__(self, subscriptions_mrr=None, - additional_properties={}): + additional_properties=None): """Constructor for the SubscriptionMRRResponse class""" # Initialize members of the class self.subscriptions_mrr = subscriptions_mrr # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -51,7 +55,7 @@ def from_dictionary(cls, """ - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -59,9 +63,7 @@ def from_dictionary(cls, 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 - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, - dictionary) + additional_properties) diff --git a/advancedbilling/models/subscription_note.py b/advancedbilling/models/subscription_note.py index 671f0cd0..df796f01 100644 --- a/advancedbilling/models/subscription_note.py +++ b/advancedbilling/models/subscription_note.py @@ -22,6 +22,8 @@ class SubscriptionNote(object): created_at (datetime): TODO: type description here. updated_at (datetime): TODO: type description here. sticky (bool): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -51,7 +53,7 @@ def __init__(self, created_at=APIHelper.SKIP, updated_at=APIHelper.SKIP, sticky=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the SubscriptionNote class""" # Initialize members of the class @@ -69,6 +71,8 @@ def __init__(self, self.sticky = sticky # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -86,7 +90,7 @@ def from_dictionary(cls, """ - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -97,9 +101,7 @@ def from_dictionary(cls, 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 - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, @@ -107,4 +109,4 @@ def from_dictionary(cls, created_at, updated_at, sticky, - dictionary) + additional_properties) diff --git a/advancedbilling/models/subscription_note_response.py b/advancedbilling/models/subscription_note_response.py index 72d4ce5f..1eb6e790 100644 --- a/advancedbilling/models/subscription_note_response.py +++ b/advancedbilling/models/subscription_note_response.py @@ -17,6 +17,8 @@ class SubscriptionNoteResponse(object): Attributes: note (SubscriptionNote): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -27,13 +29,15 @@ class SubscriptionNoteResponse(object): def __init__(self, note=None, - additional_properties={}): + additional_properties=None): """Constructor for the SubscriptionNoteResponse class""" # Initialize members of the class self.note = note # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -51,15 +55,13 @@ def from_dictionary(cls, """ - if dictionary is None: + 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 # Clean out expected properties from dictionary - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, - dictionary) + additional_properties) diff --git a/advancedbilling/models/subscription_preview.py b/advancedbilling/models/subscription_preview.py index 89fec5b1..b0fd248f 100644 --- a/advancedbilling/models/subscription_preview.py +++ b/advancedbilling/models/subscription_preview.py @@ -20,6 +20,8 @@ class SubscriptionPreview(object): current_billing_manifest (BillingManifest): TODO: type description here. next_billing_manifest (BillingManifest): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -37,7 +39,7 @@ class SubscriptionPreview(object): def __init__(self, current_billing_manifest=APIHelper.SKIP, next_billing_manifest=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the SubscriptionPreview class""" # Initialize members of the class @@ -47,6 +49,8 @@ def __init__(self, self.next_billing_manifest = next_billing_manifest # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -64,17 +68,15 @@ def from_dictionary(cls, """ - if dictionary is None: + 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 # Clean out expected properties from dictionary - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, - dictionary) + additional_properties) diff --git a/advancedbilling/models/subscription_preview_response.py b/advancedbilling/models/subscription_preview_response.py index 992489b6..4ae90968 100644 --- a/advancedbilling/models/subscription_preview_response.py +++ b/advancedbilling/models/subscription_preview_response.py @@ -18,6 +18,8 @@ class SubscriptionPreviewResponse(object): Attributes: subscription_preview (SubscriptionPreview): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -28,13 +30,15 @@ class SubscriptionPreviewResponse(object): def __init__(self, subscription_preview=None, - additional_properties={}): + additional_properties=None): """Constructor for the SubscriptionPreviewResponse class""" # Initialize members of the class self.subscription_preview = subscription_preview # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -52,15 +56,13 @@ def from_dictionary(cls, """ - if dictionary is None: + 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 # Clean out expected properties from dictionary - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, - dictionary) + additional_properties) diff --git a/advancedbilling/models/subscription_product_change.py b/advancedbilling/models/subscription_product_change.py index 0e8b0a87..a4b9463c 100644 --- a/advancedbilling/models/subscription_product_change.py +++ b/advancedbilling/models/subscription_product_change.py @@ -18,6 +18,8 @@ class SubscriptionProductChange(object): Attributes: previous_product_id (int): TODO: type description here. new_product_id (int): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -30,7 +32,7 @@ class SubscriptionProductChange(object): def __init__(self, previous_product_id=None, new_product_id=None, - additional_properties={}): + additional_properties=None): """Constructor for the SubscriptionProductChange class""" # Initialize members of the class @@ -38,6 +40,8 @@ def __init__(self, self.new_product_id = new_product_id # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -55,20 +59,18 @@ def from_dictionary(cls, """ - if dictionary is None: + 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 # Clean out expected properties from dictionary - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, - dictionary) + additional_properties) @classmethod def validate(cls, dictionary): diff --git a/advancedbilling/models/subscription_product_migration.py b/advancedbilling/models/subscription_product_migration.py index 73a61f70..40a9ffec 100644 --- a/advancedbilling/models/subscription_product_migration.py +++ b/advancedbilling/models/subscription_product_migration.py @@ -48,6 +48,8 @@ class SubscriptionProductMigration(object): product's price point. This can be passed to migrate to a non-default price point. proration (Proration): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -86,7 +88,7 @@ def __init__(self, product_handle=APIHelper.SKIP, product_price_point_handle=APIHelper.SKIP, proration=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the SubscriptionProductMigration class""" # Initialize members of the class @@ -106,6 +108,8 @@ def __init__(self, self.proration = proration # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -123,7 +127,7 @@ def from_dictionary(cls, """ - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -137,9 +141,7 @@ def from_dictionary(cls, 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 - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, @@ -150,4 +152,4 @@ def from_dictionary(cls, product_handle, product_price_point_handle, proration, - dictionary) + additional_properties) diff --git a/advancedbilling/models/subscription_product_migration_request.py b/advancedbilling/models/subscription_product_migration_request.py index fd1e6ee2..6949ed31 100644 --- a/advancedbilling/models/subscription_product_migration_request.py +++ b/advancedbilling/models/subscription_product_migration_request.py @@ -17,6 +17,8 @@ class SubscriptionProductMigrationRequest(object): Attributes: migration (SubscriptionProductMigration): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -27,13 +29,15 @@ class SubscriptionProductMigrationRequest(object): def __init__(self, migration=None, - additional_properties={}): + additional_properties=None): """Constructor for the SubscriptionProductMigrationRequest class""" # Initialize members of the class self.migration = migration # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -51,15 +55,13 @@ def from_dictionary(cls, """ - if dictionary is None: + 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 # Clean out expected properties from dictionary - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, - dictionary) + additional_properties) diff --git a/advancedbilling/models/subscription_purge_type.py b/advancedbilling/models/subscription_purge_type.py index 327aae47..f04c74b6 100644 --- a/advancedbilling/models/subscription_purge_type.py +++ b/advancedbilling/models/subscription_purge_type.py @@ -17,6 +17,8 @@ class SubscriptionPurgeType(object): Attributes: CUSTOMER: TODO: type description here. PAYMENT_PROFILE: TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ CUSTOMER = 'customer' diff --git a/advancedbilling/models/subscription_response.py b/advancedbilling/models/subscription_response.py index dd9501d3..84f613f4 100644 --- a/advancedbilling/models/subscription_response.py +++ b/advancedbilling/models/subscription_response.py @@ -18,6 +18,8 @@ class SubscriptionResponse(object): Attributes: subscription (Subscription): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -32,7 +34,7 @@ class SubscriptionResponse(object): def __init__(self, subscription=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the SubscriptionResponse class""" # Initialize members of the class @@ -40,6 +42,8 @@ def __init__(self, self.subscription = subscription # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -57,15 +61,13 @@ def from_dictionary(cls, """ - if dictionary is None: + 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 # Clean out expected properties from dictionary - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, - dictionary) + additional_properties) diff --git a/advancedbilling/models/subscription_sort.py b/advancedbilling/models/subscription_sort.py index 7994dd02..6f206528 100644 --- a/advancedbilling/models/subscription_sort.py +++ b/advancedbilling/models/subscription_sort.py @@ -21,6 +21,8 @@ class SubscriptionSort(object): NEXT_ASSESSMENT: TODO: type description here. UPDATED_AT: TODO: type description here. CREATED_AT: TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ SIGNUP_DATE = 'signup_date' diff --git a/advancedbilling/models/subscription_state.py b/advancedbilling/models/subscription_state.py index bbc51323..0a9fee93 100644 --- a/advancedbilling/models/subscription_state.py +++ b/advancedbilling/models/subscription_state.py @@ -100,6 +100,8 @@ class SubscriptionState(object): TRIAL_ENDED: TODO: type description here. ON_HOLD: TODO: type description here. AWAITING_SIGNUP: TODO: type description here. + 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'] diff --git a/advancedbilling/models/subscription_state_change.py b/advancedbilling/models/subscription_state_change.py index 1b1e94d1..5faf1235 100644 --- a/advancedbilling/models/subscription_state_change.py +++ b/advancedbilling/models/subscription_state_change.py @@ -18,6 +18,8 @@ class SubscriptionStateChange(object): Attributes: previous_subscription_state (str): TODO: type description here. new_subscription_state (str): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -30,7 +32,7 @@ class SubscriptionStateChange(object): def __init__(self, previous_subscription_state=None, new_subscription_state=None, - additional_properties={}): + additional_properties=None): """Constructor for the SubscriptionStateChange class""" # Initialize members of the class @@ -38,6 +40,8 @@ def __init__(self, self.new_subscription_state = new_subscription_state # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -55,20 +59,18 @@ def from_dictionary(cls, """ - if dictionary is None: + 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 # Clean out expected properties from dictionary - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, - dictionary) + additional_properties) @classmethod def validate(cls, dictionary): diff --git a/advancedbilling/models/subscription_state_filter.py b/advancedbilling/models/subscription_state_filter.py index 05a3f7ea..63003ce0 100644 --- a/advancedbilling/models/subscription_state_filter.py +++ b/advancedbilling/models/subscription_state_filter.py @@ -27,6 +27,8 @@ class SubscriptionStateFilter(object): TRIAL_ENDED: TODO: type description here. TRIALING: TODO: type description here. UNPAID: TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ ACTIVE = 'active' diff --git a/advancedbilling/models/tax_configuration.py b/advancedbilling/models/tax_configuration.py index 35d176b4..3fd8e691 100644 --- a/advancedbilling/models/tax_configuration.py +++ b/advancedbilling/models/tax_configuration.py @@ -24,6 +24,8 @@ class TaxConfiguration(object): 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. """ @@ -44,7 +46,7 @@ def __init__(self, kind='custom', destination_address=APIHelper.SKIP, fully_configured=False, - additional_properties={}): + additional_properties=None): """Constructor for the TaxConfiguration class""" # Initialize members of the class @@ -54,6 +56,8 @@ def __init__(self, self.fully_configured = fully_configured # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -71,7 +75,7 @@ def from_dictionary(cls, """ - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -79,11 +83,9 @@ def from_dictionary(cls, 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 - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, fully_configured, - dictionary) + additional_properties) diff --git a/advancedbilling/models/tax_configuration_kind.py b/advancedbilling/models/tax_configuration_kind.py index d8e42ab9..d346fbdf 100644 --- a/advancedbilling/models/tax_configuration_kind.py +++ b/advancedbilling/models/tax_configuration_kind.py @@ -19,6 +19,8 @@ class TaxConfigurationKind(object): ENUM_MANAGED AVALARA: TODO: type description here. ENUM_LINKED AVALARA: TODO: type description here. ENUM_DIGITAL RIVER: TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ CUSTOM = 'custom' diff --git a/advancedbilling/models/tax_destination_address.py b/advancedbilling/models/tax_destination_address.py index 312ed7dc..595d141f 100644 --- a/advancedbilling/models/tax_destination_address.py +++ b/advancedbilling/models/tax_destination_address.py @@ -19,6 +19,8 @@ class TaxDestinationAddress(object): BILLING_THEN_SHIPPING: TODO: type description here. SHIPPING_ONLY: TODO: type description here. BILLING_ONLY: TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ SHIPPING_THEN_BILLING = 'shipping_then_billing' diff --git a/advancedbilling/models/too_many_management_link_requests.py b/advancedbilling/models/too_many_management_link_requests.py index c4ed13d8..2906c0f8 100644 --- a/advancedbilling/models/too_many_management_link_requests.py +++ b/advancedbilling/models/too_many_management_link_requests.py @@ -18,6 +18,8 @@ class TooManyManagementLinkRequests(object): Attributes: error (str): TODO: type description here. new_link_available_at (datetime): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -30,7 +32,7 @@ class TooManyManagementLinkRequests(object): def __init__(self, error=None, new_link_available_at=None, - additional_properties={}): + additional_properties=None): """Constructor for the TooManyManagementLinkRequests class""" # Initialize members of the class @@ -38,6 +40,8 @@ def __init__(self, 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: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -55,17 +59,15 @@ def from_dictionary(cls, """ - if dictionary is None: + 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 # Clean out expected properties from dictionary - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, - dictionary) + additional_properties) diff --git a/advancedbilling/models/update_allocation_expiration_date.py b/advancedbilling/models/update_allocation_expiration_date.py index 9616af3c..4c6879b5 100644 --- a/advancedbilling/models/update_allocation_expiration_date.py +++ b/advancedbilling/models/update_allocation_expiration_date.py @@ -18,6 +18,8 @@ class UpdateAllocationExpirationDate(object): Attributes: allocation (AllocationExpirationDate): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -32,7 +34,7 @@ class UpdateAllocationExpirationDate(object): def __init__(self, allocation=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the UpdateAllocationExpirationDate class""" # Initialize members of the class @@ -40,6 +42,8 @@ def __init__(self, self.allocation = allocation # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -57,15 +61,13 @@ def from_dictionary(cls, """ - if dictionary is None: + 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 # Clean out expected properties from dictionary - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, - dictionary) + additional_properties) diff --git a/advancedbilling/models/update_component.py b/advancedbilling/models/update_component.py index 0effba36..2ad2c378 100644 --- a/advancedbilling/models/update_component.py +++ b/advancedbilling/models/update_component.py @@ -34,6 +34,8 @@ class UpdateComponent(object): 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. """ @@ -80,7 +82,7 @@ def __init__(self, item_category=APIHelper.SKIP, display_on_hosted_page=APIHelper.SKIP, upgrade_charge=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the UpdateComponent class""" # Initialize members of the class @@ -104,6 +106,8 @@ def __init__(self, self.upgrade_charge = upgrade_charge # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -121,7 +125,7 @@ def from_dictionary(cls, """ - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -135,9 +139,7 @@ def from_dictionary(cls, 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 - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, @@ -148,4 +150,4 @@ def from_dictionary(cls, item_category, display_on_hosted_page, upgrade_charge, - dictionary) + additional_properties) diff --git a/advancedbilling/models/update_component_price_point.py b/advancedbilling/models/update_component_price_point.py index 14fa3913..b02b71ae 100644 --- a/advancedbilling/models/update_component_price_point.py +++ b/advancedbilling/models/update_component_price_point.py @@ -35,6 +35,8 @@ class UpdateComponentPricePoint(object): for this component price point, either month or day. This property is only available for sites with Multifrequency enabled. prices (List[UpdatePrice]): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -74,7 +76,7 @@ def __init__(self, interval=APIHelper.SKIP, interval_unit=APIHelper.SKIP, prices=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the UpdateComponentPricePoint class""" # Initialize members of the class @@ -96,6 +98,8 @@ def __init__(self, self.prices = prices # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -113,7 +117,7 @@ def from_dictionary(cls, """ - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -130,9 +134,7 @@ def from_dictionary(cls, else: prices = APIHelper.SKIP # Clean out expected properties from dictionary - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, @@ -142,4 +144,4 @@ def from_dictionary(cls, interval, interval_unit, prices, - dictionary) + additional_properties) diff --git a/advancedbilling/models/update_component_price_point_request.py b/advancedbilling/models/update_component_price_point_request.py index 1d1d9a24..e4e32f7f 100644 --- a/advancedbilling/models/update_component_price_point_request.py +++ b/advancedbilling/models/update_component_price_point_request.py @@ -18,6 +18,8 @@ class UpdateComponentPricePointRequest(object): Attributes: price_point (UpdateComponentPricePoint): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -32,7 +34,7 @@ class UpdateComponentPricePointRequest(object): def __init__(self, price_point=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the UpdateComponentPricePointRequest class""" # Initialize members of the class @@ -40,6 +42,8 @@ def __init__(self, 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 @@ -57,15 +61,13 @@ def from_dictionary(cls, """ - if dictionary is None: + 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 # Clean out expected properties from dictionary - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, - dictionary) + additional_properties) diff --git a/advancedbilling/models/update_component_request.py b/advancedbilling/models/update_component_request.py index 0a8d2a45..533fc20b 100644 --- a/advancedbilling/models/update_component_request.py +++ b/advancedbilling/models/update_component_request.py @@ -17,6 +17,8 @@ class UpdateComponentRequest(object): Attributes: component (UpdateComponent): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -27,13 +29,15 @@ class UpdateComponentRequest(object): def __init__(self, component=None, - additional_properties={}): + additional_properties=None): """Constructor for the UpdateComponentRequest class""" # Initialize members of the class self.component = component # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -51,15 +55,13 @@ def from_dictionary(cls, """ - if dictionary is None: + 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 # Clean out expected properties from dictionary - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, - dictionary) + additional_properties) diff --git a/advancedbilling/models/update_coupon_currency.py b/advancedbilling/models/update_coupon_currency.py index 6bc81eb3..6d368fdd 100644 --- a/advancedbilling/models/update_coupon_currency.py +++ b/advancedbilling/models/update_coupon_currency.py @@ -17,6 +17,8 @@ class UpdateCouponCurrency(object): 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. """ @@ -29,7 +31,7 @@ class UpdateCouponCurrency(object): def __init__(self, currency=None, price=None, - additional_properties={}): + additional_properties=None): """Constructor for the UpdateCouponCurrency class""" # Initialize members of the class @@ -37,6 +39,8 @@ def __init__(self, self.price = price # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -54,17 +58,15 @@ def from_dictionary(cls, """ - if dictionary is None: + 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 # Clean out expected properties from dictionary - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, - dictionary) + additional_properties) diff --git a/advancedbilling/models/update_currency_price.py b/advancedbilling/models/update_currency_price.py index 1e4581e4..0aa473c4 100644 --- a/advancedbilling/models/update_currency_price.py +++ b/advancedbilling/models/update_currency_price.py @@ -16,7 +16,9 @@ class UpdateCurrencyPrice(object): Attributes: id (int): ID of the currency price record being updated - price (int): New price for the given currency + price (float): New price for the given currency + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -29,7 +31,7 @@ class UpdateCurrencyPrice(object): def __init__(self, id=None, price=None, - additional_properties={}): + additional_properties=None): """Constructor for the UpdateCurrencyPrice class""" # Initialize members of the class @@ -37,6 +39,8 @@ def __init__(self, self.price = price # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -54,17 +58,15 @@ def from_dictionary(cls, """ - if dictionary is None: + 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 # Clean out expected properties from dictionary - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, - dictionary) + additional_properties) diff --git a/advancedbilling/models/update_currency_prices_request.py b/advancedbilling/models/update_currency_prices_request.py index 39e85560..a0bcd9c0 100644 --- a/advancedbilling/models/update_currency_prices_request.py +++ b/advancedbilling/models/update_currency_prices_request.py @@ -18,6 +18,8 @@ class UpdateCurrencyPricesRequest(object): Attributes: currency_prices (List[UpdateCurrencyPrice]): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -28,13 +30,15 @@ class UpdateCurrencyPricesRequest(object): def __init__(self, currency_prices=None, - additional_properties={}): + additional_properties=None): """Constructor for the UpdateCurrencyPricesRequest class""" # Initialize members of the class self.currency_prices = currency_prices # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -52,7 +56,7 @@ def from_dictionary(cls, """ - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -60,9 +64,7 @@ def from_dictionary(cls, 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 - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, - dictionary) + additional_properties) diff --git a/advancedbilling/models/update_customer.py b/advancedbilling/models/update_customer.py index b6b67f0e..15e607fb 100644 --- a/advancedbilling/models/update_customer.py +++ b/advancedbilling/models/update_customer.py @@ -37,6 +37,8 @@ class UpdateCustomer(object): 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. """ @@ -114,7 +116,7 @@ def __init__(self, parent_id=APIHelper.SKIP, verified=APIHelper.SKIP, salesforce_id=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the UpdateCustomer class""" # Initialize members of the class @@ -160,6 +162,8 @@ def __init__(self, self.salesforce_id = salesforce_id # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -177,7 +181,7 @@ def from_dictionary(cls, """ - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -202,9 +206,7 @@ def from_dictionary(cls, 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 - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, @@ -226,4 +228,4 @@ def from_dictionary(cls, parent_id, verified, salesforce_id, - dictionary) + additional_properties) diff --git a/advancedbilling/models/update_customer_request.py b/advancedbilling/models/update_customer_request.py index 4d7e49ac..0d418a8a 100644 --- a/advancedbilling/models/update_customer_request.py +++ b/advancedbilling/models/update_customer_request.py @@ -17,6 +17,8 @@ class UpdateCustomerRequest(object): Attributes: customer (UpdateCustomer): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -27,13 +29,15 @@ class UpdateCustomerRequest(object): def __init__(self, customer=None, - additional_properties={}): + additional_properties=None): """Constructor for the UpdateCustomerRequest class""" # Initialize members of the class self.customer = customer # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -51,15 +55,13 @@ def from_dictionary(cls, """ - if dictionary is None: + 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 # Clean out expected properties from dictionary - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, - dictionary) + additional_properties) diff --git a/advancedbilling/models/update_metadata.py b/advancedbilling/models/update_metadata.py index 5c6b237b..435faa66 100644 --- a/advancedbilling/models/update_metadata.py +++ b/advancedbilling/models/update_metadata.py @@ -19,6 +19,8 @@ class UpdateMetadata(object): current_name (str): TODO: type description here. name (str): TODO: type description here. value (str): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -39,7 +41,7 @@ def __init__(self, current_name=APIHelper.SKIP, name=APIHelper.SKIP, value=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the UpdateMetadata class""" # Initialize members of the class @@ -51,6 +53,8 @@ def __init__(self, self.value = value # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -68,7 +72,7 @@ def from_dictionary(cls, """ - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -76,11 +80,9 @@ def from_dictionary(cls, 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 - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, value, - dictionary) + additional_properties) diff --git a/advancedbilling/models/update_metadata_request.py b/advancedbilling/models/update_metadata_request.py index fcfbd130..0e24cdd6 100644 --- a/advancedbilling/models/update_metadata_request.py +++ b/advancedbilling/models/update_metadata_request.py @@ -18,6 +18,8 @@ class UpdateMetadataRequest(object): Attributes: metadata (UpdateMetadata): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -32,7 +34,7 @@ class UpdateMetadataRequest(object): def __init__(self, metadata=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the UpdateMetadataRequest class""" # Initialize members of the class @@ -40,6 +42,8 @@ def __init__(self, self.metadata = metadata # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -57,15 +61,13 @@ def from_dictionary(cls, """ - if dictionary is None: + 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 # Clean out expected properties from dictionary - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, - dictionary) + additional_properties) diff --git a/advancedbilling/models/update_metafield.py b/advancedbilling/models/update_metafield.py index 2dadf71c..d7e8638c 100644 --- a/advancedbilling/models/update_metafield.py +++ b/advancedbilling/models/update_metafield.py @@ -29,6 +29,8 @@ class UpdateMetafield(object): input, and appear differently on a Public Signup Page. 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. """ @@ -55,7 +57,7 @@ def __init__(self, scope=APIHelper.SKIP, input_type=APIHelper.SKIP, enum=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the UpdateMetafield class""" # Initialize members of the class @@ -71,6 +73,8 @@ def __init__(self, self.enum = enum # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -88,7 +92,7 @@ def from_dictionary(cls, """ - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -98,16 +102,14 @@ def from_dictionary(cls, 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 - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, scope, input_type, enum, - dictionary) + additional_properties) @classmethod def validate(cls, dictionary): diff --git a/advancedbilling/models/update_metafields_request.py b/advancedbilling/models/update_metafields_request.py index 81a2b5c0..7a8daff9 100644 --- a/advancedbilling/models/update_metafields_request.py +++ b/advancedbilling/models/update_metafields_request.py @@ -18,6 +18,8 @@ class UpdateMetafieldsRequest(object): Attributes: metafields (UpdateMetafield | List[UpdateMetafield] | None): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -32,7 +34,7 @@ class UpdateMetafieldsRequest(object): def __init__(self, metafields=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the UpdateMetafieldsRequest class""" # Initialize members of the class @@ -40,6 +42,8 @@ def __init__(self, self.metafields = metafields # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -58,15 +62,13 @@ def from_dictionary(cls, """ from advancedbilling.utilities.union_type_lookup import UnionTypeLookUp - if dictionary is None: + 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 # Clean out expected properties from dictionary - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, - dictionary) + additional_properties) diff --git a/advancedbilling/models/update_payment_profile.py b/advancedbilling/models/update_payment_profile.py index 8ba78cc3..02004b18 100644 --- a/advancedbilling/models/update_payment_profile.py +++ b/advancedbilling/models/update_payment_profile.py @@ -51,6 +51,8 @@ class UpdatePaymentProfile(object): 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. """ @@ -105,7 +107,7 @@ def __init__(self, billing_zip=APIHelper.SKIP, billing_country=APIHelper.SKIP, billing_address_2=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the UpdatePaymentProfile class""" # Initialize members of the class @@ -137,6 +139,8 @@ def __init__(self, self.billing_address_2 = billing_address_2 # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -154,7 +158,7 @@ def from_dictionary(cls, """ - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -172,9 +176,7 @@ def from_dictionary(cls, 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 - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, @@ -189,4 +191,4 @@ def from_dictionary(cls, billing_zip, billing_country, billing_address_2, - dictionary) + additional_properties) diff --git a/advancedbilling/models/update_payment_profile_request.py b/advancedbilling/models/update_payment_profile_request.py index 3f63c853..17f2e235 100644 --- a/advancedbilling/models/update_payment_profile_request.py +++ b/advancedbilling/models/update_payment_profile_request.py @@ -17,6 +17,8 @@ class UpdatePaymentProfileRequest(object): Attributes: payment_profile (UpdatePaymentProfile): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -27,13 +29,15 @@ class UpdatePaymentProfileRequest(object): def __init__(self, payment_profile=None, - additional_properties={}): + additional_properties=None): """Constructor for the UpdatePaymentProfileRequest class""" # Initialize members of the class self.payment_profile = payment_profile # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -51,15 +55,13 @@ def from_dictionary(cls, """ - if dictionary is None: + 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 # Clean out expected properties from dictionary - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, - dictionary) + additional_properties) diff --git a/advancedbilling/models/update_price.py b/advancedbilling/models/update_price.py index 3b2dfd86..28be3f8a 100644 --- a/advancedbilling/models/update_price.py +++ b/advancedbilling/models/update_price.py @@ -22,6 +22,8 @@ class UpdatePrice(object): places. i.e. 1.00 or 0.0012 or 0.00000065 destroy (bool): TODO: type description here. starting_quantity (int | str | None): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -48,7 +50,7 @@ def __init__(self, unit_price=APIHelper.SKIP, destroy=APIHelper.SKIP, starting_quantity=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the UpdatePrice class""" # Initialize members of the class @@ -64,6 +66,8 @@ def __init__(self, self.starting_quantity = starting_quantity # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -82,7 +86,7 @@ def from_dictionary(cls, """ from advancedbilling.utilities.union_type_lookup import UnionTypeLookUp - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -92,13 +96,11 @@ def from_dictionary(cls, 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 - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, unit_price, destroy, starting_quantity, - dictionary) + additional_properties) diff --git a/advancedbilling/models/update_product_price_point.py b/advancedbilling/models/update_product_price_point.py index 51009594..9381f6e9 100644 --- a/advancedbilling/models/update_product_price_point.py +++ b/advancedbilling/models/update_product_price_point.py @@ -18,6 +18,8 @@ class UpdateProductPricePoint(object): Attributes: handle (str): TODO: type description here. price_in_cents (long|int): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -35,7 +37,7 @@ class UpdateProductPricePoint(object): def __init__(self, handle=APIHelper.SKIP, price_in_cents=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the UpdateProductPricePoint class""" # Initialize members of the class @@ -45,6 +47,8 @@ def __init__(self, self.price_in_cents = price_in_cents # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -62,17 +66,15 @@ def from_dictionary(cls, """ - if dictionary is None: + 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 # Clean out expected properties from dictionary - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, - dictionary) + additional_properties) diff --git a/advancedbilling/models/update_product_price_point_request.py b/advancedbilling/models/update_product_price_point_request.py index f684d24c..1a69db3f 100644 --- a/advancedbilling/models/update_product_price_point_request.py +++ b/advancedbilling/models/update_product_price_point_request.py @@ -17,6 +17,8 @@ class UpdateProductPricePointRequest(object): Attributes: price_point (UpdateProductPricePoint): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -27,13 +29,15 @@ class UpdateProductPricePointRequest(object): def __init__(self, price_point=None, - additional_properties={}): + additional_properties=None): """Constructor for the UpdateProductPricePointRequest class""" # 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 @@ -51,15 +55,13 @@ def from_dictionary(cls, """ - if dictionary is None: + 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 # Clean out expected properties from dictionary - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, - dictionary) + additional_properties) diff --git a/advancedbilling/models/update_reason_code.py b/advancedbilling/models/update_reason_code.py index bb8810e8..feba6f5d 100644 --- a/advancedbilling/models/update_reason_code.py +++ b/advancedbilling/models/update_reason_code.py @@ -19,6 +19,8 @@ class UpdateReasonCode(object): 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. """ @@ -39,7 +41,7 @@ def __init__(self, code=APIHelper.SKIP, description=APIHelper.SKIP, position=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the UpdateReasonCode class""" # Initialize members of the class @@ -51,6 +53,8 @@ def __init__(self, self.position = position # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -68,7 +72,7 @@ def from_dictionary(cls, """ - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -76,11 +80,9 @@ def from_dictionary(cls, 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 - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, position, - dictionary) + additional_properties) diff --git a/advancedbilling/models/update_reason_code_request.py b/advancedbilling/models/update_reason_code_request.py index 39c62cc9..81bce4a2 100644 --- a/advancedbilling/models/update_reason_code_request.py +++ b/advancedbilling/models/update_reason_code_request.py @@ -17,6 +17,8 @@ class UpdateReasonCodeRequest(object): Attributes: reason_code (UpdateReasonCode): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -27,13 +29,15 @@ class UpdateReasonCodeRequest(object): def __init__(self, reason_code=None, - additional_properties={}): + additional_properties=None): """Constructor for the UpdateReasonCodeRequest class""" # Initialize members of the class self.reason_code = reason_code # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -51,15 +55,13 @@ def from_dictionary(cls, """ - if dictionary is None: + 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 # Clean out expected properties from dictionary - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, - dictionary) + additional_properties) diff --git a/advancedbilling/models/update_segment.py b/advancedbilling/models/update_segment.py index f3d8e9b5..4747f0b7 100644 --- a/advancedbilling/models/update_segment.py +++ b/advancedbilling/models/update_segment.py @@ -22,6 +22,8 @@ class UpdateSegment(object): Components](https://help.chargify.com/products/product-components.h tml) for an overview of pricing schemes. prices (List[CreateOrUpdateSegmentPrice]): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -38,7 +40,7 @@ class UpdateSegment(object): def __init__(self, pricing_scheme=None, prices=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the UpdateSegment class""" # Initialize members of the class @@ -47,6 +49,8 @@ def __init__(self, self.prices = prices # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -64,7 +68,7 @@ def from_dictionary(cls, """ - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -75,10 +79,8 @@ def from_dictionary(cls, else: prices = APIHelper.SKIP # Clean out expected properties from dictionary - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, - dictionary) + additional_properties) diff --git a/advancedbilling/models/update_segment_request.py b/advancedbilling/models/update_segment_request.py index 464c6843..253edc2a 100644 --- a/advancedbilling/models/update_segment_request.py +++ b/advancedbilling/models/update_segment_request.py @@ -17,6 +17,8 @@ class UpdateSegmentRequest(object): Attributes: segment (UpdateSegment): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -27,13 +29,15 @@ class UpdateSegmentRequest(object): def __init__(self, segment=None, - additional_properties={}): + additional_properties=None): """Constructor for the UpdateSegmentRequest class""" # Initialize members of the class self.segment = segment # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -51,15 +55,13 @@ def from_dictionary(cls, """ - if dictionary is None: + 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 # Clean out expected properties from dictionary - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, - dictionary) + additional_properties) diff --git a/advancedbilling/models/update_subscription.py b/advancedbilling/models/update_subscription.py index cd2f48e7..5748fa07 100644 --- a/advancedbilling/models/update_subscription.py +++ b/advancedbilling/models/update_subscription.py @@ -52,6 +52,8 @@ class UpdateSubscription(object): 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. """ @@ -101,7 +103,6 @@ class UpdateSubscription(object): ] _nullables = [ - 'dunning_communication_delay_enabled', 'dunning_communication_delay_time_zone', ] @@ -125,7 +126,7 @@ def __init__(self, dunning_communication_delay_time_zone=APIHelper.SKIP, product_price_point_id=APIHelper.SKIP, product_price_point_handle=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the UpdateSubscription class""" # Initialize members of the class @@ -169,6 +170,8 @@ def __init__(self, self.product_price_point_handle = product_price_point_handle # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -187,7 +190,7 @@ def from_dictionary(cls, """ from advancedbilling.utilities.union_type_lookup import UnionTypeLookUp - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -215,9 +218,7 @@ def from_dictionary(cls, 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 - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, @@ -238,4 +239,4 @@ def from_dictionary(cls, dunning_communication_delay_time_zone, product_price_point_id, product_price_point_handle, - dictionary) + additional_properties) diff --git a/advancedbilling/models/update_subscription_component.py b/advancedbilling/models/update_subscription_component.py index 1f4a4e3c..3a501541 100644 --- a/advancedbilling/models/update_subscription_component.py +++ b/advancedbilling/models/update_subscription_component.py @@ -20,6 +20,8 @@ class UpdateSubscriptionComponent(object): component_id (int): TODO: type description here. 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. """ @@ -37,7 +39,7 @@ class UpdateSubscriptionComponent(object): def __init__(self, component_id=APIHelper.SKIP, custom_price=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the UpdateSubscriptionComponent class""" # Initialize members of the class @@ -47,6 +49,8 @@ def __init__(self, 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 @@ -64,20 +68,18 @@ def from_dictionary(cls, """ - if dictionary is None: + 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 # Clean out expected properties from dictionary - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, - dictionary) + additional_properties) @classmethod def validate(cls, dictionary): diff --git a/advancedbilling/models/update_subscription_group.py b/advancedbilling/models/update_subscription_group.py index ae08e61d..f5348904 100644 --- a/advancedbilling/models/update_subscription_group.py +++ b/advancedbilling/models/update_subscription_group.py @@ -17,6 +17,8 @@ class UpdateSubscriptionGroup(object): Attributes: member_ids (List[int]): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -31,7 +33,7 @@ class UpdateSubscriptionGroup(object): def __init__(self, member_ids=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the UpdateSubscriptionGroup class""" # Initialize members of the class @@ -39,6 +41,8 @@ def __init__(self, self.member_ids = member_ids # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -56,15 +60,13 @@ def from_dictionary(cls, """ - if dictionary is None: + 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 # Clean out expected properties from dictionary - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, - dictionary) + additional_properties) diff --git a/advancedbilling/models/update_subscription_group_request.py b/advancedbilling/models/update_subscription_group_request.py index e8bdc2d0..ececf67f 100644 --- a/advancedbilling/models/update_subscription_group_request.py +++ b/advancedbilling/models/update_subscription_group_request.py @@ -18,6 +18,8 @@ class UpdateSubscriptionGroupRequest(object): Attributes: subscription_group (UpdateSubscriptionGroup): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -28,13 +30,15 @@ class UpdateSubscriptionGroupRequest(object): def __init__(self, subscription_group=None, - additional_properties={}): + additional_properties=None): """Constructor for the UpdateSubscriptionGroupRequest class""" # Initialize members of the class self.subscription_group = subscription_group # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -52,15 +56,13 @@ def from_dictionary(cls, """ - if dictionary is None: + 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 # Clean out expected properties from dictionary - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, - dictionary) + additional_properties) diff --git a/advancedbilling/models/update_subscription_note.py b/advancedbilling/models/update_subscription_note.py index 9fabd5f7..f1865140 100644 --- a/advancedbilling/models/update_subscription_note.py +++ b/advancedbilling/models/update_subscription_note.py @@ -17,6 +17,8 @@ class UpdateSubscriptionNote(object): Attributes: body (str): TODO: type description here. sticky (bool): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -29,7 +31,7 @@ class UpdateSubscriptionNote(object): def __init__(self, body=None, sticky=None, - additional_properties={}): + additional_properties=None): """Constructor for the UpdateSubscriptionNote class""" # Initialize members of the class @@ -37,6 +39,8 @@ def __init__(self, self.sticky = sticky # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -54,17 +58,15 @@ def from_dictionary(cls, """ - if dictionary is None: + 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 # Clean out expected properties from dictionary - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, - dictionary) + additional_properties) diff --git a/advancedbilling/models/update_subscription_note_request.py b/advancedbilling/models/update_subscription_note_request.py index 6873cad5..0b7bee9a 100644 --- a/advancedbilling/models/update_subscription_note_request.py +++ b/advancedbilling/models/update_subscription_note_request.py @@ -17,6 +17,8 @@ class UpdateSubscriptionNoteRequest(object): Attributes: note (UpdateSubscriptionNote): Updatable fields for Subscription Note + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -27,13 +29,15 @@ class UpdateSubscriptionNoteRequest(object): def __init__(self, note=None, - additional_properties={}): + additional_properties=None): """Constructor for the UpdateSubscriptionNoteRequest class""" # Initialize members of the class self.note = note # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -51,15 +55,13 @@ def from_dictionary(cls, """ - if dictionary is None: + 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 # Clean out expected properties from dictionary - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, - dictionary) + additional_properties) diff --git a/advancedbilling/models/update_subscription_request.py b/advancedbilling/models/update_subscription_request.py index cedd3a2f..bfcd491c 100644 --- a/advancedbilling/models/update_subscription_request.py +++ b/advancedbilling/models/update_subscription_request.py @@ -17,6 +17,8 @@ class UpdateSubscriptionRequest(object): Attributes: subscription (UpdateSubscription): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -27,13 +29,15 @@ class UpdateSubscriptionRequest(object): def __init__(self, subscription=None, - additional_properties={}): + additional_properties=None): """Constructor for the UpdateSubscriptionRequest class""" # Initialize members of the class self.subscription = subscription # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -51,15 +55,13 @@ def from_dictionary(cls, """ - if dictionary is None: + 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 # Clean out expected properties from dictionary - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, - dictionary) + additional_properties) diff --git a/advancedbilling/models/upsert_prepaid_configuration.py b/advancedbilling/models/upsert_prepaid_configuration.py index 4ebf8929..d216d110 100644 --- a/advancedbilling/models/upsert_prepaid_configuration.py +++ b/advancedbilling/models/upsert_prepaid_configuration.py @@ -22,6 +22,8 @@ class UpsertPrepaidConfiguration(object): auto_replenish (bool): TODO: type description here. replenish_threshold_amount_in_cents (long|int): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -45,7 +47,7 @@ def __init__(self, replenish_to_amount_in_cents=APIHelper.SKIP, auto_replenish=APIHelper.SKIP, replenish_threshold_amount_in_cents=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the UpsertPrepaidConfiguration class""" # Initialize members of the class @@ -59,6 +61,8 @@ def __init__(self, self.replenish_threshold_amount_in_cents = replenish_threshold_amount_in_cents # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -76,7 +80,7 @@ def from_dictionary(cls, """ - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -85,15 +89,13 @@ def from_dictionary(cls, 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 - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, auto_replenish, replenish_threshold_amount_in_cents, - dictionary) + additional_properties) @classmethod def validate(cls, dictionary): diff --git a/advancedbilling/models/upsert_prepaid_configuration_request.py b/advancedbilling/models/upsert_prepaid_configuration_request.py index 45a0b7b6..698d0b9b 100644 --- a/advancedbilling/models/upsert_prepaid_configuration_request.py +++ b/advancedbilling/models/upsert_prepaid_configuration_request.py @@ -18,6 +18,8 @@ class UpsertPrepaidConfigurationRequest(object): Attributes: prepaid_configuration (UpsertPrepaidConfiguration): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -28,13 +30,15 @@ class UpsertPrepaidConfigurationRequest(object): def __init__(self, prepaid_configuration=None, - additional_properties={}): + additional_properties=None): """Constructor for the UpsertPrepaidConfigurationRequest class""" # Initialize members of the class self.prepaid_configuration = prepaid_configuration # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -52,15 +56,13 @@ def from_dictionary(cls, """ - if dictionary is None: + 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 # Clean out expected properties from dictionary - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, - dictionary) + additional_properties) diff --git a/advancedbilling/models/usage.py b/advancedbilling/models/usage.py index 067a38f0..3d13d936 100644 --- a/advancedbilling/models/usage.py +++ b/advancedbilling/models/usage.py @@ -25,6 +25,8 @@ class Usage(object): component_id (int): TODO: type description here. component_handle (str): TODO: type description here. subscription_id (int): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -67,7 +69,7 @@ def __init__(self, component_id=APIHelper.SKIP, component_handle=APIHelper.SKIP, subscription_id=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the Usage class""" # Initialize members of the class @@ -91,6 +93,8 @@ def __init__(self, self.subscription_id = subscription_id # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -109,7 +113,7 @@ def from_dictionary(cls, """ from advancedbilling.utilities.union_type_lookup import UnionTypeLookUp - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -123,9 +127,7 @@ def from_dictionary(cls, 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 - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, @@ -136,4 +138,4 @@ def from_dictionary(cls, component_id, component_handle, subscription_id, - dictionary) + additional_properties) diff --git a/advancedbilling/models/usage_response.py b/advancedbilling/models/usage_response.py index e381786e..18f108dd 100644 --- a/advancedbilling/models/usage_response.py +++ b/advancedbilling/models/usage_response.py @@ -17,6 +17,8 @@ class UsageResponse(object): Attributes: usage (Usage): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -27,13 +29,15 @@ class UsageResponse(object): def __init__(self, usage=None, - additional_properties={}): + additional_properties=None): """Constructor for the UsageResponse class""" # Initialize members of the class self.usage = usage # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -51,15 +55,13 @@ def from_dictionary(cls, """ - if dictionary is None: + 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 # Clean out expected properties from dictionary - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, - dictionary) + additional_properties) diff --git a/advancedbilling/models/void_invoice.py b/advancedbilling/models/void_invoice.py index dd07da5f..a028adec 100644 --- a/advancedbilling/models/void_invoice.py +++ b/advancedbilling/models/void_invoice.py @@ -16,6 +16,8 @@ class VoidInvoice(object): Attributes: reason (str): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -26,13 +28,15 @@ class VoidInvoice(object): def __init__(self, reason=None, - additional_properties={}): + additional_properties=None): """Constructor for the VoidInvoice class""" # Initialize members of the class self.reason = reason # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -50,15 +54,13 @@ def from_dictionary(cls, """ - if dictionary is None: + 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 # Clean out expected properties from dictionary - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, - dictionary) + additional_properties) diff --git a/advancedbilling/models/void_invoice_event.py b/advancedbilling/models/void_invoice_event.py index d82c82bd..e3e68448 100644 --- a/advancedbilling/models/void_invoice_event.py +++ b/advancedbilling/models/void_invoice_event.py @@ -25,6 +25,8 @@ class VoidInvoiceEvent(object): event_type (InvoiceEventType): TODO: type description here. event_data (VoidInvoiceEventData): Example schema for an `void_invoice` event + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -43,7 +45,7 @@ def __init__(self, invoice=None, event_type='void_invoice', event_data=None, - additional_properties={}): + additional_properties=None): """Constructor for the VoidInvoiceEvent class""" # Initialize members of the class @@ -54,6 +56,8 @@ def __init__(self, self.event_data = event_data # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -71,7 +75,7 @@ def from_dictionary(cls, """ - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -81,16 +85,14 @@ def from_dictionary(cls, 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 - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, invoice, event_type, event_data, - dictionary) + additional_properties) @classmethod def validate(cls, dictionary): diff --git a/advancedbilling/models/void_invoice_event_data.py b/advancedbilling/models/void_invoice_event_data.py index 70cc75ce..6ff9dd25 100644 --- a/advancedbilling/models/void_invoice_event_data.py +++ b/advancedbilling/models/void_invoice_event_data.py @@ -24,6 +24,8 @@ class VoidInvoiceEventData(object): 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. """ @@ -51,7 +53,7 @@ def __init__(self, transaction_time=None, is_advance_invoice=None, reason=None, - additional_properties={}): + additional_properties=None): """Constructor for the VoidInvoiceEventData class""" # Initialize members of the class @@ -63,6 +65,8 @@ def __init__(self, self.reason = reason # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -80,7 +84,7 @@ def from_dictionary(cls, """ - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -91,9 +95,7 @@ def from_dictionary(cls, 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 - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, @@ -101,7 +103,7 @@ def from_dictionary(cls, transaction_time, is_advance_invoice, reason, - dictionary) + additional_properties) @classmethod def validate(cls, dictionary): diff --git a/advancedbilling/models/void_invoice_request.py b/advancedbilling/models/void_invoice_request.py index 44b0f695..a55fdba6 100644 --- a/advancedbilling/models/void_invoice_request.py +++ b/advancedbilling/models/void_invoice_request.py @@ -17,6 +17,8 @@ class VoidInvoiceRequest(object): Attributes: void (VoidInvoice): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -27,13 +29,15 @@ class VoidInvoiceRequest(object): def __init__(self, void=None, - additional_properties={}): + additional_properties=None): """Constructor for the VoidInvoiceRequest class""" # Initialize members of the class self.void = void # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -51,15 +55,13 @@ def from_dictionary(cls, """ - if dictionary is None: + 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 # Clean out expected properties from dictionary - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, - dictionary) + additional_properties) diff --git a/advancedbilling/models/void_remainder_event.py b/advancedbilling/models/void_remainder_event.py index 865bfedb..0695e5e4 100644 --- a/advancedbilling/models/void_remainder_event.py +++ b/advancedbilling/models/void_remainder_event.py @@ -25,6 +25,8 @@ class VoidRemainderEvent(object): event_type (InvoiceEventType): TODO: type description here. event_data (VoidRemainderEventData): Example schema for an `void_remainder` event + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -43,7 +45,7 @@ def __init__(self, invoice=None, event_type='void_remainder', event_data=None, - additional_properties={}): + additional_properties=None): """Constructor for the VoidRemainderEvent class""" # Initialize members of the class @@ -54,6 +56,8 @@ def __init__(self, self.event_data = event_data # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -71,7 +75,7 @@ def from_dictionary(cls, """ - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -81,16 +85,14 @@ def from_dictionary(cls, 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 - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, invoice, event_type, event_data, - dictionary) + additional_properties) @classmethod def validate(cls, dictionary): diff --git a/advancedbilling/models/void_remainder_event_data.py b/advancedbilling/models/void_remainder_event_data.py index a25a6b45..c03b39c4 100644 --- a/advancedbilling/models/void_remainder_event_data.py +++ b/advancedbilling/models/void_remainder_event_data.py @@ -22,6 +22,8 @@ class VoidRemainderEventData(object): 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. """ @@ -38,7 +40,7 @@ def __init__(self, memo=None, applied_amount=None, transaction_time=None, - additional_properties={}): + additional_properties=None): """Constructor for the VoidRemainderEventData class""" # Initialize members of the class @@ -48,6 +50,8 @@ def __init__(self, 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: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -65,7 +69,7 @@ def from_dictionary(cls, """ - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -74,15 +78,13 @@ def from_dictionary(cls, 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 - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, applied_amount, transaction_time, - dictionary) + additional_properties) @classmethod def validate(cls, dictionary): diff --git a/advancedbilling/models/webhook.py b/advancedbilling/models/webhook.py index 82b81c89..9affa76a 100644 --- a/advancedbilling/models/webhook.py +++ b/advancedbilling/models/webhook.py @@ -45,6 +45,8 @@ class Webhook(object): 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. """ @@ -96,7 +98,7 @@ def __init__(self, body=APIHelper.SKIP, signature=APIHelper.SKIP, signature_hmac_sha_256=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the Webhook class""" # Initialize members of the class @@ -126,6 +128,8 @@ def __init__(self, self.signature_hmac_sha_256 = signature_hmac_sha_256 # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -143,7 +147,7 @@ def from_dictionary(cls, """ - if dictionary is None: + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary @@ -163,9 +167,7 @@ def from_dictionary(cls, 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 - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, @@ -179,4 +181,4 @@ def from_dictionary(cls, body, signature, signature_hmac_sha_256, - dictionary) + additional_properties) diff --git a/advancedbilling/models/webhook_order.py b/advancedbilling/models/webhook_order.py index 075156f6..a07eaa1f 100644 --- a/advancedbilling/models/webhook_order.py +++ b/advancedbilling/models/webhook_order.py @@ -17,6 +17,8 @@ class WebhookOrder(object): Attributes: NEWEST_FIRST: TODO: type description here. OLDEST_FIRST: TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ NEWEST_FIRST = 'newest_first' diff --git a/advancedbilling/models/webhook_response.py b/advancedbilling/models/webhook_response.py index c32dd665..20c91226 100644 --- a/advancedbilling/models/webhook_response.py +++ b/advancedbilling/models/webhook_response.py @@ -18,6 +18,8 @@ class WebhookResponse(object): Attributes: webhook (Webhook): TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ @@ -32,7 +34,7 @@ class WebhookResponse(object): def __init__(self, webhook=APIHelper.SKIP, - additional_properties={}): + additional_properties=None): """Constructor for the WebhookResponse class""" # Initialize members of the class @@ -40,6 +42,8 @@ def __init__(self, self.webhook = webhook # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} self.additional_properties = additional_properties @classmethod @@ -57,15 +61,13 @@ def from_dictionary(cls, """ - if dictionary is None: + 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 # Clean out expected properties from dictionary - for key in cls._names.values(): - if key in dictionary: - del dictionary[key] + additional_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, - dictionary) + additional_properties) diff --git a/advancedbilling/models/webhook_status.py b/advancedbilling/models/webhook_status.py index e9260b9f..89e70701 100644 --- a/advancedbilling/models/webhook_status.py +++ b/advancedbilling/models/webhook_status.py @@ -19,6 +19,8 @@ class WebhookStatus(object): FAILED: TODO: type description here. PENDING: TODO: type description here. PAUSED: TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ SUCCESSFUL = 'successful' diff --git a/advancedbilling/models/webhook_subscription.py b/advancedbilling/models/webhook_subscription.py index 9be89127..d52e46a3 100644 --- a/advancedbilling/models/webhook_subscription.py +++ b/advancedbilling/models/webhook_subscription.py @@ -52,6 +52,8 @@ class WebhookSubscription(object): description here. SUBSCRIPTION_SERVICE_CREDIT_ACCOUNT_BALANCE_CHANGED: TODO: type description here. + additional_properties (Dict[str, object]): The additional properties + for the model. """ BILLING_DATE_CHANGE = 'billing_date_change' diff --git a/advancedbilling/utilities/union_type_lookup.py b/advancedbilling/utilities/union_type_lookup.py index 3b2e89d1..e054831c 100644 --- a/advancedbilling/utilities/union_type_lookup.py +++ b/advancedbilling/utilities/union_type_lookup.py @@ -21,8 +21,6 @@ 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_or_update_flat_amount_coupon import CreateOrUpdateFlatAmountCoupon -from advancedbilling.models.create_or_update_percentage_coupon import CreateOrUpdatePercentageCoupon 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 @@ -30,7 +28,6 @@ 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.group_settings import GroupSettings from advancedbilling.models.invoice_issued import InvoiceIssued from advancedbilling.models.issue_invoice_event import IssueInvoiceEvent from advancedbilling.models.item_price_point_changed import ItemPricePointChanged @@ -56,8 +53,7 @@ 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_failure import SubscriptionGroupSignupFailure -from advancedbilling.models.subscription_group_signup_success import SubscriptionGroupSignupSuccess +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 @@ -257,15 +253,6 @@ class UnionTypeLookUp: is_optional=True ) ), - 'AddSubscriptionToAGroupGroup': OneOf( - [ - LeafType(GroupSettings), - LeafType(bool) - ], - Context.create( - is_optional=True - ) - ), 'AllocationQuantity': OneOf( [ LeafType(int), @@ -358,6 +345,15 @@ class UnionTypeLookUp: is_optional=True ) ), + 'CouponPayloadPercentage': OneOf( + [ + LeafType(str), + LeafType(float) + ], + Context.create( + is_optional=True + ) + ), 'CreateAllocationPricePointId': OneOf( [ LeafType(str), @@ -488,21 +484,6 @@ class UnionTypeLookUp: LeafType(float) ] ), - 'CreateOrUpdateCouponCoupon': OneOf( - [ - LeafType(CreateOrUpdatePercentageCoupon), - LeafType(CreateOrUpdateFlatAmountCoupon) - ], - Context.create( - is_optional=True - ) - ), - 'CreateOrUpdatePercentageCouponPercentage': OneOf( - [ - LeafType(str), - LeafType(float) - ] - ), 'CreateOrUpdateSegmentPriceUnitPrice': OneOf( [ LeafType(str), @@ -648,8 +629,7 @@ class UnionTypeLookUp: LeafType(PendingCancellationChange), LeafType(PrepaidSubscriptionBalanceChanged), LeafType(ProformaInvoiceIssued), - LeafType(SubscriptionGroupSignupSuccess), - LeafType(SubscriptionGroupSignupFailure), + LeafType(SubscriptionGroupSignupEventData), LeafType(CreditAccountBalanceChanged), LeafType(PrepaymentAccountBalanceChanged), LeafType(PaymentCollectionMethodChanged), @@ -692,10 +672,7 @@ class UnionTypeLookUp: [ LeafType(str), LeafType(float) - ], - Context.create( - is_optional=True - ) + ] ), 'PaymentProfileAttributesExpirationMonth': OneOf( [ diff --git a/doc/client.md b/doc/client.md index e3dff2d5..808f576d 100644 --- a/doc/client.md +++ b/doc/client.md @@ -5,9 +5,8 @@ The following parameters are configurable for the API Client: | Parameter | Type | Description | | --- | --- | --- | -| `subdomain` | `str` | The subdomain for your Advanced Billing site.
*Default*: `'subdomain'` | -| `domain` | `str` | The Advanced Billing server domain.
*Default*: `'chargify.com'` | -| `environment` | `Environment` | The API environment.
**Default: `Environment.PRODUCTION`** | +| `site` | `str` | The subdomain for your Advanced Billing site.
*Default*: `'subdomain'` | +| `environment` | `Environment` | The API environment.
**Default: `Environment.US`** | | `http_client_instance` | `HttpClient` | 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 | @@ -26,9 +25,8 @@ client = AdvancedBillingClient( username='BasicAuthUserName', password='BasicAuthPassword' ), - environment=Environment.PRODUCTION, - subdomain='subdomain', - domain='chargify.com' + environment=Environment.US, + site='subdomain' ) ``` diff --git a/doc/controllers/component-price-points.md b/doc/controllers/component-price-points.md index 3196fe2f..637893c0 100644 --- a/doc/controllers/component-price-points.md +++ b/doc/controllers/component-price-points.md @@ -147,6 +147,12 @@ result = component_price_points_controller.create_component_price_point( ) ``` +## Errors + +| HTTP Status Code | Error Description | Exception Class | +| --- | --- | --- | +| 422 | Unprocessable Entity (WebDAV) | [`ErrorArrayMapResponseException`](../../doc/models/error-array-map-response-exception.md) | + # List Component Price Points @@ -357,6 +363,12 @@ result = component_price_points_controller.bulk_create_component_price_points( } ``` +## Errors + +| HTTP Status Code | Error Description | Exception Class | +| --- | --- | --- | +| 422 | Unprocessable Entity (WebDAV) | [`ErrorListResponseException`](../../doc/models/error-list-response-exception.md) | + # Update Component Price Point @@ -436,7 +448,8 @@ Use this endpoint to retrieve details for a specific component price point. You ```python def read_component_price_point(self, component_id, - price_point_id) + price_point_id, + currency_prices=None) ``` ## Parameters @@ -445,6 +458,7 @@ def read_component_price_point(self, | --- | --- | --- | --- | | `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. | +| `currency_prices` | `bool` | Query, Optional | Include an array of currency price data | ## Response Type diff --git a/doc/controllers/components.md b/doc/controllers/components.md index 32d5f6b4..6f2c8c95 100644 --- a/doc/controllers/components.md +++ b/doc/controllers/components.md @@ -288,14 +288,9 @@ product_family_id = 'product_family_id4' body = CreateOnOffComponent( on_off_component=OnOffComponent( name='Annual Support Services', + unit_price='100.00', description='Prepay for support services', taxable=True, - prices=[ - Price( - starting_quantity='0', - unit_price='100.00' - ) - ], display_on_hosted_page=True, public_signup_page_ids=[ 320495 @@ -390,7 +385,6 @@ body = CreatePrepaidComponent( name='Minutes', unit_name='minutes', pricing_scheme=PricingScheme.PER_UNIT, - unit_price=2, overage_pricing=OveragePricing( pricing_scheme=PricingScheme.STAIRSTEP, prices=[ @@ -405,6 +399,7 @@ body = CreatePrepaidComponent( ) ] ), + unit_price=2, rollover_prepaid_remainder=True, renew_prepaid_allocation=True, expiration_interval=15, diff --git a/doc/controllers/coupons.md b/doc/controllers/coupons.md index e09fffa1..256aa005 100644 --- a/doc/controllers/coupons.md +++ b/doc/controllers/coupons.md @@ -38,10 +38,10 @@ Additionally, for documentation on how to apply a coupon to a subscription withi This request will create a coupon, based on the provided information. -When creating a coupon, you must specify a product family using the `product_family_id`. If no `product_family_id` is passed, the first product family available is used. You will also need to formulate your URL to cite the Product Family ID in your request. +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 hashes of `restricted_products` and/or `restricted_components` in the format: -`{ "": boolean_value }` +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 }` ```python def create_coupon(self, @@ -54,7 +54,7 @@ def create_coupon(self, | Parameter | Type | Tags | Description | | --- | --- | --- | --- | | `product_family_id` | `int` | Template, Required | The Advanced Billing id of the product family to which the coupon belongs | -| `body` | [`CreateOrUpdateCoupon`](../../doc/models/create-or-update-coupon.md) | Body, Optional | - | +| `body` | [`CouponRequest`](../../doc/models/coupon-request.md) | Body, Optional | - | ## Response Type @@ -65,15 +65,15 @@ def create_coupon(self, ```python product_family_id = 140 -body = CreateOrUpdateCoupon( - coupon=CreateOrUpdatePercentageCoupon( +body = CouponRequest( + coupon=CouponPayload( name='15% off', code='15OFF', - percentage=15, description='15% off for life', + percentage=15, allow_negative_balance=False, recurring=False, - end_date=dateutil.parser.parse('2012-08-29T12:00:00-04:00'), + end_date=dateutil.parser.parse('2012-08-29').date(), product_family_id='2', stackable=True, compounding_strategy=CompoundingStrategy.COMPOUND, @@ -255,7 +255,8 @@ If you have more than one product family and if the coupon you are trying to fin ```python def find_coupon(self, product_family_id=None, - code=None) + code=None, + currency_prices=None) ``` ## Parameters @@ -264,6 +265,7 @@ def find_coupon(self, | --- | --- | --- | --- | | `product_family_id` | `int` | Query, Optional | The Advanced Billing id of the product family to which the coupon belongs | | `code` | `str` | Query, Optional | The code of the coupon | +| `currency_prices` | `bool` | Query, 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. | ## Response Type @@ -272,7 +274,11 @@ def find_coupon(self, ## Example Usage ```python -result = coupons_controller.find_coupon() +currency_prices = True + +result = coupons_controller.find_coupon( + currency_prices=currency_prices +) ``` @@ -288,7 +294,8 @@ If the coupon is set to `use_site_exchange_rate: true`, it will return pricing b ```python def read_coupon(self, product_family_id, - coupon_id) + coupon_id, + currency_prices=None) ``` ## Parameters @@ -297,6 +304,7 @@ def read_coupon(self, | --- | --- | --- | --- | | `product_family_id` | `int` | Template, Required | The Advanced Billing id of the product family to which the coupon belongs | | `coupon_id` | `int` | Template, Required | The Advanced Billing id of the coupon | +| `currency_prices` | `bool` | Query, 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. | ## Response Type @@ -309,9 +317,12 @@ product_family_id = 140 coupon_id = 162 +currency_prices = True + result = coupons_controller.read_coupon( product_family_id, - coupon_id + coupon_id, + currency_prices=currency_prices ) ``` @@ -367,7 +378,7 @@ def update_coupon(self, | --- | --- | --- | --- | | `product_family_id` | `int` | Template, Required | The Advanced Billing id of the product family to which the coupon belongs | | `coupon_id` | `int` | Template, Required | The Advanced Billing id of the coupon | -| `body` | [`CreateOrUpdateCoupon`](../../doc/models/create-or-update-coupon.md) | Body, Optional | - | +| `body` | [`CouponRequest`](../../doc/models/coupon-request.md) | Body, Optional | - | ## Response Type @@ -380,15 +391,15 @@ product_family_id = 140 coupon_id = 162 -body = CreateOrUpdateCoupon( - coupon=CreateOrUpdatePercentageCoupon( +body = CouponRequest( + coupon=CouponPayload( name='15% off', code='15OFF', - percentage=15, description='15% off for life', + percentage=15, allow_negative_balance=False, recurring=False, - end_date=dateutil.parser.parse('2012-08-29T12:00:00-04:00'), + end_date=dateutil.parser.parse('2012-08-29').date(), product_family_id='2', stackable=True, compounding_strategy=CompoundingStrategy.COMPOUND @@ -438,6 +449,12 @@ result = coupons_controller.update_coupon( } ``` +## Errors + +| HTTP Status Code | Error Description | Exception Class | +| --- | --- | --- | +| 422 | Unprocessable Entity (WebDAV) | [`ErrorListResponseException`](../../doc/models/error-list-response-exception.md) | + # Archive Coupon @@ -805,6 +822,12 @@ result = coupons_controller.create_or_update_coupon_currency_prices( ) ``` +## Errors + +| HTTP Status Code | Error Description | Exception Class | +| --- | --- | --- | +| 422 | Unprocessable Entity (WebDAV) | [`ErrorStringMapResponseException`](../../doc/models/error-string-map-response-exception.md) | + # Create Coupon Subcodes diff --git a/doc/controllers/events.md b/doc/controllers/events.md index 182b8233..17187649 100644 --- a/doc/controllers/events.md +++ b/doc/controllers/events.md @@ -38,11 +38,17 @@ The following keys are no longer supported. + `zferral_revenue_post_failure` - (Specific to the deprecated Zferral integration) + `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](../../doc/models/event-key.md). + ## Event Specific Data -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. +For precise mappings from key to event_specific_data, refer to [Event](../../doc/models/event.md). -Each event type has its own `event_specific_data` specified. +### Example Here’s an example event for the `subscription_product_change` event: @@ -94,7 +100,7 @@ def list_events(self, | `since_id` | `long\|int` | Query, Optional | Returns events with an id greater than or equal to the one specified | | `max_id` | `long\|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'` | -| `filter` | [`List[EventType]`](../../doc/models/event-type.md) | Query, Optional | You can pass multiple event keys after comma.
Use in query `filter=signup_success,payment_success`. | +| `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. | | `end_date` | `str` | Query, Optional | 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. | @@ -113,8 +119,8 @@ collect = { 'per_page': 50, 'direction': Direction.DESC, 'filter': [ - EventType.CUSTOM_FIELD_VALUE_CHANGE, - EventType.PAYMENT_SUCCESS + EventKey.CUSTOM_FIELD_VALUE_CHANGE, + EventKey.PAYMENT_SUCCESS ], 'date_field': ListEventsDateField.CREATED_AT } @@ -188,7 +194,15 @@ result = events_controller.list_events(collect) The following request will return a list of events for a subscription. -Each event type has its own `event_specific_data` specified. +## Event Key + +The event type is identified by the key property. You can check supported keys [here](../../doc/models/event-key.md). + +## 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. +For precise mappings from key to event_specific_data, refer to [Event](../../doc/models/event.md). ```python def list_subscription_events(self, @@ -205,7 +219,7 @@ def list_subscription_events(self, | `since_id` | `long\|int` | Query, Optional | Returns events with an id greater than or equal to the one specified | | `max_id` | `long\|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'` | -| `filter` | [`List[EventType]`](../../doc/models/event-type.md) | Query, Optional | You can pass multiple event keys after comma.
Use in query `filter=signup_success,payment_success`. | +| `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 @@ -220,8 +234,8 @@ collect = { 'per_page': 50, 'direction': Direction.DESC, 'filter': [ - EventType.CUSTOM_FIELD_VALUE_CHANGE, - EventType.PAYMENT_SUCCESS + EventKey.CUSTOM_FIELD_VALUE_CHANGE, + EventKey.PAYMENT_SUCCESS ] } result = events_controller.list_subscription_events(collect) @@ -289,7 +303,7 @@ def read_events_count(self, | `since_id` | `long\|int` | Query, Optional | Returns events with an id greater than or equal to the one specified | | `max_id` | `long\|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'` | -| `filter` | [`List[EventType]`](../../doc/models/event-type.md) | Query, Optional | You can pass multiple event keys after comma.
Use in query `filter=signup_success,payment_success`. | +| `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 @@ -303,8 +317,8 @@ collect = { 'per_page': 50, 'direction': Direction.DESC, 'filter': [ - EventType.CUSTOM_FIELD_VALUE_CHANGE, - EventType.PAYMENT_SUCCESS + EventKey.CUSTOM_FIELD_VALUE_CHANGE, + EventKey.PAYMENT_SUCCESS ] } result = events_controller.read_events_count(collect) diff --git a/doc/controllers/offers.md b/doc/controllers/offers.md index ed16325e..e2e25d10 100644 --- a/doc/controllers/offers.md +++ b/doc/controllers/offers.md @@ -211,6 +211,12 @@ result = offers_controller.list_offers(collect) } ``` +## Errors + +| HTTP Status Code | Error Description | Exception Class | +| --- | --- | --- | +| 422 | Unprocessable Entity (WebDAV) | [`ErrorListResponseException`](../../doc/models/error-list-response-exception.md) | + # Read Offer diff --git a/doc/controllers/product-families.md b/doc/controllers/product-families.md index 8ba22bd4..90b2ed8e 100644 --- a/doc/controllers/product-families.md +++ b/doc/controllers/product-families.md @@ -34,10 +34,10 @@ def list_products_for_product_family(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` | | `date_field` | [`BasicDateField`](../../doc/models/basic-date-field.md) | Query, Optional | The type of filter you would like to apply to your search.
Use in query: `date_field=created_at`. | | `filter` | [`ListProductsFilter`](../../doc/models/list-products-filter.md) | Query, Optional | Filter to use for List Products operations | -| `start_date` | `str` | Query, Optional | 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` | `str` | Query, Optional | 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` | `str` | Query, Optional | 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` | `str` | Query, Optional | 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` | Query, Optional | 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` | Query, Optional | 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` | Query, Optional | 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` | Query, Optional | 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. | | `include_archived` | `bool` | Query, Optional | Include archived products | | `include` | [`ListProductsInclude`](../../doc/models/list-products-include.md) | Query, Optional | Allows including additional data in the response. Use in query `include=prepaid_product_price_point`. | @@ -242,10 +242,10 @@ def list_product_families(self, | Parameter | Type | Tags | Description | | --- | --- | --- | --- | | `date_field` | [`BasicDateField`](../../doc/models/basic-date-field.md) | Query, Optional | The type of filter you would like to apply to your search.
Use in query: `date_field=created_at`. | -| `start_date` | `str` | Query, Optional | 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` | `str` | Query, Optional | 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` | `str` | Query, Optional | 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` | `str` | Query, Optional | 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` | Query, Optional | 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` | Query, Optional | 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` | Query, Optional | 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` | Query, Optional | 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. | ## Response Type diff --git a/doc/controllers/product-price-points.md b/doc/controllers/product-price-points.md index 17722298..538c022f 100644 --- a/doc/controllers/product-price-points.md +++ b/doc/controllers/product-price-points.md @@ -125,6 +125,7 @@ def list_product_price_points(self, | `per_page` | `int` | Query, Optional | 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.
**Default**: `10`
**Constraints**: `<= 200` | | `currency_prices` | `bool` | Query, 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. | | `filter_type` | [`List[PricePointType]`](../../doc/models/price-point-type.md) | Query, Optional | Use in query: `filter[type]=catalog,default`. | +| `archived` | `bool` | Query, Optional | Set to include archived price points in the response. | ## Response Type diff --git a/doc/controllers/reason-codes.md b/doc/controllers/reason-codes.md index 9c783981..fc9d6a06 100644 --- a/doc/controllers/reason-codes.md +++ b/doc/controllers/reason-codes.md @@ -143,6 +143,12 @@ result = reason_codes_controller.list_reason_codes(collect) ] ``` +## Errors + +| HTTP Status Code | Error Description | Exception Class | +| --- | --- | --- | +| 422 | Unprocessable Entity (WebDAV) | [`ErrorListResponseException`](../../doc/models/error-list-response-exception.md) | + # Read Reason Code @@ -212,6 +218,7 @@ result = reason_codes_controller.update_reason_code(reason_code_id) | HTTP Status Code | Error Description | Exception Class | | --- | --- | --- | | 404 | Not Found | `APIException` | +| 422 | Unprocessable Entity (WebDAV) | [`ErrorListResponseException`](../../doc/models/error-list-response-exception.md) | # Delete Reason Code @@ -231,7 +238,7 @@ def delete_reason_code(self, ## Response Type -[`ReasonCodesJsonResponse`](../../doc/models/reason-codes-json-response.md) +[`OkResponse`](../../doc/models/ok-response.md) ## Example Usage diff --git a/doc/controllers/subscription-components.md b/doc/controllers/subscription-components.md index 0bbbfc01..01011991 100644 --- a/doc/controllers/subscription-components.md +++ b/doc/controllers/subscription-components.md @@ -1353,7 +1353,6 @@ https://events.chargify.com/my-site-subdomain/events/my-stream-api-handle ```python def record_event(self, - subdomain, api_handle, store_uid=None, body=None) @@ -1363,7 +1362,6 @@ def record_event(self, | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `subdomain` | `str` | Template, Required | Your site's subdomain | | `api_handle` | `str` | Template, Required | Identifies the Stream for which the event should be published. | | `store_uid` | `str` | Query, 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`](../../doc/models/ebb-event.md) | Body, Optional | - | @@ -1375,8 +1373,6 @@ def record_event(self, ## Example Usage ```python -subdomain = 'subdomain4' - api_handle = 'api_handle6' body = EBBEvent( @@ -1387,7 +1383,6 @@ body = EBBEvent( ) subscription_components_controller.record_event( - subdomain, api_handle, body=body ) @@ -1404,7 +1399,6 @@ A maximum of 1000 events can be published in a single request. A 422 will be ret ```python def bulk_record_events(self, - subdomain, api_handle, store_uid=None, body=None) @@ -1414,7 +1408,6 @@ def bulk_record_events(self, | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `subdomain` | `str` | Template, Required | Your site's subdomain | | `api_handle` | `str` | Template, Required | Identifies the Stream for which the events should be published. | | `store_uid` | `str` | Query, 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]`](../../doc/models/ebb-event.md) | Body, Optional | - | @@ -1426,8 +1419,6 @@ def bulk_record_events(self, ## Example Usage ```python -subdomain = 'subdomain4' - api_handle = 'api_handle6' body = [ @@ -1440,7 +1431,6 @@ body = [ ] subscription_components_controller.bulk_record_events( - subdomain, api_handle, body=body ) diff --git a/doc/controllers/subscription-notes.md b/doc/controllers/subscription-notes.md index d3e64208..22d6ce3e 100644 --- a/doc/controllers/subscription-notes.md +++ b/doc/controllers/subscription-notes.md @@ -64,6 +64,12 @@ result = subscription_notes_controller.create_subscription_note( ) ``` +## Errors + +| HTTP Status Code | Error Description | Exception Class | +| --- | --- | --- | +| 422 | Unprocessable Entity (WebDAV) | [`ErrorListResponseException`](../../doc/models/error-list-response-exception.md) | + # List Subscription Notes @@ -124,6 +130,12 @@ result = subscription_notes_controller.list_subscription_notes(collect) ] ``` +## Errors + +| HTTP Status Code | Error Description | Exception Class | +| --- | --- | --- | +| 422 | Unprocessable Entity (WebDAV) | [`ErrorListResponseException`](../../doc/models/error-list-response-exception.md) | + # Read Subscription Note @@ -219,6 +231,12 @@ result = subscription_notes_controller.update_subscription_note( ) ``` +## Errors + +| HTTP Status Code | Error Description | Exception Class | +| --- | --- | --- | +| 422 | Unprocessable Entity (WebDAV) | [`ErrorListResponseException`](../../doc/models/error-list-response-exception.md) | + # Delete Subscription Note diff --git a/doc/controllers/subscription-status.md b/doc/controllers/subscription-status.md index 69bd7898..45247157 100644 --- a/doc/controllers/subscription-status.md +++ b/doc/controllers/subscription-status.md @@ -1203,6 +1203,7 @@ result = subscription_status_controller.initiate_delayed_cancellation(subscripti | HTTP Status Code | Error Description | Exception Class | | --- | --- | --- | | 404 | Not Found | `APIException` | +| 422 | Unprocessable Entity (WebDAV) | [`ErrorListResponseException`](../../doc/models/error-list-response-exception.md) | # Cancel Delayed Cancellation @@ -1276,6 +1277,12 @@ subscription_id = 222 result = subscription_status_controller.cancel_dunning(subscription_id) ``` +## Errors + +| HTTP Status Code | Error Description | Exception Class | +| --- | --- | --- | +| 422 | Unprocessable Entity (WebDAV) | [`ErrorListResponseException`](../../doc/models/error-list-response-exception.md) | + # Preview Renewal diff --git a/doc/controllers/subscriptions.md b/doc/controllers/subscriptions.md index bce91a46..3e15fae3 100644 --- a/doc/controllers/subscriptions.md +++ b/doc/controllers/subscriptions.md @@ -44,6 +44,14 @@ Credit card details may be required, depending on the options for the product be If you are creating a subscription with a payment profile, the attribute to send will be `credit_card_attributes` or `bank_account_attributes` for ACH and Direct Debit. That said, when you read the subscription after creation, we return the profile details under `credit_card` or `bank_account`. +## Bulk creation of subscriptions + +Bulk creation of subscriptions is currently not supported. For scenarios where multiple subscriptions must be added, particularly when assigning to the same subscription group, it is essential to switch to a single-threaded approach. + +To avoid data conflicts or inaccuracies, incorporate a sleep interval between requests. + +While this single-threaded approach may impact performance, it ensures data consistency and accuracy in cases where concurrent creation attempts could otherwise lead to issues with subscription alignment and integrity. + ## Taxable Subscriptions If your intent is to charge your subscribers tax via [Avalara Taxes](https://maxio.zendesk.com/hc/en-us/articles/24287043035661-Avalara-VAT-Tax) or [Custom Taxes](https://maxio.zendesk.com/hc/en-us/articles/24287044212749-Custom-Taxes), there are a few considerations to be made regarding collecting subscription data. @@ -364,7 +372,7 @@ For more information on Stripe Direct Debit, please view the following two resou For more information on Stripe Direct Debit, please view the following two resources: -+ [Payment Profiles via API for Stripe BECS Direct Debit]($e/Payment%20Profiles/createPaymentProfile) ++ [Payment Profiles via API for Stripe BECS Direct Debit](../../doc/controllers/payment-profiles.md#create-payment-profile) + [Full documentation on Stripe Direct Debit](https://maxio.zendesk.com/hc/en-us/articles/24176170430093-Stripe-SEPA-and-BECS-Direct-Debit) @@ -395,7 +403,7 @@ For more information on Stripe Direct Debit, please view the following two resou For more information on Stripe Direct Debit, please view the following two resources: -+ [Payment Profiles via API for Stripe BACS Direct Debit]($e/Payment%20Profiles/createPaymentProfile) ++ [Payment Profiles via API for Stripe BACS Direct Debit](../../doc/controllers/payment-profiles.md#create-payment-profile) + [Full documentation on Stripe Direct Debit](https://maxio.zendesk.com/hc/en-us/articles/24176170430093-Stripe-SEPA-and-BECS-Direct-Debit) @@ -694,6 +702,7 @@ def create_subscription(self, body = CreateSubscriptionRequest( subscription=CreateSubscription( product_handle='basic', + payment_collection_method=CollectionMethod.REMITTANCE, customer_attributes=CustomerAttributes( first_name='Joe', last_name='Blow', @@ -707,20 +716,6 @@ body = CreateSubscriptionRequest( zip='02120', country='US', phone='(617) 111 - 0000' - ), - credit_card_attributes=PaymentProfileAttributes( - first_name='Joe', - last_name='Smith', - full_number='4111111111111111', - card_type=CardType.VISA, - expiration_month='1', - expiration_year='2021', - billing_address='123 Mass Ave.', - billing_address_2='billing_address_22', - billing_city='Boston', - billing_state='MA', - billing_country='US', - billing_zip='02120' ) ) ) @@ -1408,6 +1403,12 @@ def find_subscription(self, result = subscriptions_controller.find_subscription() ``` +## Errors + +| HTTP Status Code | Error Description | Exception Class | +| --- | --- | --- | +| 404 | Not Found | `APIException` | + # Purge Subscription @@ -1438,7 +1439,7 @@ def purge_subscription(self, ## Response Type -`void` +[`SubscriptionResponse`](../../doc/models/subscription-response.md) ## Example Usage @@ -1452,13 +1453,19 @@ cascade = [ SubscriptionPurgeType.PAYMENT_PROFILE ] -subscriptions_controller.purge_subscription( +result = subscriptions_controller.purge_subscription( subscription_id, ack, cascade=cascade ) ``` +## Errors + +| HTTP Status Code | Error Description | Exception Class | +| --- | --- | --- | +| 400 | Bad Request | [`SubscriptionResponseErrorException`](../../doc/models/subscription-response-error-exception.md) | + # Update Prepaid Subscription Configuration @@ -1515,6 +1522,12 @@ result = subscriptions_controller.update_prepaid_subscription_configuration( } ``` +## Errors + +| HTTP Status Code | Error Description | Exception Class | +| --- | --- | --- | +| 422 | Unprocessable Entity (WebDAV) | `APIException` | + # Preview Subscription diff --git a/doc/models/add-subscription-to-a-group.md b/doc/models/add-subscription-to-a-group.md index 0c764079..aa4cda28 100644 --- a/doc/models/add-subscription-to-a-group.md +++ b/doc/models/add-subscription-to-a-group.md @@ -9,7 +9,7 @@ | Name | Type | Tags | Description | | --- | --- | --- | --- | -| `group` | [Group Settings](../../doc/models/group-settings.md) \| bool \| None | Optional | This is a container for one-of cases. | +| `group` | [`GroupSettings`](../../doc/models/group-settings.md) | Optional | - | ## Example (as JSON) diff --git a/doc/models/change-invoice-status-event-data.md b/doc/models/change-invoice-status-event-data.md index 805a2bbf..1e076ecb 100644 --- a/doc/models/change-invoice-status-event-data.md +++ b/doc/models/change-invoice-status-event-data.md @@ -24,7 +24,7 @@ Example schema for an `change_invoice_status` event "gateway_trans_id": "gateway_trans_id2", "amount": "amount2", "from_status": "draft", - "to_status": "paid", + "to_status": "pending", "consolidation_level": "none" } ``` diff --git a/doc/models/change-invoice-status-event.md b/doc/models/change-invoice-status-event.md index 9e51c2bd..d8276289 100644 --- a/doc/models/change-invoice-status-event.md +++ b/doc/models/change-invoice-status-event.md @@ -36,8 +36,8 @@ "event_data": { "gateway_trans_id": "gateway_trans_id2", "amount": "amount8", - "from_status": "paid", - "to_status": "paid", + "from_status": "open", + "to_status": "pending", "consolidation_level": "child" } } diff --git a/doc/models/component-price-point.md b/doc/models/component-price-point.md index c30be675..d9dadde8 100644 --- a/doc/models/component-price-point.md +++ b/doc/models/component-price-point.md @@ -26,6 +26,12 @@ | `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. | +| `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. | ## Example (as JSON) diff --git a/doc/models/component.md b/doc/models/component.md index bf1c1411..ae95b26a 100644 --- a/doc/models/component.md +++ b/doc/models/component.md @@ -23,7 +23,7 @@ | `taxable` | `bool` | Optional | Boolean flag describing whether a component is taxable or not. | | `description` | `str` | Optional | The description of the component. | | `default_price_point_id` | `int` | Optional | - | -| `overage_prices` | [`List[ComponentPrice]`](../../doc/models/component-price.md) | Optional | An array of price brackets. If the component uses the ‘per_unit’ pricing scheme, this array will be empty. | +| `overage_prices` | [`List[ComponentPrice]`](../../doc/models/component-price.md) | Optional | Applicable only to prepaid usage components. An array of overage price brackets. | | `prices` | [`List[ComponentPrice]`](../../doc/models/component-price.md) | Optional | An array of price brackets. If the component uses the ‘per_unit’ pricing scheme, this array will be empty. | | `price_point_count` | `int` | Optional | Count for the number of price points associated with the component | | `price_points_url` | `str` | Optional | URL that points to the location to read the existing price points via GET request | diff --git a/doc/models/compounding-strategy.md b/doc/models/compounding-strategy.md index d3746d9f..ec68b1f7 100644 --- a/doc/models/compounding-strategy.md +++ b/doc/models/compounding-strategy.md @@ -1,6 +1,8 @@ # Compounding Strategy +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. + ## Enumeration `CompoundingStrategy` diff --git a/doc/models/containers/add-subscription-to-a-group-group.md b/doc/models/containers/add-subscription-to-a-group-group.md deleted file mode 100644 index 24975bc7..00000000 --- a/doc/models/containers/add-subscription-to-a-group-group.md +++ /dev/null @@ -1,14 +0,0 @@ - -# Add Subscription to a Group Group - -## Data Type - -`GroupSettings | bool` - -## Cases - -| Type | -| --- | -| [`GroupSettings`](../../../doc/models/group-settings.md) | -| `bool` | - diff --git a/doc/models/containers/create-or-update-percentage-coupon-percentage.md b/doc/models/containers/coupon-payload-percentage.md similarity index 63% rename from doc/models/containers/create-or-update-percentage-coupon-percentage.md rename to doc/models/containers/coupon-payload-percentage.md index 8cd64630..af7c8923 100644 --- a/doc/models/containers/create-or-update-percentage-coupon-percentage.md +++ b/doc/models/containers/coupon-payload-percentage.md @@ -1,5 +1,5 @@ -# Create or Update Percentage Coupon Percentage +# Coupon Payload Percentage ## Data Type diff --git a/doc/models/containers/create-or-update-coupon-coupon.md b/doc/models/containers/create-or-update-coupon-coupon.md deleted file mode 100644 index 5de23730..00000000 --- a/doc/models/containers/create-or-update-coupon-coupon.md +++ /dev/null @@ -1,14 +0,0 @@ - -# Create or Update Coupon Coupon - -## Data Type - -`CreateOrUpdatePercentageCoupon | CreateOrUpdateFlatAmountCoupon` - -## Cases - -| Type | -| --- | -| [`CreateOrUpdatePercentageCoupon`](../../../doc/models/create-or-update-percentage-coupon.md) | -| [`CreateOrUpdateFlatAmountCoupon`](../../../doc/models/create-or-update-flat-amount-coupon.md) | - diff --git a/doc/models/containers/event-event-specific-data.md b/doc/models/containers/event-event-specific-data.md index 15e90c64..1fae19f9 100644 --- a/doc/models/containers/event-event-specific-data.md +++ b/doc/models/containers/event-event-specific-data.md @@ -3,7 +3,7 @@ ## Data Type -`SubscriptionProductChange | SubscriptionStateChange | PaymentRelatedEvents | RefundSuccess | ComponentAllocationChange | MeteredUsage | PrepaidUsage | DunningStepReached | InvoiceIssued | PendingCancellationChange | PrepaidSubscriptionBalanceChanged | ProformaInvoiceIssued | SubscriptionGroupSignupSuccess | SubscriptionGroupSignupFailure | CreditAccountBalanceChanged | PrepaymentAccountBalanceChanged | PaymentCollectionMethodChanged | ItemPricePointChanged | CustomFieldValueChange` +`SubscriptionProductChange | SubscriptionStateChange | PaymentRelatedEvents | RefundSuccess | ComponentAllocationChange | MeteredUsage | PrepaidUsage | DunningStepReached | InvoiceIssued | PendingCancellationChange | PrepaidSubscriptionBalanceChanged | ProformaInvoiceIssued | SubscriptionGroupSignupEventData | CreditAccountBalanceChanged | PrepaymentAccountBalanceChanged | PaymentCollectionMethodChanged | ItemPricePointChanged | CustomFieldValueChange` ## Cases @@ -21,8 +21,7 @@ | [`PendingCancellationChange`](../../../doc/models/pending-cancellation-change.md) | | [`PrepaidSubscriptionBalanceChanged`](../../../doc/models/prepaid-subscription-balance-changed.md) | | [`ProformaInvoiceIssued`](../../../doc/models/proforma-invoice-issued.md) | -| [`SubscriptionGroupSignupSuccess`](../../../doc/models/subscription-group-signup-success.md) | -| [`SubscriptionGroupSignupFailure`](../../../doc/models/subscription-group-signup-failure.md) | +| [`SubscriptionGroupSignupEventData`](../../../doc/models/subscription-group-signup-event-data.md) | | [`CreditAccountBalanceChanged`](../../../doc/models/credit-account-balance-changed.md) | | [`PrepaymentAccountBalanceChanged`](../../../doc/models/prepayment-account-balance-changed.md) | | [`PaymentCollectionMethodChanged`](../../../doc/models/payment-collection-method-changed.md) | diff --git a/doc/models/coupon-currency-response.md b/doc/models/coupon-currency-response.md index 38b0887c..d0820ec1 100644 --- a/doc/models/coupon-currency-response.md +++ b/doc/models/coupon-currency-response.md @@ -19,19 +19,19 @@ { "id": 50, "currency": "currency8", - "price": 78, + "price": 233.74, "coupon_id": 224 }, { "id": 50, "currency": "currency8", - "price": 78, + "price": 233.74, "coupon_id": 224 }, { "id": 50, "currency": "currency8", - "price": 78, + "price": 233.74, "coupon_id": 224 } ] diff --git a/doc/models/coupon-currency.md b/doc/models/coupon-currency.md index 1985b2bf..ab5ffc92 100644 --- a/doc/models/coupon-currency.md +++ b/doc/models/coupon-currency.md @@ -11,7 +11,7 @@ | --- | --- | --- | --- | | `id` | `int` | Optional | - | | `currency` | `str` | Optional | - | -| `price` | `int` | Optional | - | +| `price` | `float` | Optional | - | | `coupon_id` | `int` | Optional | - | ## Example (as JSON) @@ -20,7 +20,7 @@ { "id": 228, "currency": "currency8", - "price": 100, + "price": 169.96, "coupon_id": 210 } ``` diff --git a/doc/models/coupon-payload.md b/doc/models/coupon-payload.md new file mode 100644 index 00000000..6b93d518 --- /dev/null +++ b/doc/models/coupon-payload.md @@ -0,0 +1,38 @@ + +# Coupon Payload + +## Structure + +`CouponPayload` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `name` | `str` | Optional | Required when creating a new coupon. This name is not displayed to customers and is limited to 255 characters. | +| `code` | `str` | Optional | 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` | Optional | 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 | Optional | This is a container for one-of cases. | +| `amount_in_cents` | `long\|int` | Optional | Required when creating a new flat amount coupon. Can't be used together with percentage. Flat USD discount | +| `allow_negative_balance` | `bool` | Optional | If set to true, discount is not limited (credits will carry forward to next billing). Can't be used together with restrictions. | +| `recurring` | `bool` | Optional | - | +| `end_date` | `date` | Optional | 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` | Optional | - | +| `stackable` | `bool` | Optional | A stackable coupon can be combined with other coupons on a Subscription. | +| `compounding_strategy` | [`CompoundingStrategy`](../../doc/models/compounding-strategy.md) | Optional | 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` | Optional | - | +| `apply_on_cancel_at_end_of_period` | `bool` | Optional | - | +| `apply_on_subscription_expiration` | `bool` | Optional | - | + +## Example (as JSON) + +```json +{ + "name": "name8", + "code": "code6", + "description": "description8", + "percentage": "String7", + "amount_in_cents": 110 +} +``` + diff --git a/doc/models/create-or-update-coupon.md b/doc/models/coupon-request.md similarity index 52% rename from doc/models/create-or-update-coupon.md rename to doc/models/coupon-request.md index f503c155..5e803f68 100644 --- a/doc/models/create-or-update-coupon.md +++ b/doc/models/coupon-request.md @@ -1,15 +1,15 @@ -# Create or Update Coupon +# Coupon Request ## Structure -`CreateOrUpdateCoupon` +`CouponRequest` ## Fields | Name | Type | Tags | Description | | --- | --- | --- | --- | -| `coupon` | [Create or Update Percentage Coupon](../../doc/models/create-or-update-percentage-coupon.md) \| [Create or Update Flat Amount Coupon](../../doc/models/create-or-update-flat-amount-coupon.md) \| None | Optional | This is a container for one-of cases. | +| `coupon` | [`CouponPayload`](../../doc/models/coupon-payload.md) | Optional | - | | `restricted_products` | `Dict[str, bool]` | Optional | An object where the keys are product_ids and the values are booleans indicating if the coupon should be applicable to the product | | `restricted_components` | `Dict[str, bool]` | Optional | An object where the keys are component_ids and the values are booleans indicating if the coupon should be applicable to the component | @@ -18,14 +18,11 @@ ```json { "coupon": { - "name": "name0", - "code": "code8", - "description": "description0", - "percentage": "String9", - "allow_negative_balance": false, - "recurring": false, - "end_date": "2016-03-13T12:52:32.123Z", - "product_family_id": "product_family_id6" + "name": "name4", + "code": "code2", + "description": "description6", + "percentage": "String3", + "amount_in_cents": 230 }, "restricted_products": { "key0": true diff --git a/doc/models/coupon.md b/doc/models/coupon.md index c52d32ea..ad8432cb 100644 --- a/doc/models/coupon.md +++ b/doc/models/coupon.md @@ -14,11 +14,11 @@ | `code` | `str` | Optional | - | | `description` | `str` | Optional | - | | `amount` | `float` | Optional | - | -| `amount_in_cents` | `int` | Optional | - | +| `amount_in_cents` | `long\|int` | Optional | - | | `product_family_id` | `int` | Optional | - | | `product_family_name` | `str` | Optional | - | | `start_date` | `datetime` | Optional | - | -| `end_date` | `datetime` | Optional | - | +| `end_date` | `datetime` | Optional | 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` | Optional | - | | `recurring` | `bool` | Optional | - | | `recurring_scheme` | [`RecurringScheme`](../../doc/models/recurring-scheme.md) | Optional | - | @@ -26,11 +26,11 @@ | `duration_interval` | `int` | Optional | - | | `duration_interval_unit` | `str` | Optional | - | | `duration_interval_span` | `str` | Optional | - | -| `allow_negative_balance` | `bool` | Optional | - | +| `allow_negative_balance` | `bool` | Optional | If set to true, discount is not limited (credits will carry forward to next billing). | | `archived_at` | `datetime` | Optional | - | | `conversion_limit` | `str` | Optional | - | -| `stackable` | `bool` | Optional | - | -| `compounding_strategy` | [`CompoundingStrategy`](../../doc/models/compounding-strategy.md) | Optional | - | +| `stackable` | `bool` | Optional | A stackable coupon can be combined with other coupons on a Subscription. | +| `compounding_strategy` | [`CompoundingStrategy`](../../doc/models/compounding-strategy.md) | Optional | 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` | Optional | - | | `created_at` | `datetime` | Optional | - | | `updated_at` | `datetime` | Optional | - | @@ -39,6 +39,7 @@ | `apply_on_cancel_at_end_of_period` | `bool` | Optional | - | | `apply_on_subscription_expiration` | `bool` | Optional | - | | `coupon_restrictions` | [`List[CouponRestriction]`](../../doc/models/coupon-restriction.md) | Optional | - | +| `currency_prices` | [`List[CouponCurrency]`](../../doc/models/coupon-currency.md) | Optional | Returned in read, find, and list endpoints if the query parameter is provided. | ## Example (as JSON) diff --git a/doc/models/create-component-price-point.md b/doc/models/create-component-price-point.md index 96a90926..f1a7bc48 100644 --- a/doc/models/create-component-price-point.md +++ b/doc/models/create-component-price-point.md @@ -13,8 +13,8 @@ | `handle` | `str` | Optional | - | | `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) | Required | - | -| `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.
**Default**: `True` | -| `tax_included` | `bool` | Optional | Whether or not the price point includes tax | +| `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. Setting not supported when creating price points in bulk.
**Default**: `True` | +| `tax_included` | `bool` | Optional | Whether or not the price point includes tax. Setting not supported when creating price points in bulk. | | `interval` | `int` | Optional | 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`](../../doc/models/interval-unit.md) | Optional | A string representing the interval unit for this price point, either month or day. This property is only available for sites with Multifrequency enabled. | diff --git a/doc/models/create-ebb-component.md b/doc/models/create-ebb-component.md index 84689381..83797bce 100644 --- a/doc/models/create-ebb-component.md +++ b/doc/models/create-ebb-component.md @@ -29,7 +29,15 @@ "unit_price": 23.26 } ], - "upgrade_charge": "full", + "price_points": [ + { + "name": "name2", + "handle": "handle8", + "pricing_scheme": "per_unit", + "interval": 92, + "interval_unit": "day" + } + ], "event_based_billing_metric_id": 68 } } diff --git a/doc/models/create-invoice-coupon.md b/doc/models/create-invoice-coupon.md index 283c885e..204e8c46 100644 --- a/doc/models/create-invoice-coupon.md +++ b/doc/models/create-invoice-coupon.md @@ -14,7 +14,7 @@ | `amount` | str \| float \| None | Optional | This is a container for one-of cases. | | `description` | `str` | Optional | **Constraints**: *Maximum Length*: `255` | | `product_family_id` | str \| int \| None | Optional | This is a container for one-of cases. | -| `compounding_strategy` | [`CompoundingStrategy`](../../doc/models/compounding-strategy.md) | Optional | - | +| `compounding_strategy` | [`CompoundingStrategy`](../../doc/models/compounding-strategy.md) | Optional | 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. | ## Example (as JSON) diff --git a/doc/models/create-metered-component.md b/doc/models/create-metered-component.md index a9e37824..0a56ac91 100644 --- a/doc/models/create-metered-component.md +++ b/doc/models/create-metered-component.md @@ -39,7 +39,29 @@ "unit_price": 23.26 } ], - "upgrade_charge": "none" + "price_points": [ + { + "name": "name2", + "handle": "handle8", + "pricing_scheme": "per_unit", + "interval": 92, + "interval_unit": "day" + }, + { + "name": "name2", + "handle": "handle8", + "pricing_scheme": "per_unit", + "interval": 92, + "interval_unit": "day" + }, + { + "name": "name2", + "handle": "handle8", + "pricing_scheme": "per_unit", + "interval": 92, + "interval_unit": "day" + } + ] } } ``` diff --git a/doc/models/create-on-off-component.md b/doc/models/create-on-off-component.md index b5450341..606acd56 100644 --- a/doc/models/create-on-off-component.md +++ b/doc/models/create-on-off-component.md @@ -20,14 +20,9 @@ "description": "description6", "handle": "handle2", "taxable": false, - "prices": [ - { - "starting_quantity": 242, - "ending_quantity": 40, - "unit_price": 23.26 - } - ], - "upgrade_charge": "full" + "upgrade_charge": "full", + "downgrade_credit": "full", + "unit_price": "String5" } } ``` diff --git a/doc/models/create-or-update-flat-amount-coupon.md b/doc/models/create-or-update-flat-amount-coupon.md deleted file mode 100644 index 561240f5..00000000 --- a/doc/models/create-or-update-flat-amount-coupon.md +++ /dev/null @@ -1,40 +0,0 @@ - -# Create or Update Flat Amount Coupon - -## Structure - -`CreateOrUpdateFlatAmountCoupon` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `name` | `str` | Required | the name of the coupon | -| `code` | `str` | Required | may contain uppercase alphanumeric characters and these special characters (which allow for email addresses to be used): “%”, “@”, “+”, “-”, “_”, and “.” | -| `description` | `str` | Optional | - | -| `amount_in_cents` | `long\|int` | Required | - | -| `allow_negative_balance` | `bool` | Optional | - | -| `recurring` | `bool` | Optional | - | -| `end_date` | `datetime` | Optional | - | -| `product_family_id` | `str` | Optional | - | -| `stackable` | `bool` | Optional | - | -| `compounding_strategy` | [`CompoundingStrategy`](../../doc/models/compounding-strategy.md) | Optional | - | -| `exclude_mid_period_allocations` | `bool` | Optional | - | -| `apply_on_cancel_at_end_of_period` | `bool` | Optional | - | -| `apply_on_subscription_expiration` | `bool` | Optional | - | - -## Example (as JSON) - -```json -{ - "name": "name0", - "code": "code8", - "description": "description0", - "amount_in_cents": 120, - "allow_negative_balance": false, - "recurring": false, - "end_date": "2016-03-13T12:52:32.123Z", - "product_family_id": "product_family_id4" -} -``` - diff --git a/doc/models/create-or-update-percentage-coupon.md b/doc/models/create-or-update-percentage-coupon.md deleted file mode 100644 index 0fd44928..00000000 --- a/doc/models/create-or-update-percentage-coupon.md +++ /dev/null @@ -1,40 +0,0 @@ - -# Create or Update Percentage Coupon - -## Structure - -`CreateOrUpdatePercentageCoupon` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `name` | `str` | Required | the name of the coupon | -| `code` | `str` | Required | may contain uppercase alphanumeric characters and these special characters (which allow for email addresses to be used): “%”, “@”, “+”, “-”, “_”, and “.” | -| `description` | `str` | Optional | - | -| `percentage` | str \| float | Required | This is a container for one-of cases. | -| `allow_negative_balance` | `bool` | Optional | - | -| `recurring` | `bool` | Optional | - | -| `end_date` | `datetime` | Optional | - | -| `product_family_id` | `str` | Optional | - | -| `stackable` | `bool` | Optional | - | -| `compounding_strategy` | [`CompoundingStrategy`](../../doc/models/compounding-strategy.md) | Optional | - | -| `exclude_mid_period_allocations` | `bool` | Optional | - | -| `apply_on_cancel_at_end_of_period` | `bool` | Optional | - | -| `apply_on_subscription_expiration` | `bool` | Optional | - | - -## Example (as JSON) - -```json -{ - "name": "name0", - "code": "code8", - "description": "description0", - "percentage": "String9", - "allow_negative_balance": false, - "recurring": false, - "end_date": "2016-03-13T12:52:32.123Z", - "product_family_id": "product_family_id6" -} -``` - diff --git a/doc/models/create-prepaid-component.md b/doc/models/create-prepaid-component.md index 0bdc66c0..402f80e0 100644 --- a/doc/models/create-prepaid-component.md +++ b/doc/models/create-prepaid-component.md @@ -21,7 +21,25 @@ "description": "description2", "handle": "handle8", "taxable": false, - "pricing_scheme": "per_unit" + "pricing_scheme": "per_unit", + "prices": [ + { + "starting_quantity": 242, + "ending_quantity": 40, + "unit_price": 23.26 + } + ], + "upgrade_charge": "full", + "overage_pricing": { + "pricing_scheme": "stairstep", + "prices": [ + { + "starting_quantity": 242, + "ending_quantity": 40, + "unit_price": 23.26 + } + ] + } } } ``` diff --git a/doc/models/create-prepaid-usage-component-price-point.md b/doc/models/create-prepaid-usage-component-price-point.md index b70a1427..8b58d57b 100644 --- a/doc/models/create-prepaid-usage-component-price-point.md +++ b/doc/models/create-prepaid-usage-component-price-point.md @@ -15,10 +15,10 @@ | `prices` | [`List[Price]`](../../doc/models/price.md) | Required | - | | `overage_pricing` | [`OveragePricing`](../../doc/models/overage-pricing.md) | Required | - | | `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.
**Default**: `True` | -| `rollover_prepaid_remainder` | `bool` | Optional | Boolean which controls whether or not remaining units should be rolled over to the next period | -| `renew_prepaid_allocation` | `bool` | Optional | Boolean which controls whether or not the allocated quantity should be renewed at the beginning of each period | +| `rollover_prepaid_remainder` | `bool` | Optional | (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` | Optional | (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` | Optional | (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`](../../doc/models/expiration-interval-unit.md) | Optional | A string representing the expiration interval unit for this component, either month or day | +| `expiration_interval_unit` | [`ExpirationIntervalUnit`](../../doc/models/expiration-interval-unit.md) | Optional | (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 | ## Example (as JSON) diff --git a/doc/models/currency-price.md b/doc/models/currency-price.md index 885db2db..989c4c1a 100644 --- a/doc/models/currency-price.md +++ b/doc/models/currency-price.md @@ -13,6 +13,8 @@ | `currency` | `str` | Optional | - | | `price` | `float` | Optional | - | | `formatted_price` | `str` | Optional | - | +| `price_id` | `int` | Optional | - | +| `price_point_id` | `int` | Optional | - | | `product_price_point_id` | `int` | Optional | - | | `role` | [`CurrencyPriceRole`](../../doc/models/currency-price-role.md) | Optional | Role for the price. | @@ -24,7 +26,7 @@ "currency": "currency6", "price": 41.36, "formatted_price": "formatted_price4", - "product_price_point_id": 210 + "price_id": 178 } ``` diff --git a/doc/models/currency-prices-response.md b/doc/models/currency-prices-response.md index eaed7d36..f418dbe8 100644 --- a/doc/models/currency-prices-response.md +++ b/doc/models/currency-prices-response.md @@ -21,7 +21,7 @@ "currency": "currency8", "price": 233.74, "formatted_price": "formatted_price6", - "product_price_point_id": 172 + "price_id": 116 } ] } diff --git a/doc/models/ebb-component.md b/doc/models/ebb-component.md index 4cb3b035..8e23d7fd 100644 --- a/doc/models/ebb-component.md +++ b/doc/models/ebb-component.md @@ -15,14 +15,11 @@ | `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. | | `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://help.chargify.com/products/product-components.html#general-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`. | +| `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. | | `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 the Avalara service to tax based on locale. This attribute has a max length of 10 characters. | | `hide_date_range_on_invoice` | `bool` | Optional | (Only available on Relationship Invoicing sites) Boolean flag describing if the service date range should show for the component on generated invoices. | -| `price_in_cents` | `str` | Optional | deprecated May 2011 - use unit_price instead | | `event_based_billing_metric_id` | `int` | Required | The ID of an event based billing metric that will be attached to this component. | | `interval` | `int` | Optional | 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`](../../doc/models/interval-unit.md) | Optional | 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. | @@ -44,7 +41,15 @@ "unit_price": 23.26 } ], - "upgrade_charge": "full", + "price_points": [ + { + "name": "name2", + "handle": "handle8", + "pricing_scheme": "per_unit", + "interval": 92, + "interval_unit": "day" + } + ], "event_based_billing_metric_id": 190 } ``` diff --git a/doc/models/event-key.md b/doc/models/event-key.md new file mode 100644 index 00000000..feb40461 --- /dev/null +++ b/doc/models/event-key.md @@ -0,0 +1,92 @@ + +# Event Key + +## Enumeration + +`EventKey` + +## Fields + +| Name | +| --- | +| `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` | + diff --git a/doc/models/event-response.md b/doc/models/event-response.md index 8afc31e7..75b10614 100644 --- a/doc/models/event-response.md +++ b/doc/models/event-response.md @@ -17,7 +17,7 @@ { "event": { "id": 242, - "key": "key0", + "key": "subscription_state_change", "message": "message0", "subscription_id": 96, "customer_id": 24, diff --git a/doc/models/event-type.md b/doc/models/event-type.md deleted file mode 100644 index 3dc52830..00000000 --- a/doc/models/event-type.md +++ /dev/null @@ -1,46 +0,0 @@ - -# Event Type - -## Enumeration - -`EventType` - -## Fields - -| Name | -| --- | -| `ACCOUNT_TRANSACTION_CHANGED` | -| `BILLING_DATE_CHANGE` | -| `COMPONENT_ALLOCATION_CHANGE` | -| `CUSTOMER_UPDATE` | -| `CUSTOMER_CREATE` | -| `DUNNING_STEP_REACHED` | -| `EXPIRATION_DATE_CHANGE` | -| `EXPIRING_CARD` | -| `METERED_USAGE` | -| `PAYMENT_SUCCESS` | -| `PAYMENT_SUCCESS_RECREATED` | -| `PAYMENT_FAILURE` | -| `PAYMENT_FAILURE_RECREATED` | -| `REFUND_FAILURE` | -| `REFUND_SUCCESS` | -| `RENEWAL_SUCCESS` | -| `RENEWAL_SUCCESS_RECREATED` | -| `RENEWAL_FAILURE` | -| `SIGNUP_SUCCESS` | -| `SIGNUP_FAILURE` | -| `STATEMENT_CLOSED` | -| `STATEMENT_SETTLED` | -| `SUBSCRIPTION_BANK_ACCOUNT_UPDATE` | -| `SUBSCRIPTION_DELETION` | -| `SUBSCRIPTION_PAYPAL_ACCOUNT_UPDATE` | -| `SUBSCRIPTION_PRODUCT_CHANGE` | -| `SUBSCRIPTION_STATE_CHANGE` | -| `TRIAL_END_NOTICE` | -| `UPGRADE_DOWNGRADE_SUCCESS` | -| `UPGRADE_DOWNGRADE_FAILURE` | -| `UPCOMING_RENEWAL_NOTICE` | -| `CUSTOM_FIELD_VALUE_CHANGE` | -| `SUBSCRIPTION_PREPAYMENT_ACCOUNT_BALANCE_CHANGED` | -| `SUBSCRIPTION_SERVICE_CREDIT_ACCOUNT_BALANCE_CHANGED` | - diff --git a/doc/models/event.md b/doc/models/event.md index eb708f77..36798eb0 100644 --- a/doc/models/event.md +++ b/doc/models/event.md @@ -10,19 +10,19 @@ | Name | Type | Tags | Description | | --- | --- | --- | --- | | `id` | `long\|int` | Required | - | -| `key` | `str` | Required | **Constraints**: *Minimum Length*: `1` | +| `key` | [`EventKey`](../../doc/models/event-key.md) | Required | - | | `message` | `str` | Required | **Constraints**: *Minimum Length*: `1` | | `subscription_id` | `int` | Required | - | | `customer_id` | `int` | Required | - | | `created_at` | `datetime` | Required | - | -| `event_specific_data` | [Subscription Product Change](../../doc/models/subscription-product-change.md) \| [Subscription State Change](../../doc/models/subscription-state-change.md) \| [Payment Related Events](../../doc/models/payment-related-events.md) \| [Refund Success](../../doc/models/refund-success.md) \| [Component Allocation Change](../../doc/models/component-allocation-change.md) \| [Metered Usage](../../doc/models/metered-usage.md) \| [Prepaid Usage](../../doc/models/prepaid-usage.md) \| [Dunning Step Reached](../../doc/models/dunning-step-reached.md) \| [Invoice Issued](../../doc/models/invoice-issued.md) \| [Pending Cancellation Change](../../doc/models/pending-cancellation-change.md) \| [Prepaid Subscription Balance Changed](../../doc/models/prepaid-subscription-balance-changed.md) \| [Proforma Invoice Issued](../../doc/models/proforma-invoice-issued.md) \| [Subscription Group Signup Success](../../doc/models/subscription-group-signup-success.md) \| [Subscription Group Signup Failure](../../doc/models/subscription-group-signup-failure.md) \| [Credit Account Balance Changed](../../doc/models/credit-account-balance-changed.md) \| [Prepayment Account Balance Changed](../../doc/models/prepayment-account-balance-changed.md) \| [Payment Collection Method Changed](../../doc/models/payment-collection-method-changed.md) \| [Item Price Point Changed](../../doc/models/item-price-point-changed.md) \| [Custom Field Value Change](../../doc/models/custom-field-value-change.md) \| None | Required | This is a container for one-of cases. | +| `event_specific_data` | [Subscription Product Change](../../doc/models/subscription-product-change.md) \| [Subscription State Change](../../doc/models/subscription-state-change.md) \| [Payment Related Events](../../doc/models/payment-related-events.md) \| [Refund Success](../../doc/models/refund-success.md) \| [Component Allocation Change](../../doc/models/component-allocation-change.md) \| [Metered Usage](../../doc/models/metered-usage.md) \| [Prepaid Usage](../../doc/models/prepaid-usage.md) \| [Dunning Step Reached](../../doc/models/dunning-step-reached.md) \| [Invoice Issued](../../doc/models/invoice-issued.md) \| [Pending Cancellation Change](../../doc/models/pending-cancellation-change.md) \| [Prepaid Subscription Balance Changed](../../doc/models/prepaid-subscription-balance-changed.md) \| [Proforma Invoice Issued](../../doc/models/proforma-invoice-issued.md) \| [Subscription Group Signup Event Data](../../doc/models/subscription-group-signup-event-data.md) \| [Credit Account Balance Changed](../../doc/models/credit-account-balance-changed.md) \| [Prepayment Account Balance Changed](../../doc/models/prepayment-account-balance-changed.md) \| [Payment Collection Method Changed](../../doc/models/payment-collection-method-changed.md) \| [Item Price Point Changed](../../doc/models/item-price-point-changed.md) \| [Custom Field Value Change](../../doc/models/custom-field-value-change.md) \| None | Required | This is a container for one-of cases. | ## Example (as JSON) ```json { "id": 40, - "key": "key2", + "key": "invoice_issued", "message": "message8", "subscription_id": 150, "customer_id": 78, diff --git a/doc/models/invoice-avatax-details.md b/doc/models/invoice-avatax-details.md new file mode 100644 index 00000000..4b42eb8e --- /dev/null +++ b/doc/models/invoice-avatax-details.md @@ -0,0 +1,29 @@ + +# Invoice Avatax Details + +## Structure + +`InvoiceAvataxDetails` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `id` | `long\|int` | Optional | - | +| `status` | `str` | Optional | - | +| `document_code` | `str` | Optional | - | +| `commit_date` | `datetime` | Optional | - | +| `modify_date` | `datetime` | Optional | - | + +## Example (as JSON) + +```json +{ + "id": 112, + "status": "status2", + "document_code": "document_code0", + "commit_date": "2016-03-13T12:52:32.123Z", + "modify_date": "2016-03-13T12:52:32.123Z" +} +``` + diff --git a/doc/models/invoice-debit.md b/doc/models/invoice-debit.md new file mode 100644 index 00000000..32613922 --- /dev/null +++ b/doc/models/invoice-debit.md @@ -0,0 +1,32 @@ + +# Invoice Debit + +## Structure + +`InvoiceDebit` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `uid` | `str` | Optional | - | +| `debit_note_number` | `str` | Optional | - | +| `debit_note_uid` | `str` | Optional | - | +| `role` | [`DebitNoteRole`](../../doc/models/debit-note-role.md) | Optional | The role of the debit note. | +| `transaction_time` | `datetime` | Optional | - | +| `memo` | `str` | Optional | - | +| `original_amount` | `str` | Optional | - | +| `applied_amount` | `str` | Optional | - | + +## Example (as JSON) + +```json +{ + "uid": "uid2", + "debit_note_number": "debit_note_number2", + "debit_note_uid": "debit_note_uid8", + "role": "chargeback", + "transaction_time": "2016-03-13T12:52:32.123Z" +} +``` + diff --git a/doc/models/invoice-line-item.md b/doc/models/invoice-line-item.md index ba4e53a8..c0b7457c 100644 --- a/doc/models/invoice-line-item.md +++ b/doc/models/invoice-line-item.md @@ -26,6 +26,7 @@ | `product_version` | `int` | Optional | The version of the product subscribed when the charge was made. | | `component_id` | `int` | Optional | The ID of the component being billed. Will be `nil` for non-component charges. | | `price_point_id` | `int` | Optional | The price point ID of the component being billed. Will be `nil` for non-component charges. | +| `billing_schedule_item_id` | `int` | Optional | - | | `hide` | `bool` | Optional | - | | `component_cost_data` | [`InvoiceLineItemComponentCostData`](../../doc/models/invoice-line-item-component-cost-data.md) | Optional | - | | `product_price_point_id` | `int` | Optional | The price point ID of the line item's product | diff --git a/doc/models/invoice-status.md b/doc/models/invoice-status.md index c4242ed9..87ba0765 100644 --- a/doc/models/invoice-status.md +++ b/doc/models/invoice-status.md @@ -17,4 +17,5 @@ The current status of the invoice. See [Invoice Statuses](https://maxio.zendesk. | `PENDING` | | `VOIDED` | | `CANCELED` | +| `PROCESSING` | diff --git a/doc/models/invoice.md b/doc/models/invoice.md index b639bc80..7d88514d 100644 --- a/doc/models/invoice.md +++ b/doc/models/invoice.md @@ -48,6 +48,7 @@ | `tax_amount` | `str` | Optional | Total tax on the invoice. | | `total_amount` | `str` | Optional | The invoice total, which is `subtotal_amount - discount_amount + tax_amount`.' | | `credit_amount` | `str` | Optional | The amount of credit (from credit notes) applied to this invoice.

Credits offset the amount due from the customer. | +| `debit_amount` | `str` | Optional | - | | `refund_amount` | `str` | Optional | - | | `paid_amount` | `str` | Optional | The amount paid on the invoice by the customer. | | `due_amount` | `str` | Optional | Amount due on the invoice, which is `total_amount - credit_amount - paid_amount`. | @@ -55,10 +56,12 @@ | `discounts` | [`List[InvoiceDiscount]`](../../doc/models/invoice-discount.md) | Optional | - | | `taxes` | [`List[InvoiceTax]`](../../doc/models/invoice-tax.md) | Optional | - | | `credits` | [`List[InvoiceCredit]`](../../doc/models/invoice-credit.md) | Optional | - | +| `debits` | [`List[InvoiceDebit]`](../../doc/models/invoice-debit.md) | Optional | - | | `refunds` | [`List[InvoiceRefund]`](../../doc/models/invoice-refund.md) | Optional | - | | `payments` | [`List[InvoicePayment]`](../../doc/models/invoice-payment.md) | Optional | - | | `custom_fields` | [`List[InvoiceCustomField]`](../../doc/models/invoice-custom-field.md) | Optional | - | | `display_settings` | [`InvoiceDisplaySettings`](../../doc/models/invoice-display-settings.md) | Optional | - | +| `avatax_details` | [`InvoiceAvataxDetails`](../../doc/models/invoice-avatax-details.md) | Optional | - | | `public_url` | `str` | Optional | The public URL of the invoice | | `previous_balance_data` | [`InvoicePreviousBalance`](../../doc/models/invoice-previous-balance.md) | Optional | - | | `public_url_expires_on` | `date` | Optional | The format is `"YYYY-MM-DD"`. | diff --git a/doc/models/issue-invoice-event-data.md b/doc/models/issue-invoice-event-data.md index 12343544..02e12f7c 100644 --- a/doc/models/issue-invoice-event-data.md +++ b/doc/models/issue-invoice-event-data.md @@ -22,8 +22,8 @@ Example schema for an `issue_invoice` event ```json { "consolidation_level": "none", - "from_status": "draft", - "to_status": "voided", + "from_status": "voided", + "to_status": "draft", "due_amount": "due_amount6", "total_amount": "total_amount0" } diff --git a/doc/models/issue-invoice-event.md b/doc/models/issue-invoice-event.md index 6b8d929f..d1328933 100644 --- a/doc/models/issue-invoice-event.md +++ b/doc/models/issue-invoice-event.md @@ -35,8 +35,8 @@ "event_type": "issue_invoice", "event_data": { "consolidation_level": "child", - "from_status": "paid", - "to_status": "paid", + "from_status": "open", + "to_status": "pending", "due_amount": "due_amount8", "total_amount": "total_amount2" } diff --git a/doc/models/metered-component.md b/doc/models/metered-component.md index 2c2a6a59..93eb1d54 100644 --- a/doc/models/metered-component.md +++ b/doc/models/metered-component.md @@ -16,13 +16,10 @@ | `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`. | | `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 the Avalara service to tax based on locale. This attribute has a max length of 10 characters. | | `hide_date_range_on_invoice` | `bool` | Optional | (Only available on Relationship Invoicing sites) Boolean flag describing if the service date range should show for the component on generated invoices. | -| `price_in_cents` | `str` | Optional | deprecated May 2011 - use unit_price instead | | `display_on_hosted_page` | `bool` | Optional | - | | `allow_fractional_quantities` | `bool` | Optional | - | | `public_signup_page_ids` | `List[int]` | Optional | - | @@ -46,7 +43,15 @@ "unit_price": 23.26 } ], - "upgrade_charge": "full" + "price_points": [ + { + "name": "name2", + "handle": "handle8", + "pricing_scheme": "per_unit", + "interval": 92, + "interval_unit": "day" + } + ] } ``` diff --git a/doc/models/reason-codes-json-response.md b/doc/models/ok-response.md similarity index 70% rename from doc/models/reason-codes-json-response.md rename to doc/models/ok-response.md index 70aa9fe4..3562bd7d 100644 --- a/doc/models/reason-codes-json-response.md +++ b/doc/models/ok-response.md @@ -1,9 +1,9 @@ -# Reason Codes Json Response +# Ok Response ## Structure -`ReasonCodesJsonResponse` +`OkResponse` ## Fields @@ -15,7 +15,7 @@ ```json { - "ok": "ok2" + "ok": "ok4" } ``` diff --git a/doc/models/on-off-component.md b/doc/models/on-off-component.md index d2d3ee5d..6a486ded 100644 --- a/doc/models/on-off-component.md +++ b/doc/models/on-off-component.md @@ -13,14 +13,12 @@ | `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. | -| `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/24261191737101-Price-Points-Components) 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`. | | `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. | +| `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 the Avalara service to tax based on locale. This attribute has a max length of 10 characters. | | `hide_date_range_on_invoice` | `bool` | Optional | (Only available on Relationship Invoicing sites) Boolean flag describing if the service date range should show for the component on generated invoices. | -| `price_in_cents` | `str` | Optional | deprecated May 2011 - use unit_price instead | | `display_on_hosted_page` | `bool` | Optional | - | | `allow_fractional_quantities` | `bool` | Optional | - | | `public_signup_page_ids` | `List[int]` | Optional | - | @@ -35,24 +33,9 @@ "description": "description2", "handle": "handle8", "taxable": false, - "prices": [ - { - "starting_quantity": 242, - "ending_quantity": 40, - "unit_price": 23.26 - }, - { - "starting_quantity": 242, - "ending_quantity": 40, - "unit_price": 23.26 - }, - { - "starting_quantity": 242, - "ending_quantity": 40, - "unit_price": 23.26 - } - ], - "upgrade_charge": "prorated" + "upgrade_charge": "prorated", + "downgrade_credit": "prorated", + "unit_price": "String1" } ``` diff --git a/doc/models/paid-invoice.md b/doc/models/paid-invoice.md index 9b7a710a..d475bca4 100644 --- a/doc/models/paid-invoice.md +++ b/doc/models/paid-invoice.md @@ -19,7 +19,7 @@ ```json { "invoice_id": "invoice_id6", - "status": "draft", + "status": "open", "due_amount": "due_amount8", "paid_amount": "paid_amount8" } diff --git a/doc/models/prepaid-component-price-point.md b/doc/models/prepaid-component-price-point.md deleted file mode 100644 index df697d14..00000000 --- a/doc/models/prepaid-component-price-point.md +++ /dev/null @@ -1,49 +0,0 @@ - -# Prepaid Component Price Point - -## Structure - -`PrepaidComponentPricePoint` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `name` | `str` | Optional | - | -| `handle` | `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. | -| `prices` | [`List[Price]`](../../doc/models/price.md) | Optional | - | -| `overage_pricing` | [`OveragePricing`](../../doc/models/overage-pricing.md) | Optional | - | - -## Example (as JSON) - -```json -{ - "name": "name8", - "handle": "handle4", - "pricing_scheme": "stairstep", - "prices": [ - { - "starting_quantity": 242, - "ending_quantity": 40, - "unit_price": 23.26 - }, - { - "starting_quantity": 242, - "ending_quantity": 40, - "unit_price": 23.26 - } - ], - "overage_pricing": { - "pricing_scheme": "stairstep", - "prices": [ - { - "starting_quantity": 242, - "ending_quantity": 40, - "unit_price": 23.26 - } - ] - } -} -``` - diff --git a/doc/models/prepaid-usage-component.md b/doc/models/prepaid-usage-component.md index c07678a9..c6c46622 100644 --- a/doc/models/prepaid-usage-component.md +++ b/doc/models/prepaid-usage-component.md @@ -10,20 +10,19 @@ | Name | Type | Tags | Description | | --- | --- | --- | --- | | `name` | `str` | Required | A name for this component that is suitable for showing customers and displaying on billing statements, ie. "Minutes". | -| `unit_name` | `str` | Optional | 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 | +| `unit_name` | `str` | Required | 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` | 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. | -| `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. | +| `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`. | -| `price_points` | [`List[PrepaidComponentPricePoint]`](../../doc/models/prepaid-component-price-point.md) | Optional | - | +| `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 the Avalara service to tax based on locale. This attribute has a max length of 10 characters. | | `hide_date_range_on_invoice` | `bool` | Optional | (Only available on Relationship Invoicing sites) Boolean flag describing if the service date range should show for the component on generated invoices. | -| `price_in_cents` | `str` | Optional | deprecated May 2011 - use unit_price instead | -| `overage_pricing` | [`OveragePricing`](../../doc/models/overage-pricing.md) | Optional | - | +| `overage_pricing` | [`OveragePricing`](../../doc/models/overage-pricing.md) | Required | - | | `rollover_prepaid_remainder` | `bool` | Optional | Boolean which controls whether or not remaining units should be rolled over to the next period | | `renew_prepaid_allocation` | `bool` | Optional | Boolean which controls whether or not the allocated quantity should be renewed at the beginning of each period | | `expiration_interval` | `float` | Optional | (only for prepaid usage components where rollover_prepaid_remainder is true) The number of `expiration_interval_unit`s after which rollover amounts should expire | @@ -41,7 +40,30 @@ "description": "description8", "handle": "handle8", "taxable": false, - "pricing_scheme": "stairstep" + "pricing_scheme": "stairstep", + "prices": [ + { + "starting_quantity": 242, + "ending_quantity": 40, + "unit_price": 23.26 + }, + { + "starting_quantity": 242, + "ending_quantity": 40, + "unit_price": 23.26 + } + ], + "upgrade_charge": "prorated", + "overage_pricing": { + "pricing_scheme": "stairstep", + "prices": [ + { + "starting_quantity": 242, + "ending_quantity": 40, + "unit_price": 23.26 + } + ] + } } ``` diff --git a/doc/models/quantity-based-component.md b/doc/models/quantity-based-component.md index fb0b49f0..9e37cf15 100644 --- a/doc/models/quantity-based-component.md +++ b/doc/models/quantity-based-component.md @@ -22,7 +22,6 @@ | `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 the Avalara service to tax based on locale. This attribute has a max length of 10 characters. | | `hide_date_range_on_invoice` | `bool` | Optional | (Only available on Relationship Invoicing sites) Boolean flag describing if the service date range should show for the component on generated invoices. | -| `price_in_cents` | `str` | Optional | deprecated May 2011 - use unit_price instead | | `recurring` | `bool` | Optional | - | | `display_on_hosted_page` | `bool` | Optional | - | | `allow_fractional_quantities` | `bool` | Optional | - | diff --git a/doc/models/subscription-group-member-error.md b/doc/models/subscription-group-member-error.md deleted file mode 100644 index e54e5913..00000000 --- a/doc/models/subscription-group-member-error.md +++ /dev/null @@ -1,25 +0,0 @@ - -# Subscription Group Member Error - -## Structure - -`SubscriptionGroupMemberError` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `id` | `int` | Optional | - | -| `mtype` | `str` | Optional | - | -| `message` | `str` | Optional | - | - -## Example (as JSON) - -```json -{ - "id": 56, - "type": "type8", - "message": "message2" -} -``` - diff --git a/doc/models/subscription-group-signup-failure.md b/doc/models/subscription-group-signup-event-data.md similarity index 67% rename from doc/models/subscription-group-signup-failure.md rename to doc/models/subscription-group-signup-event-data.md index 3c742c4a..ac30e581 100644 --- a/doc/models/subscription-group-signup-failure.md +++ b/doc/models/subscription-group-signup-event-data.md @@ -1,16 +1,16 @@ -# Subscription Group Signup Failure +# Subscription Group Signup Event Data ## Structure -`SubscriptionGroupSignupFailure` +`SubscriptionGroupSignupEventData` ## Fields | Name | Type | Tags | Description | | --- | --- | --- | --- | | `subscription_group` | [`SubscriptionGroupSignupFailureData`](../../doc/models/subscription-group-signup-failure-data.md) | Required | - | -| `customer` | `str` | Required | - | +| `customer` | [`Customer`](../../doc/models/customer.md) | Required | - | ## Example (as JSON) @@ -29,7 +29,13 @@ "organization": "organization6" } }, - "customer": "customer8" + "customer": { + "first_name": "first_name0", + "last_name": "last_name8", + "email": "email6", + "cc_emails": "cc_emails0", + "organization": "organization6" + } } ``` diff --git a/doc/models/subscription-group-signup-success-data.md b/doc/models/subscription-group-signup-success-data.md deleted file mode 100644 index c210a3d7..00000000 --- a/doc/models/subscription-group-signup-success-data.md +++ /dev/null @@ -1,40 +0,0 @@ - -# Subscription Group Signup Success Data - -## Structure - -`SubscriptionGroupSignupSuccessData` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `uid` | `str` | Required | - | -| `scheme` | `int` | Required | - | -| `customer_id` | `int` | Required | - | -| `payment_profile_id` | `int` | Required | - | -| `subscription_ids` | `List[int]` | Required | - | -| `primary_subscription_id` | `int` | Required | - | -| `next_assessment_at` | `datetime` | Required | - | -| `state` | `str` | Required | - | -| `cancel_at_end_of_period` | `bool` | Required | - | - -## Example (as JSON) - -```json -{ - "uid": "uid8", - "scheme": 154, - "customer_id": 174, - "payment_profile_id": 82, - "subscription_ids": [ - 28, - 29 - ], - "primary_subscription_id": 102, - "next_assessment_at": "2016-03-13T12:52:32.123Z", - "state": "state4", - "cancel_at_end_of_period": false -} -``` - diff --git a/doc/models/subscription-group-signup-success.md b/doc/models/subscription-group-signup-success.md deleted file mode 100644 index 83dc7df8..00000000 --- a/doc/models/subscription-group-signup-success.md +++ /dev/null @@ -1,42 +0,0 @@ - -# Subscription Group Signup Success - -## Structure - -`SubscriptionGroupSignupSuccess` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `subscription_group` | [`SubscriptionGroupSignupSuccessData`](../../doc/models/subscription-group-signup-success-data.md) | Required | - | -| `customer` | [`Customer`](../../doc/models/customer.md) | Required | - | - -## Example (as JSON) - -```json -{ - "subscription_group": { - "uid": "uid8", - "scheme": 200, - "customer_id": 220, - "payment_profile_id": 128, - "subscription_ids": [ - 74, - 75 - ], - "primary_subscription_id": 148, - "next_assessment_at": "2016-03-13T12:52:32.123Z", - "state": "state6", - "cancel_at_end_of_period": false - }, - "customer": { - "first_name": "first_name0", - "last_name": "last_name8", - "email": "email6", - "cc_emails": "cc_emails0", - "organization": "organization6" - } -} -``` - diff --git a/doc/models/subscription-group-update-error-response-exception.md b/doc/models/subscription-group-update-error-response-exception.md index 74c33370..a5889eb8 100644 --- a/doc/models/subscription-group-update-error-response-exception.md +++ b/doc/models/subscription-group-update-error-response-exception.md @@ -17,16 +17,8 @@ { "errors": { "members": [ - { - "id": 204, - "type": "type2", - "message": "message8" - }, - { - "id": 204, - "type": "type2", - "message": "message8" - } + "members2", + "members1" ] } } diff --git a/doc/models/subscription-group-update-error.md b/doc/models/subscription-group-update-error.md index 7248bec8..7d6fbd3c 100644 --- a/doc/models/subscription-group-update-error.md +++ b/doc/models/subscription-group-update-error.md @@ -9,28 +9,16 @@ | Name | Type | Tags | Description | | --- | --- | --- | --- | -| `members` | [`List[SubscriptionGroupMemberError]`](../../doc/models/subscription-group-member-error.md) | Optional | - | +| `members` | `List[str]` | Optional | - | ## Example (as JSON) ```json { "members": [ - { - "id": 204, - "type": "type2", - "message": "message8" - }, - { - "id": 204, - "type": "type2", - "message": "message8" - }, - { - "id": 204, - "type": "type2", - "message": "message8" - } + "members4", + "members5", + "members6" ] } ``` diff --git a/doc/models/subscription-response-error-exception.md b/doc/models/subscription-response-error-exception.md new file mode 100644 index 00000000..7431e8a4 --- /dev/null +++ b/doc/models/subscription-response-error-exception.md @@ -0,0 +1,27 @@ + +# Subscription Response Error Exception + +## Structure + +`SubscriptionResponseErrorException` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `subscription` | [`Subscription`](../../doc/models/subscription.md) | Optional | - | + +## Example (as JSON) + +```json +{ + "subscription": { + "id": 8, + "state": "paused", + "balance_in_cents": 124, + "total_revenue_in_cents": 48, + "product_price_in_cents": 238 + } +} +``` + diff --git a/doc/models/update-currency-price.md b/doc/models/update-currency-price.md index 99bff65f..9f0c45fe 100644 --- a/doc/models/update-currency-price.md +++ b/doc/models/update-currency-price.md @@ -10,14 +10,14 @@ | Name | Type | Tags | Description | | --- | --- | --- | --- | | `id` | `int` | Required | ID of the currency price record being updated | -| `price` | `int` | Required | New price for the given currency | +| `price` | `float` | Required | New price for the given currency | ## Example (as JSON) ```json { "id": 146, - "price": 18 + "price": 71.86 } ``` diff --git a/doc/models/update-currency-prices-request.md b/doc/models/update-currency-prices-request.md index eb08cff5..d6680540 100644 --- a/doc/models/update-currency-prices-request.md +++ b/doc/models/update-currency-prices-request.md @@ -18,7 +18,7 @@ "currency_prices": [ { "id": 50, - "price": 78 + "price": 233.74 } ] } diff --git a/pyproject.toml b/pyproject.toml index c4883e38..bb7f7693 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,13 +4,13 @@ requires = ["setuptools>=61.0"] [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 = "5.2.0" +version = "6.0.0" readme = "README.md" requires-python = ">=3.7" keywords = ["Maxio", "Advaced Billing", "Payments", "Subscription"] authors = [{name = "Maxio SDK", email = "maxio-sdk@maxio.com"}] urls = {Homepage = "https://www.maxio.com/product/advanced-billing"} -dependencies = ["apimatic-core~=0.2.0, >= 0.2.15", "apimatic-core-interfaces~=0.1.0, >= 0.1.5", "apimatic-requests-client-adapter~=0.1.0, >= 0.1.6", "deprecation~=2.1", "python-dateutil~=2.8.1"] +dependencies = ["apimatic-core~=0.2.0, >= 0.2.17", "apimatic-core-interfaces~=0.1.0, >= 0.1.5", "apimatic-requests-client-adapter~=0.1.0, >= 0.1.6", "deprecation~=2.1"] classifiers = [] [project.optional-dependencies] testutils = ["pytest>=7.2.2"] diff --git a/requirements.txt b/requirements.txt index 59d6422e..c6c51b54 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,4 @@ -apimatic-core~=0.2.0, >= 0.2.15 +apimatic-core~=0.2.0, >= 0.2.17 apimatic-core-interfaces~=0.1.0, >= 0.1.5 apimatic-requests-client-adapter~=0.1.0, >= 0.1.6 -python-dateutil~=2.8.1 deprecation~=2.1 diff --git a/tests/conftest.py b/tests/conftest.py index 9aea748e..c8309525 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -22,7 +22,6 @@ BASIC_AUTH_USERNAME = os.getenv("BASIC_AUTH_USERNAME") BASIC_AUTH_PASSWORD = os.getenv("BASIC_AUTH_PASSWORD") -DOMAIN = os.getenv("DOMAIN") SUBDOMAIN = os.getenv("SUBDOMAIN") @@ -41,8 +40,7 @@ def clean_custom_fields(client: AdvancedBillingClient): @pytest.fixture(scope="session", autouse=True) def client() -> AdvancedBillingClient: client = AdvancedBillingClient( - subdomain=SUBDOMAIN, - domain=DOMAIN, + site=SUBDOMAIN, basic_auth_credentials=BasicAuthCredentials( username=BASIC_AUTH_USERNAME, password=BASIC_AUTH_PASSWORD @@ -50,7 +48,7 @@ def client() -> AdvancedBillingClient: ) clean_custom_fields(client) - client.sites.clear_site() + #client.sites.clear_site() sleep(10) # Wait for site to be cleared as it takes some time yield client @@ -59,8 +57,7 @@ def client() -> AdvancedBillingClient: @pytest.fixture(scope="session") def unauthorized_client() -> AdvancedBillingClient: return AdvancedBillingClient( - subdomain=SUBDOMAIN, - domain=DOMAIN, + site=SUBDOMAIN, basic_auth_credentials=BasicAuthCredentials( username="thisiswrongapitokenthisiswrongapitokenV8", password=BASIC_AUTH_PASSWORD diff --git a/tests/data/init_cases.py b/tests/data/init_cases.py index 11c07cfa..388bd227 100644 --- a/tests/data/init_cases.py +++ b/tests/data/init_cases.py @@ -1,3 +1,4 @@ +from random import Random from uuid import uuid4 from advancedbilling.models.component import Component @@ -198,7 +199,7 @@ def get_allocation_request( def get_coupon_data() -> dict: return { "name": "15% off", - "code": "15OFF", + "code": "15OFF" + str(Random().randint(1000, 10000)), "percentage": "15", "description": "15% off for life", "allow_negative_balance": False, diff --git a/tests/test_invoices.py b/tests/test_invoices.py index 22c44bd1..9d941911 100644 --- a/tests/test_invoices.py +++ b/tests/test_invoices.py @@ -18,7 +18,7 @@ from advancedbilling.models.coupon import Coupon from advancedbilling.models.create_customer_request import CreateCustomerRequest from advancedbilling.models.create_invoice_request import CreateInvoiceRequest -from advancedbilling.models.create_or_update_coupon import CreateOrUpdateCoupon +from advancedbilling.models.coupon_request import CouponRequest from advancedbilling.models.create_or_update_product_request import ( CreateOrUpdateProductRequest, ) @@ -75,7 +75,7 @@ def test_create_invoice_given_subscription_then_return_correct_invoice( ).payment_profile coupon: Coupon = coupons_controller.create_coupon( - product_family.id, CreateOrUpdateCoupon(InitCases.get_coupon_data()) + product_family.id, CouponRequest(InitCases.get_coupon_data()) ).coupon subscription: Subscription = subscriptions_controller.create_subscription(