From 385739cba30b651152e10ce8957a8456481e6b97 Mon Sep 17 00:00:00 2001 From: p-zielinski Date: Mon, 7 Oct 2024 10:22:27 +0200 Subject: [PATCH] v4.0.0 Co-Authored-By: Patryk Smolarz <77458595+patricioo1@users.noreply.github.com> --- ENDPOINTS-COVERAGE.md | 84 +- README.md | 267 +- __tests__/test_02_redemption.py | 19 +- docs/BinApi.md | 187 + docs/CampaignBase.md | 1 + docs/CampaignsApi.md | 7 +- docs/CampaignsCreateRequestBody.md | 1 - docs/CampaignsCreateResponseBody.md | 1 + docs/CampaignsGetResponseBody.md | 1 + docs/CampaignsUpdateRequestBody.md | 19 +- docs/CampaignsUpdateResponseBody.md | 1 + docs/FilterConditionsDateTime.md | 18 + docs/FilterConditionsDateTimeConditions.md | 18 + docs/LoyaltiesCreateCampaignResponseBody.md | 1 + docs/LoyaltiesGetCampaignResponseBody.md | 1 + docs/LoyaltiesUpdateCampaignResponseBody.md | 1 + docs/LoyaltyCampaign.md | 1 + docs/ManagementApi.md | 3189 +++++ docs/ManagementProject.md | 34 + .../ManagementProjectApiUsageNotifications.md | 18 + docs/ManagementProjectDefaultCodeConfig.md | 13 + docs/ManagementProjectLimits.md | 14 + docs/ManagementProjectLimitsApiCallsItem.md | 14 + ...ManagementProjectLimitsBulkApiCallsItem.md | 14 + ...mentProjectWebhooksCalloutNotifications.md | 14 + ...bhooksCalloutNotificationsDistributions.md | 15 + ...ectWebhooksCalloutNotificationsWebhooks.md | 15 + docs/ManagementProjectsBranding.md | 17 + docs/ManagementProjectsBrandingAddress.md | 17 + docs/ManagementProjectsBrandingBrand.md | 17 + docs/ManagementProjectsBrandingCockpits.md | 20 + docs/ManagementProjectsBrandingContact.md | 14 + ...gementProjectsBrandingCreateRequestBody.md | 16 + ...rojectsBrandingCreateRequestBodyAddress.md | 17 + ...tProjectsBrandingCreateRequestBodyBrand.md | 17 + ...ojectsBrandingCreateRequestBodyCockpits.md | 20 + ...rojectsBrandingCreateRequestBodyContact.md | 14 + ...ementProjectsBrandingCreateResponseBody.md | 17 + ...ojectsBrandingCreateResponseBodyAddress.md | 17 + ...ProjectsBrandingCreateResponseBodyBrand.md | 17 + ...jectsBrandingCreateResponseBodyCockpits.md | 20 + ...ojectsBrandingCreateResponseBodyContact.md | 14 + ...nagementProjectsBrandingGetResponseBody.md | 17 + ...tProjectsBrandingGetResponseBodyAddress.md | 17 + ...entProjectsBrandingGetResponseBodyBrand.md | 17 + ...ProjectsBrandingGetResponseBodyCockpits.md | 20 + ...tProjectsBrandingGetResponseBodyContact.md | 14 + ...agementProjectsBrandingListResponseBody.md | 16 + ...gementProjectsBrandingUpdateRequestBody.md | 15 + ...rojectsBrandingUpdateRequestBodyAddress.md | 17 + ...tProjectsBrandingUpdateRequestBodyBrand.md | 17 + ...ojectsBrandingUpdateRequestBodyCockpits.md | 20 + ...rojectsBrandingUpdateRequestBodyContact.md | 14 + ...ementProjectsBrandingUpdateResponseBody.md | 17 + ...ojectsBrandingUpdateResponseBodyAddress.md | 17 + ...ProjectsBrandingUpdateResponseBodyBrand.md | 17 + ...jectsBrandingUpdateResponseBodyCockpits.md | 20 + ...ojectsBrandingUpdateResponseBodyContact.md | 14 + docs/ManagementProjectsCreateRequestBody.md | 31 + ...sCreateRequestBodyApiUsageNotifications.md | 18 + ...ementProjectsCreateRequestBodyUsersItem.md | 15 + ...RequestBodyWebhooksCalloutNotifications.md | 14 + ...bhooksCalloutNotificationsDistributions.md | 15 + ...odyWebhooksCalloutNotificationsWebhooks.md | 15 + docs/ManagementProjectsCreateResponseBody.md | 35 + ...CreateResponseBodyApiUsageNotifications.md | 18 + ...ProjectsCreateResponseBodyClientSideKey.md | 14 + ...ProjectsCreateResponseBodyServerSideKey.md | 14 + ...esponseBodyWebhooksCalloutNotifications.md | 14 + ...bhooksCalloutNotificationsDistributions.md | 15 + ...odyWebhooksCalloutNotificationsWebhooks.md | 15 + docs/ManagementProjectsCustomEventSchema.md | 18 + ...nagementProjectsCustomEventSchemaSchema.md | 13 + ...ectsCustomEventSchemasCreateRequestBody.md | 14 + ...stomEventSchemasCreateRequestBodySchema.md | 13 + ...ctsCustomEventSchemasCreateResponseBody.md | 18 + ...tomEventSchemasCreateResponseBodySchema.md | 13 + ...ojectsCustomEventSchemasGetResponseBody.md | 18 + ...CustomEventSchemasGetResponseBodySchema.md | 13 + ...jectsCustomEventSchemasListResponseBody.md | 16 + ...ectsCustomEventSchemasUpdateRequestBody.md | 13 + ...stomEventSchemasUpdateRequestBodySchema.md | 13 + ...ctsCustomEventSchemasUpdateResponseBody.md | 18 + ...tomEventSchemasUpdateResponseBodySchema.md | 13 + docs/ManagementProjectsGetResponseBody.md | 34 + ...ctsGetResponseBodyApiUsageNotifications.md | 18 + ...rojectsGetResponseBodyDefaultCodeConfig.md | 13 + ...ManagementProjectsGetResponseBodyLimits.md | 14 + ...ojectsGetResponseBodyLimitsApiCallsItem.md | 14 + ...tsGetResponseBodyLimitsBulkApiCallsItem.md | 14 + ...esponseBodyWebhooksCalloutNotifications.md | 14 + ...bhooksCalloutNotificationsDistributions.md | 15 + ...odyWebhooksCalloutNotificationsWebhooks.md | 15 + docs/ManagementProjectsListResponseBody.md | 16 + docs/ManagementProjectsMetadataSchema.md | 19 + ...rojectsMetadataSchemasCreateRequestBody.md | 15 + ...ojectsMetadataSchemasCreateResponseBody.md | 19 + ...tProjectsMetadataSchemasGetResponseBody.md | 19 + ...ProjectsMetadataSchemasListResponseBody.md | 16 + ...rojectsMetadataSchemasUpdateRequestBody.md | 14 + ...ojectsMetadataSchemasUpdateResponseBody.md | 19 + docs/ManagementProjectsStackingRules.md | 27 + ...tProjectsStackingRulesCreateRequestBody.md | 24 + ...ProjectsStackingRulesCreateResponseBody.md | 27 + ...entProjectsStackingRulesGetResponseBody.md | 27 + ...ntProjectsStackingRulesListResponseBody.md | 16 + ...tProjectsStackingRulesUpdateRequestBody.md | 24 + ...ProjectsStackingRulesUpdateResponseBody.md | 27 + docs/ManagementProjectsUpdateRequestBody.md | 28 + ...sUpdateRequestBodyApiUsageNotifications.md | 18 + ...jectsUpdateRequestBodyDefaultCodeConfig.md | 13 + ...RequestBodyWebhooksCalloutNotifications.md | 14 + ...bhooksCalloutNotificationsDistributions.md | 15 + ...odyWebhooksCalloutNotificationsWebhooks.md | 15 + docs/ManagementProjectsUpdateResponseBody.md | 34 + ...UpdateResponseBodyApiUsageNotifications.md | 18 + ...ectsUpdateResponseBodyDefaultCodeConfig.md | 13 + ...agementProjectsUpdateResponseBodyLimits.md | 14 + ...ctsUpdateResponseBodyLimitsApiCallsItem.md | 14 + ...pdateResponseBodyLimitsBulkApiCallsItem.md | 14 + ...esponseBodyWebhooksCalloutNotifications.md | 14 + ...bhooksCalloutNotificationsDistributions.md | 15 + ...odyWebhooksCalloutNotificationsWebhooks.md | 15 + ...anagementProjectsUsersAssignRequestBody.md | 14 + ...nagementProjectsUsersAssignResponseBody.md | 19 + ...agementProjectsUsersGetUserResponseBody.md | 19 + ...entProjectsUsersInviteCreateRequestBody.md | 16 + ...ManagementProjectsUsersListResponseBody.md | 16 + ...ementProjectsUsersUpdateRoleRequestBody.md | 12 + ...mentProjectsUsersUpdateRoleResponseBody.md | 19 + docs/ManagementProjectsWebhook.md | 18 + ...gementProjectsWebhooksCreateRequestBody.md | 15 + ...ementProjectsWebhooksCreateResponseBody.md | 18 + ...nagementProjectsWebhooksGetResponseBody.md | 18 + ...agementProjectsWebhooksListResponseBody.md | 16 + ...gementProjectsWebhooksUpdateRequestBody.md | 15 + ...ementProjectsWebhooksUpdateResponseBody.md | 18 + docs/OrderItemProduct.md | 2 +- docs/ParameterCampaignType.md | 2 - docs/ParameterFiltersListBin.md | 16 + docs/ParameterFiltersListBinId.md | 13 + docs/ParameterFiltersListBinResourceId.md | 13 + docs/ParameterFiltersListBinResourceName.md | 13 + docs/ParameterFiltersListBinResourceType.md | 13 + ...terFiltersListBinResourceTypeConditions.md | 19 + docs/ParameterFiltersListCampaigns.md | 18 + ...meterFiltersListCampaignsCampaignStatus.md | 13 + ...rsListCampaignsCampaignStatusConditions.md | 19 + ...ParameterFiltersListCampaignsCategories.md | 13 + ...arameterFiltersListCampaignsCategoryIds.md | 13 + ...meterFiltersListCampaignsIsReferralCode.md | 14 + ...erFiltersListCampaignsValidityTimeframe.md | 13 + ...arameterFiltersListCampaignsVoucherType.md | 13 + ...ParameterFiltersListCustomerRedeemables.md | 1 + ...iltersListCustomerRedeemablesCampaignId.md | 1 - ...tersListCustomerRedeemablesCampaignType.md | 1 - ...FiltersListCustomerRedeemablesCreatedAt.md | 3 +- ...iltersListCustomerRedeemablesHolderRole.md | 1 - ...rameterFiltersListCustomerRedeemablesId.md | 1 - ...tersListCustomerRedeemablesRedeemableId.md | 1 - ...ListCustomerRedeemablesRedeemableObject.md | 1 - ...ltersListCustomerRedeemablesVoucherType.md | 1 - docs/ParameterFiltersListPublications.md | 21 + ...eterFiltersListPublicationsCampaignName.md | 13 + ...ameterFiltersListPublicationsCustomerId.md | 13 + ...meterFiltersListPublicationsFailureCode.md | 13 + ...erFiltersListPublicationsIsReferralCode.md | 13 + ...erFiltersListPublicationsParentObjectId.md | 13 + ...rFiltersListPublicationsRelatedObjectId.md | 13 + .../ParameterFiltersListPublicationsResult.md | 13 + ...arameterFiltersListPublicationsSourceId.md | 13 + ...meterFiltersListPublicationsVoucherType.md | 13 + docs/ParameterFiltersListRedemptions.md | 1 + ...meterFiltersListRedemptionsCampaignName.md | 1 - ...rameterFiltersListRedemptionsCustomerId.md | 1 - ...ameterFiltersListRedemptionsFailureCode.md | 1 - docs/ParameterFiltersListRedemptionsObject.md | 1 - ...iltersListRedemptionsParentRedemptionId.md | 1 - ...erFiltersListRedemptionsRelatedObjectId.md | 1 - ...ersListRedemptionsRelatedObjectParentId.md | 1 - docs/ParameterFiltersListRedemptionsResult.md | 1 - ...arameterFiltersListRedemptionsUserLogin.md | 1 - ...ameterFiltersListRedemptionsVoucherCode.md | 1 - docs/ParameterOrderListBin.md | 12 + docs/ParameterVoucherTypeListPublications.md | 2 - docs/PublicationsApi.md | 5 +- docs/TrashBinItem.md | 20 + docs/TrashBinListResponseBody.md | 18 + docs/UsageNotifications.md | 15 + docs/User.md | 19 + docs/ValidationRule.md | 2 +- docs/ValidationRulesCreateRequestBody.md | 2 +- docs/ValidationRulesCreateResponseBody.md | 2 +- docs/ValidationRulesGetResponseBody.md | 2 +- docs/ValidationRulesUpdateRequestBody.md | 2 +- docs/ValidationRulesUpdateResponseBody.md | 2 +- pyproject.toml | 2 +- setup.py | 2 +- voucherify/__init__.py | 155 +- voucherify/api/__init__.py | 2 + voucherify/api/bin_api.py | 608 + voucherify/api/campaigns_api.py | 18 + voucherify/api/management_api.py | 10031 ++++++++++++++++ voucherify/api/publications_api.py | 19 +- voucherify/api_client.py | 48 +- voucherify/configuration.py | 20 +- voucherify/models/__init__.py | 151 +- voucherify/models/campaign_base.py | 13 +- .../models/campaigns_create_request_body.py | 14 +- .../models/campaigns_create_response_body.py | 13 +- .../models/campaigns_get_response_body.py | 13 +- .../models/campaigns_update_request_body.py | 120 +- .../models/campaigns_update_response_body.py | 13 +- voucherify/models/customer_redeemable.py | 8 +- .../models/filter_conditions_date_time.py | 129 + .../filter_conditions_date_time_conditions.py | 129 + ...loyalties_create_campaign_response_body.py | 9 +- .../loyalties_get_campaign_response_body.py | 9 +- ...loyalties_update_campaign_response_body.py | 9 +- voucherify/models/loyalty_campaign.py | 9 +- voucherify/models/management_project.py | 283 + ...agement_project_api_usage_notifications.py | 117 + .../management_project_default_code_config.py | 93 + .../models/management_project_limits.py | 116 + ...anagement_project_limits_api_calls_item.py | 90 + ...ment_project_limits_bulk_api_calls_item.py | 90 + ..._project_webhooks_callout_notifications.py | 108 + ...oks_callout_notifications_distributions.py | 107 + ...webhooks_callout_notifications_webhooks.py | 107 + .../models/management_projects_branding.py | 137 + .../management_projects_branding_address.py | 121 + .../management_projects_branding_brand.py | 121 + .../management_projects_branding_cockpits.py | 152 + .../management_projects_branding_contact.py | 100 + ...t_projects_branding_create_request_body.py | 130 + ...ts_branding_create_request_body_address.py | 121 + ...ects_branding_create_request_body_brand.py | 121 + ...s_branding_create_request_body_cockpits.py | 152 + ...ts_branding_create_request_body_contact.py | 100 + ..._projects_branding_create_response_body.py | 137 + ...s_branding_create_response_body_address.py | 121 + ...cts_branding_create_response_body_brand.py | 121 + ..._branding_create_response_body_cockpits.py | 152 + ...s_branding_create_response_body_contact.py | 100 + ...ent_projects_branding_get_response_body.py | 137 + ...ects_branding_get_response_body_address.py | 121 + ...ojects_branding_get_response_body_brand.py | 121 + ...cts_branding_get_response_body_cockpits.py | 152 + ...ects_branding_get_response_body_contact.py | 100 + ...nt_projects_branding_list_response_body.py | 142 + ...t_projects_branding_update_request_body.py | 130 + ...ts_branding_update_request_body_address.py | 121 + ...ects_branding_update_request_body_brand.py | 121 + ...s_branding_update_request_body_cockpits.py | 152 + ...ts_branding_update_request_body_contact.py | 100 + ..._projects_branding_update_response_body.py | 137 + ...s_branding_update_response_body_address.py | 121 + ...cts_branding_update_response_body_brand.py | 121 + ..._branding_update_response_body_cockpits.py | 152 + ...s_branding_update_response_body_contact.py | 100 + ...management_projects_create_request_body.py | 255 + ...te_request_body_api_usage_notifications.py | 117 + ...projects_create_request_body_users_item.py | 92 + ...est_body_webhooks_callout_notifications.py | 108 + ...oks_callout_notifications_distributions.py | 107 + ...webhooks_callout_notifications_webhooks.py | 107 + ...anagement_projects_create_response_body.py | 283 + ...e_response_body_api_usage_notifications.py | 117 + ...ts_create_response_body_client_side_key.py | 100 + ...ts_create_response_body_server_side_key.py | 100 + ...nse_body_webhooks_callout_notifications.py | 108 + ...oks_callout_notifications_distributions.py | 107 + ...webhooks_callout_notifications_webhooks.py | 107 + ...management_projects_custom_event_schema.py | 143 + ...ent_projects_custom_event_schema_schema.py | 93 + ...ustom_event_schemas_create_request_body.py | 104 + ...vent_schemas_create_request_body_schema.py | 93 + ...stom_event_schemas_create_response_body.py | 143 + ...ent_schemas_create_response_body_schema.py | 93 + ..._custom_event_schemas_get_response_body.py | 143 + ..._event_schemas_get_response_body_schema.py | 93 + ...custom_event_schemas_list_response_body.py | 142 + ...ustom_event_schemas_update_request_body.py | 97 + ...vent_schemas_update_request_body_schema.py | 93 + ...stom_event_schemas_update_response_body.py | 143 + ...ent_schemas_update_response_body_schema.py | 93 + .../management_projects_get_response_body.py | 283 + ...t_response_body_api_usage_notifications.py | 117 + ...s_get_response_body_default_code_config.py | 93 + ...ement_projects_get_response_body_limits.py | 116 + ...get_response_body_limits_api_calls_item.py | 90 + ...esponse_body_limits_bulk_api_calls_item.py | 90 + ...nse_body_webhooks_callout_notifications.py | 108 + ...oks_callout_notifications_distributions.py | 107 + ...webhooks_callout_notifications_webhooks.py | 107 + .../management_projects_list_response_body.py | 142 + .../management_projects_metadata_schema.py | 136 + ...ts_metadata_schemas_create_request_body.py | 107 + ...s_metadata_schemas_create_response_body.py | 136 + ...ects_metadata_schemas_get_response_body.py | 136 + ...cts_metadata_schemas_list_response_body.py | 142 + ...ts_metadata_schemas_update_request_body.py | 100 + ...s_metadata_schemas_update_response_body.py | 136 + .../management_projects_stacking_rules.py | 223 + ...ects_stacking_rules_create_request_body.py | 201 + ...cts_stacking_rules_create_response_body.py | 223 + ...ojects_stacking_rules_get_response_body.py | 223 + ...jects_stacking_rules_list_response_body.py | 142 + ...ects_stacking_rules_update_request_body.py | 201 + ...cts_stacking_rules_update_response_body.py | 223 + ...management_projects_update_request_body.py | 220 + ...te_request_body_api_usage_notifications.py | 117 + ...update_request_body_default_code_config.py | 93 + ...est_body_webhooks_callout_notifications.py | 108 + ...oks_callout_notifications_distributions.py | 107 + ...webhooks_callout_notifications_webhooks.py | 107 + ...anagement_projects_update_response_body.py | 283 + ...e_response_body_api_usage_notifications.py | 117 + ...pdate_response_body_default_code_config.py | 93 + ...nt_projects_update_response_body_limits.py | 116 + ...ate_response_body_limits_api_calls_item.py | 90 + ...esponse_body_limits_bulk_api_calls_item.py | 90 + ...nse_body_webhooks_callout_notifications.py | 108 + ...oks_callout_notifications_distributions.py | 107 + ...webhooks_callout_notifications_webhooks.py | 107 + ...ment_projects_users_assign_request_body.py | 107 + ...ent_projects_users_assign_response_body.py | 135 + ...t_projects_users_get_user_response_body.py | 135 + ...ojects_users_invite_create_request_body.py | 114 + ...ement_projects_users_list_response_body.py | 142 + ...projects_users_update_role_request_body.py | 93 + ...rojects_users_update_role_response_body.py | 135 + .../models/management_projects_webhook.py | 150 + ...t_projects_webhooks_create_request_body.py | 118 + ..._projects_webhooks_create_response_body.py | 150 + ...ent_projects_webhooks_get_response_body.py | 150 + ...nt_projects_webhooks_list_response_body.py | 142 + ...t_projects_webhooks_update_request_body.py | 118 + ..._projects_webhooks_update_response_body.py | 150 + voucherify/models/order_item_product.py | 2 +- voucherify/models/parameter_campaign_type.py | 1 - .../models/parameter_filters_list_bin.py | 133 + .../models/parameter_filters_list_bin_id.py | 92 + .../parameter_filters_list_bin_resource_id.py | 92 + ...arameter_filters_list_bin_resource_name.py | 92 + ...arameter_filters_list_bin_resource_type.py | 92 + ...lters_list_bin_resource_type_conditions.py | 184 + .../parameter_filters_list_campaigns.py | 155 + ..._filters_list_campaigns_campaign_status.py | 92 + ...st_campaigns_campaign_status_conditions.py | 184 + ...meter_filters_list_campaigns_categories.py | 92 + ...ter_filters_list_campaigns_category_ids.py | 92 + ...filters_list_campaigns_is_referral_code.py | 120 + ...lters_list_campaigns_validity_timeframe.py | 92 + ...ter_filters_list_campaigns_voucher_type.py | 92 + ...meter_filters_list_customer_redeemables.py | 7 +- ...s_list_customer_redeemables_campaign_id.py | 7 +- ...list_customer_redeemables_campaign_type.py | 7 +- ...rs_list_customer_redeemables_created_at.py | 16 +- ...s_list_customer_redeemables_holder_role.py | 7 +- ...er_filters_list_customer_redeemables_id.py | 7 +- ...list_customer_redeemables_redeemable_id.py | 7 +- ..._customer_redeemables_redeemable_object.py | 7 +- ..._list_customer_redeemables_voucher_type.py | 7 +- .../parameter_filters_list_publications.py | 188 + ...filters_list_publications_campaign_name.py | 92 + ...r_filters_list_publications_customer_id.py | 92 + ..._filters_list_publications_failure_code.py | 92 + ...ters_list_publications_is_referral_code.py | 92 + ...ters_list_publications_parent_object_id.py | 92 + ...ers_list_publications_related_object_id.py | 92 + ...ameter_filters_list_publications_result.py | 92 + ...ter_filters_list_publications_source_id.py | 92 + ..._filters_list_publications_voucher_type.py | 92 + .../parameter_filters_list_redemptions.py | 7 +- ..._filters_list_redemptions_campaign_name.py | 7 +- ...er_filters_list_redemptions_customer_id.py | 7 +- ...r_filters_list_redemptions_failure_code.py | 7 +- ...rameter_filters_list_redemptions_object.py | 7 +- ...s_list_redemptions_parent_redemption_id.py | 7 +- ...ters_list_redemptions_related_object_id.py | 7 +- ...st_redemptions_related_object_parent_id.py | 7 +- ...rameter_filters_list_redemptions_result.py | 7 +- ...ter_filters_list_redemptions_user_login.py | 7 +- ...r_filters_list_redemptions_voucher_code.py | 7 +- voucherify/models/parameter_order_list_bin.py | 38 + ...arameter_voucher_type_list_publications.py | 1 - .../models/referral_program_referee_reward.py | 4 +- voucherify/models/trash_bin_item.py | 163 + .../models/trash_bin_list_response_body.py | 156 + voucherify/models/usage_notifications.py | 115 + voucherify/models/user.py | 135 + voucherify/models/validation_rule.py | 6 +- .../validation_rules_create_request_body.py | 6 +- .../validation_rules_create_response_body.py | 6 +- .../validation_rules_get_response_body.py | 6 +- .../validation_rules_update_request_body.py | 6 +- .../validation_rules_update_response_body.py | 6 +- 398 files changed, 36392 insertions(+), 396 deletions(-) create mode 100644 docs/BinApi.md create mode 100644 docs/FilterConditionsDateTime.md create mode 100644 docs/FilterConditionsDateTimeConditions.md create mode 100644 docs/ManagementApi.md create mode 100644 docs/ManagementProject.md create mode 100644 docs/ManagementProjectApiUsageNotifications.md create mode 100644 docs/ManagementProjectDefaultCodeConfig.md create mode 100644 docs/ManagementProjectLimits.md create mode 100644 docs/ManagementProjectLimitsApiCallsItem.md create mode 100644 docs/ManagementProjectLimitsBulkApiCallsItem.md create mode 100644 docs/ManagementProjectWebhooksCalloutNotifications.md create mode 100644 docs/ManagementProjectWebhooksCalloutNotificationsDistributions.md create mode 100644 docs/ManagementProjectWebhooksCalloutNotificationsWebhooks.md create mode 100644 docs/ManagementProjectsBranding.md create mode 100644 docs/ManagementProjectsBrandingAddress.md create mode 100644 docs/ManagementProjectsBrandingBrand.md create mode 100644 docs/ManagementProjectsBrandingCockpits.md create mode 100644 docs/ManagementProjectsBrandingContact.md create mode 100644 docs/ManagementProjectsBrandingCreateRequestBody.md create mode 100644 docs/ManagementProjectsBrandingCreateRequestBodyAddress.md create mode 100644 docs/ManagementProjectsBrandingCreateRequestBodyBrand.md create mode 100644 docs/ManagementProjectsBrandingCreateRequestBodyCockpits.md create mode 100644 docs/ManagementProjectsBrandingCreateRequestBodyContact.md create mode 100644 docs/ManagementProjectsBrandingCreateResponseBody.md create mode 100644 docs/ManagementProjectsBrandingCreateResponseBodyAddress.md create mode 100644 docs/ManagementProjectsBrandingCreateResponseBodyBrand.md create mode 100644 docs/ManagementProjectsBrandingCreateResponseBodyCockpits.md create mode 100644 docs/ManagementProjectsBrandingCreateResponseBodyContact.md create mode 100644 docs/ManagementProjectsBrandingGetResponseBody.md create mode 100644 docs/ManagementProjectsBrandingGetResponseBodyAddress.md create mode 100644 docs/ManagementProjectsBrandingGetResponseBodyBrand.md create mode 100644 docs/ManagementProjectsBrandingGetResponseBodyCockpits.md create mode 100644 docs/ManagementProjectsBrandingGetResponseBodyContact.md create mode 100644 docs/ManagementProjectsBrandingListResponseBody.md create mode 100644 docs/ManagementProjectsBrandingUpdateRequestBody.md create mode 100644 docs/ManagementProjectsBrandingUpdateRequestBodyAddress.md create mode 100644 docs/ManagementProjectsBrandingUpdateRequestBodyBrand.md create mode 100644 docs/ManagementProjectsBrandingUpdateRequestBodyCockpits.md create mode 100644 docs/ManagementProjectsBrandingUpdateRequestBodyContact.md create mode 100644 docs/ManagementProjectsBrandingUpdateResponseBody.md create mode 100644 docs/ManagementProjectsBrandingUpdateResponseBodyAddress.md create mode 100644 docs/ManagementProjectsBrandingUpdateResponseBodyBrand.md create mode 100644 docs/ManagementProjectsBrandingUpdateResponseBodyCockpits.md create mode 100644 docs/ManagementProjectsBrandingUpdateResponseBodyContact.md create mode 100644 docs/ManagementProjectsCreateRequestBody.md create mode 100644 docs/ManagementProjectsCreateRequestBodyApiUsageNotifications.md create mode 100644 docs/ManagementProjectsCreateRequestBodyUsersItem.md create mode 100644 docs/ManagementProjectsCreateRequestBodyWebhooksCalloutNotifications.md create mode 100644 docs/ManagementProjectsCreateRequestBodyWebhooksCalloutNotificationsDistributions.md create mode 100644 docs/ManagementProjectsCreateRequestBodyWebhooksCalloutNotificationsWebhooks.md create mode 100644 docs/ManagementProjectsCreateResponseBody.md create mode 100644 docs/ManagementProjectsCreateResponseBodyApiUsageNotifications.md create mode 100644 docs/ManagementProjectsCreateResponseBodyClientSideKey.md create mode 100644 docs/ManagementProjectsCreateResponseBodyServerSideKey.md create mode 100644 docs/ManagementProjectsCreateResponseBodyWebhooksCalloutNotifications.md create mode 100644 docs/ManagementProjectsCreateResponseBodyWebhooksCalloutNotificationsDistributions.md create mode 100644 docs/ManagementProjectsCreateResponseBodyWebhooksCalloutNotificationsWebhooks.md create mode 100644 docs/ManagementProjectsCustomEventSchema.md create mode 100644 docs/ManagementProjectsCustomEventSchemaSchema.md create mode 100644 docs/ManagementProjectsCustomEventSchemasCreateRequestBody.md create mode 100644 docs/ManagementProjectsCustomEventSchemasCreateRequestBodySchema.md create mode 100644 docs/ManagementProjectsCustomEventSchemasCreateResponseBody.md create mode 100644 docs/ManagementProjectsCustomEventSchemasCreateResponseBodySchema.md create mode 100644 docs/ManagementProjectsCustomEventSchemasGetResponseBody.md create mode 100644 docs/ManagementProjectsCustomEventSchemasGetResponseBodySchema.md create mode 100644 docs/ManagementProjectsCustomEventSchemasListResponseBody.md create mode 100644 docs/ManagementProjectsCustomEventSchemasUpdateRequestBody.md create mode 100644 docs/ManagementProjectsCustomEventSchemasUpdateRequestBodySchema.md create mode 100644 docs/ManagementProjectsCustomEventSchemasUpdateResponseBody.md create mode 100644 docs/ManagementProjectsCustomEventSchemasUpdateResponseBodySchema.md create mode 100644 docs/ManagementProjectsGetResponseBody.md create mode 100644 docs/ManagementProjectsGetResponseBodyApiUsageNotifications.md create mode 100644 docs/ManagementProjectsGetResponseBodyDefaultCodeConfig.md create mode 100644 docs/ManagementProjectsGetResponseBodyLimits.md create mode 100644 docs/ManagementProjectsGetResponseBodyLimitsApiCallsItem.md create mode 100644 docs/ManagementProjectsGetResponseBodyLimitsBulkApiCallsItem.md create mode 100644 docs/ManagementProjectsGetResponseBodyWebhooksCalloutNotifications.md create mode 100644 docs/ManagementProjectsGetResponseBodyWebhooksCalloutNotificationsDistributions.md create mode 100644 docs/ManagementProjectsGetResponseBodyWebhooksCalloutNotificationsWebhooks.md create mode 100644 docs/ManagementProjectsListResponseBody.md create mode 100644 docs/ManagementProjectsMetadataSchema.md create mode 100644 docs/ManagementProjectsMetadataSchemasCreateRequestBody.md create mode 100644 docs/ManagementProjectsMetadataSchemasCreateResponseBody.md create mode 100644 docs/ManagementProjectsMetadataSchemasGetResponseBody.md create mode 100644 docs/ManagementProjectsMetadataSchemasListResponseBody.md create mode 100644 docs/ManagementProjectsMetadataSchemasUpdateRequestBody.md create mode 100644 docs/ManagementProjectsMetadataSchemasUpdateResponseBody.md create mode 100644 docs/ManagementProjectsStackingRules.md create mode 100644 docs/ManagementProjectsStackingRulesCreateRequestBody.md create mode 100644 docs/ManagementProjectsStackingRulesCreateResponseBody.md create mode 100644 docs/ManagementProjectsStackingRulesGetResponseBody.md create mode 100644 docs/ManagementProjectsStackingRulesListResponseBody.md create mode 100644 docs/ManagementProjectsStackingRulesUpdateRequestBody.md create mode 100644 docs/ManagementProjectsStackingRulesUpdateResponseBody.md create mode 100644 docs/ManagementProjectsUpdateRequestBody.md create mode 100644 docs/ManagementProjectsUpdateRequestBodyApiUsageNotifications.md create mode 100644 docs/ManagementProjectsUpdateRequestBodyDefaultCodeConfig.md create mode 100644 docs/ManagementProjectsUpdateRequestBodyWebhooksCalloutNotifications.md create mode 100644 docs/ManagementProjectsUpdateRequestBodyWebhooksCalloutNotificationsDistributions.md create mode 100644 docs/ManagementProjectsUpdateRequestBodyWebhooksCalloutNotificationsWebhooks.md create mode 100644 docs/ManagementProjectsUpdateResponseBody.md create mode 100644 docs/ManagementProjectsUpdateResponseBodyApiUsageNotifications.md create mode 100644 docs/ManagementProjectsUpdateResponseBodyDefaultCodeConfig.md create mode 100644 docs/ManagementProjectsUpdateResponseBodyLimits.md create mode 100644 docs/ManagementProjectsUpdateResponseBodyLimitsApiCallsItem.md create mode 100644 docs/ManagementProjectsUpdateResponseBodyLimitsBulkApiCallsItem.md create mode 100644 docs/ManagementProjectsUpdateResponseBodyWebhooksCalloutNotifications.md create mode 100644 docs/ManagementProjectsUpdateResponseBodyWebhooksCalloutNotificationsDistributions.md create mode 100644 docs/ManagementProjectsUpdateResponseBodyWebhooksCalloutNotificationsWebhooks.md create mode 100644 docs/ManagementProjectsUsersAssignRequestBody.md create mode 100644 docs/ManagementProjectsUsersAssignResponseBody.md create mode 100644 docs/ManagementProjectsUsersGetUserResponseBody.md create mode 100644 docs/ManagementProjectsUsersInviteCreateRequestBody.md create mode 100644 docs/ManagementProjectsUsersListResponseBody.md create mode 100644 docs/ManagementProjectsUsersUpdateRoleRequestBody.md create mode 100644 docs/ManagementProjectsUsersUpdateRoleResponseBody.md create mode 100644 docs/ManagementProjectsWebhook.md create mode 100644 docs/ManagementProjectsWebhooksCreateRequestBody.md create mode 100644 docs/ManagementProjectsWebhooksCreateResponseBody.md create mode 100644 docs/ManagementProjectsWebhooksGetResponseBody.md create mode 100644 docs/ManagementProjectsWebhooksListResponseBody.md create mode 100644 docs/ManagementProjectsWebhooksUpdateRequestBody.md create mode 100644 docs/ManagementProjectsWebhooksUpdateResponseBody.md create mode 100644 docs/ParameterFiltersListBin.md create mode 100644 docs/ParameterFiltersListBinId.md create mode 100644 docs/ParameterFiltersListBinResourceId.md create mode 100644 docs/ParameterFiltersListBinResourceName.md create mode 100644 docs/ParameterFiltersListBinResourceType.md create mode 100644 docs/ParameterFiltersListBinResourceTypeConditions.md create mode 100644 docs/ParameterFiltersListCampaigns.md create mode 100644 docs/ParameterFiltersListCampaignsCampaignStatus.md create mode 100644 docs/ParameterFiltersListCampaignsCampaignStatusConditions.md create mode 100644 docs/ParameterFiltersListCampaignsCategories.md create mode 100644 docs/ParameterFiltersListCampaignsCategoryIds.md create mode 100644 docs/ParameterFiltersListCampaignsIsReferralCode.md create mode 100644 docs/ParameterFiltersListCampaignsValidityTimeframe.md create mode 100644 docs/ParameterFiltersListCampaignsVoucherType.md create mode 100644 docs/ParameterFiltersListPublications.md create mode 100644 docs/ParameterFiltersListPublicationsCampaignName.md create mode 100644 docs/ParameterFiltersListPublicationsCustomerId.md create mode 100644 docs/ParameterFiltersListPublicationsFailureCode.md create mode 100644 docs/ParameterFiltersListPublicationsIsReferralCode.md create mode 100644 docs/ParameterFiltersListPublicationsParentObjectId.md create mode 100644 docs/ParameterFiltersListPublicationsRelatedObjectId.md create mode 100644 docs/ParameterFiltersListPublicationsResult.md create mode 100644 docs/ParameterFiltersListPublicationsSourceId.md create mode 100644 docs/ParameterFiltersListPublicationsVoucherType.md create mode 100644 docs/ParameterOrderListBin.md create mode 100644 docs/TrashBinItem.md create mode 100644 docs/TrashBinListResponseBody.md create mode 100644 docs/UsageNotifications.md create mode 100644 docs/User.md create mode 100644 voucherify/api/bin_api.py create mode 100644 voucherify/api/management_api.py create mode 100644 voucherify/models/filter_conditions_date_time.py create mode 100644 voucherify/models/filter_conditions_date_time_conditions.py create mode 100644 voucherify/models/management_project.py create mode 100644 voucherify/models/management_project_api_usage_notifications.py create mode 100644 voucherify/models/management_project_default_code_config.py create mode 100644 voucherify/models/management_project_limits.py create mode 100644 voucherify/models/management_project_limits_api_calls_item.py create mode 100644 voucherify/models/management_project_limits_bulk_api_calls_item.py create mode 100644 voucherify/models/management_project_webhooks_callout_notifications.py create mode 100644 voucherify/models/management_project_webhooks_callout_notifications_distributions.py create mode 100644 voucherify/models/management_project_webhooks_callout_notifications_webhooks.py create mode 100644 voucherify/models/management_projects_branding.py create mode 100644 voucherify/models/management_projects_branding_address.py create mode 100644 voucherify/models/management_projects_branding_brand.py create mode 100644 voucherify/models/management_projects_branding_cockpits.py create mode 100644 voucherify/models/management_projects_branding_contact.py create mode 100644 voucherify/models/management_projects_branding_create_request_body.py create mode 100644 voucherify/models/management_projects_branding_create_request_body_address.py create mode 100644 voucherify/models/management_projects_branding_create_request_body_brand.py create mode 100644 voucherify/models/management_projects_branding_create_request_body_cockpits.py create mode 100644 voucherify/models/management_projects_branding_create_request_body_contact.py create mode 100644 voucherify/models/management_projects_branding_create_response_body.py create mode 100644 voucherify/models/management_projects_branding_create_response_body_address.py create mode 100644 voucherify/models/management_projects_branding_create_response_body_brand.py create mode 100644 voucherify/models/management_projects_branding_create_response_body_cockpits.py create mode 100644 voucherify/models/management_projects_branding_create_response_body_contact.py create mode 100644 voucherify/models/management_projects_branding_get_response_body.py create mode 100644 voucherify/models/management_projects_branding_get_response_body_address.py create mode 100644 voucherify/models/management_projects_branding_get_response_body_brand.py create mode 100644 voucherify/models/management_projects_branding_get_response_body_cockpits.py create mode 100644 voucherify/models/management_projects_branding_get_response_body_contact.py create mode 100644 voucherify/models/management_projects_branding_list_response_body.py create mode 100644 voucherify/models/management_projects_branding_update_request_body.py create mode 100644 voucherify/models/management_projects_branding_update_request_body_address.py create mode 100644 voucherify/models/management_projects_branding_update_request_body_brand.py create mode 100644 voucherify/models/management_projects_branding_update_request_body_cockpits.py create mode 100644 voucherify/models/management_projects_branding_update_request_body_contact.py create mode 100644 voucherify/models/management_projects_branding_update_response_body.py create mode 100644 voucherify/models/management_projects_branding_update_response_body_address.py create mode 100644 voucherify/models/management_projects_branding_update_response_body_brand.py create mode 100644 voucherify/models/management_projects_branding_update_response_body_cockpits.py create mode 100644 voucherify/models/management_projects_branding_update_response_body_contact.py create mode 100644 voucherify/models/management_projects_create_request_body.py create mode 100644 voucherify/models/management_projects_create_request_body_api_usage_notifications.py create mode 100644 voucherify/models/management_projects_create_request_body_users_item.py create mode 100644 voucherify/models/management_projects_create_request_body_webhooks_callout_notifications.py create mode 100644 voucherify/models/management_projects_create_request_body_webhooks_callout_notifications_distributions.py create mode 100644 voucherify/models/management_projects_create_request_body_webhooks_callout_notifications_webhooks.py create mode 100644 voucherify/models/management_projects_create_response_body.py create mode 100644 voucherify/models/management_projects_create_response_body_api_usage_notifications.py create mode 100644 voucherify/models/management_projects_create_response_body_client_side_key.py create mode 100644 voucherify/models/management_projects_create_response_body_server_side_key.py create mode 100644 voucherify/models/management_projects_create_response_body_webhooks_callout_notifications.py create mode 100644 voucherify/models/management_projects_create_response_body_webhooks_callout_notifications_distributions.py create mode 100644 voucherify/models/management_projects_create_response_body_webhooks_callout_notifications_webhooks.py create mode 100644 voucherify/models/management_projects_custom_event_schema.py create mode 100644 voucherify/models/management_projects_custom_event_schema_schema.py create mode 100644 voucherify/models/management_projects_custom_event_schemas_create_request_body.py create mode 100644 voucherify/models/management_projects_custom_event_schemas_create_request_body_schema.py create mode 100644 voucherify/models/management_projects_custom_event_schemas_create_response_body.py create mode 100644 voucherify/models/management_projects_custom_event_schemas_create_response_body_schema.py create mode 100644 voucherify/models/management_projects_custom_event_schemas_get_response_body.py create mode 100644 voucherify/models/management_projects_custom_event_schemas_get_response_body_schema.py create mode 100644 voucherify/models/management_projects_custom_event_schemas_list_response_body.py create mode 100644 voucherify/models/management_projects_custom_event_schemas_update_request_body.py create mode 100644 voucherify/models/management_projects_custom_event_schemas_update_request_body_schema.py create mode 100644 voucherify/models/management_projects_custom_event_schemas_update_response_body.py create mode 100644 voucherify/models/management_projects_custom_event_schemas_update_response_body_schema.py create mode 100644 voucherify/models/management_projects_get_response_body.py create mode 100644 voucherify/models/management_projects_get_response_body_api_usage_notifications.py create mode 100644 voucherify/models/management_projects_get_response_body_default_code_config.py create mode 100644 voucherify/models/management_projects_get_response_body_limits.py create mode 100644 voucherify/models/management_projects_get_response_body_limits_api_calls_item.py create mode 100644 voucherify/models/management_projects_get_response_body_limits_bulk_api_calls_item.py create mode 100644 voucherify/models/management_projects_get_response_body_webhooks_callout_notifications.py create mode 100644 voucherify/models/management_projects_get_response_body_webhooks_callout_notifications_distributions.py create mode 100644 voucherify/models/management_projects_get_response_body_webhooks_callout_notifications_webhooks.py create mode 100644 voucherify/models/management_projects_list_response_body.py create mode 100644 voucherify/models/management_projects_metadata_schema.py create mode 100644 voucherify/models/management_projects_metadata_schemas_create_request_body.py create mode 100644 voucherify/models/management_projects_metadata_schemas_create_response_body.py create mode 100644 voucherify/models/management_projects_metadata_schemas_get_response_body.py create mode 100644 voucherify/models/management_projects_metadata_schemas_list_response_body.py create mode 100644 voucherify/models/management_projects_metadata_schemas_update_request_body.py create mode 100644 voucherify/models/management_projects_metadata_schemas_update_response_body.py create mode 100644 voucherify/models/management_projects_stacking_rules.py create mode 100644 voucherify/models/management_projects_stacking_rules_create_request_body.py create mode 100644 voucherify/models/management_projects_stacking_rules_create_response_body.py create mode 100644 voucherify/models/management_projects_stacking_rules_get_response_body.py create mode 100644 voucherify/models/management_projects_stacking_rules_list_response_body.py create mode 100644 voucherify/models/management_projects_stacking_rules_update_request_body.py create mode 100644 voucherify/models/management_projects_stacking_rules_update_response_body.py create mode 100644 voucherify/models/management_projects_update_request_body.py create mode 100644 voucherify/models/management_projects_update_request_body_api_usage_notifications.py create mode 100644 voucherify/models/management_projects_update_request_body_default_code_config.py create mode 100644 voucherify/models/management_projects_update_request_body_webhooks_callout_notifications.py create mode 100644 voucherify/models/management_projects_update_request_body_webhooks_callout_notifications_distributions.py create mode 100644 voucherify/models/management_projects_update_request_body_webhooks_callout_notifications_webhooks.py create mode 100644 voucherify/models/management_projects_update_response_body.py create mode 100644 voucherify/models/management_projects_update_response_body_api_usage_notifications.py create mode 100644 voucherify/models/management_projects_update_response_body_default_code_config.py create mode 100644 voucherify/models/management_projects_update_response_body_limits.py create mode 100644 voucherify/models/management_projects_update_response_body_limits_api_calls_item.py create mode 100644 voucherify/models/management_projects_update_response_body_limits_bulk_api_calls_item.py create mode 100644 voucherify/models/management_projects_update_response_body_webhooks_callout_notifications.py create mode 100644 voucherify/models/management_projects_update_response_body_webhooks_callout_notifications_distributions.py create mode 100644 voucherify/models/management_projects_update_response_body_webhooks_callout_notifications_webhooks.py create mode 100644 voucherify/models/management_projects_users_assign_request_body.py create mode 100644 voucherify/models/management_projects_users_assign_response_body.py create mode 100644 voucherify/models/management_projects_users_get_user_response_body.py create mode 100644 voucherify/models/management_projects_users_invite_create_request_body.py create mode 100644 voucherify/models/management_projects_users_list_response_body.py create mode 100644 voucherify/models/management_projects_users_update_role_request_body.py create mode 100644 voucherify/models/management_projects_users_update_role_response_body.py create mode 100644 voucherify/models/management_projects_webhook.py create mode 100644 voucherify/models/management_projects_webhooks_create_request_body.py create mode 100644 voucherify/models/management_projects_webhooks_create_response_body.py create mode 100644 voucherify/models/management_projects_webhooks_get_response_body.py create mode 100644 voucherify/models/management_projects_webhooks_list_response_body.py create mode 100644 voucherify/models/management_projects_webhooks_update_request_body.py create mode 100644 voucherify/models/management_projects_webhooks_update_response_body.py create mode 100644 voucherify/models/parameter_filters_list_bin.py create mode 100644 voucherify/models/parameter_filters_list_bin_id.py create mode 100644 voucherify/models/parameter_filters_list_bin_resource_id.py create mode 100644 voucherify/models/parameter_filters_list_bin_resource_name.py create mode 100644 voucherify/models/parameter_filters_list_bin_resource_type.py create mode 100644 voucherify/models/parameter_filters_list_bin_resource_type_conditions.py create mode 100644 voucherify/models/parameter_filters_list_campaigns.py create mode 100644 voucherify/models/parameter_filters_list_campaigns_campaign_status.py create mode 100644 voucherify/models/parameter_filters_list_campaigns_campaign_status_conditions.py create mode 100644 voucherify/models/parameter_filters_list_campaigns_categories.py create mode 100644 voucherify/models/parameter_filters_list_campaigns_category_ids.py create mode 100644 voucherify/models/parameter_filters_list_campaigns_is_referral_code.py create mode 100644 voucherify/models/parameter_filters_list_campaigns_validity_timeframe.py create mode 100644 voucherify/models/parameter_filters_list_campaigns_voucher_type.py create mode 100644 voucherify/models/parameter_filters_list_publications.py create mode 100644 voucherify/models/parameter_filters_list_publications_campaign_name.py create mode 100644 voucherify/models/parameter_filters_list_publications_customer_id.py create mode 100644 voucherify/models/parameter_filters_list_publications_failure_code.py create mode 100644 voucherify/models/parameter_filters_list_publications_is_referral_code.py create mode 100644 voucherify/models/parameter_filters_list_publications_parent_object_id.py create mode 100644 voucherify/models/parameter_filters_list_publications_related_object_id.py create mode 100644 voucherify/models/parameter_filters_list_publications_result.py create mode 100644 voucherify/models/parameter_filters_list_publications_source_id.py create mode 100644 voucherify/models/parameter_filters_list_publications_voucher_type.py create mode 100644 voucherify/models/parameter_order_list_bin.py create mode 100644 voucherify/models/trash_bin_item.py create mode 100644 voucherify/models/trash_bin_list_response_body.py create mode 100644 voucherify/models/usage_notifications.py create mode 100644 voucherify/models/user.py diff --git a/ENDPOINTS-COVERAGE.md b/ENDPOINTS-COVERAGE.md index 7354b32b..d0c81f42 100644 --- a/ENDPOINTS-COVERAGE.md +++ b/ENDPOINTS-COVERAGE.md @@ -283,54 +283,54 @@ | /v1/referrals/members/{memberId}/holders | get | List Referral Code Holders | | | | /v1/referrals/members/{memberId}/holders/{holderId} | delete | Remove Referral Card Holder | | | ## Bin -| endpoint | method | summary | is supported | is deprecated | -| -------------------------- | ------ | ---------------- | ------------ | ------------- | -| /v1/trash-bin | get | List Bin Entries | | | -| /v1/trash-bin/{binEntryId} | delete | Delete Bin Entry | | | +| endpoint | method | summary | is supported | is deprecated | +| -------------------------- | ------ | ---------------- | ------------------------------------ | ------------- | +| /v1/trash-bin | get | List Bin Entries | supported | | +| /v1/trash-bin/{binEntryId} | delete | Delete Bin Entry | supported | | ## Templates | endpoint | method | summary | is supported | is deprecated | | ----------------------- | ------ | ------------------------ | ------------ | ------------- | | /v1/templates/campaigns | get | List Campaign Templates | | | | /v1/templates/campaigns | post | Create Campaign Template | | | ## Management -| endpoint | method | summary | is supported | is deprecated | -| ------------------------------------------------------------------------------ | ------ | -------------------------- | ------------ | ------------- | -| /management/v1/projects | post | Create Project | | | -| /management/v1/projects | get | List Projects | | | -| /management/v1/projects/{projectId} | get | Get Project | | | -| /management/v1/projects/{projectId} | put | Update Project | | | -| /management/v1/projects/{projectId} | delete | Delete Project | | | -| /management/v1/projects/{projectId}/users | post | Assign User | | | -| /management/v1/projects/{projectId}/users | get | List Users | | | -| /management/v1/projects/{projectId}/users/{userId} | get | Get User | | | -| /management/v1/projects/{projectId}/users/{userId} | put | Update User | | | -| /management/v1/projects/{projectId}/users/{userId} | delete | Unassign User | | | -| /management/v1/projects/users/invite | post | Invite a New User | | | -| /management/v1/projects/{projectId}/stacking-rules | post | Create Stacking Rules | | | -| /management/v1/projects/{projectId}/stacking-rules | get | List Stacking Rules | | | -| /management/v1/projects/{projectId}/stacking-rules/{stackingRulesId} | get | Get Stacking Rules | | | -| /management/v1/projects/{projectId}/stacking-rules/{stackingRulesId} | put | Update Stacking Rules | | | -| /management/v1/projects/{projectId}/stacking-rules/{stackingRulesId} | delete | Delete Stacking Rules | | | -| /management/v1/projects/{projectId}/metadata-schemas | post | Create Metadata Schema | | | -| /management/v1/projects/{projectId}/metadata-schemas | get | List Metadata Schemas | | | -| /management/v1/projects/{projectId}/metadata-schemas/{metadataSchemaId} | get | Get Metadata Schema | | | -| /management/v1/projects/{projectId}/metadata-schemas/{metadataSchemaId} | put | Update Metadata Schema | | | -| /management/v1/projects/{projectId}/metadata-schemas/{metadataSchemaId} | delete | Delete Metadata Schema | | | -| /management/v1/projects/{projectId}/custom-event-schemas | post | Create Custom Event Schema | | | -| /management/v1/projects/{projectId}/custom-event-schemas | get | List Custom Event Schemas | | | -| /management/v1/projects/{projectId}/custom-event-schemas/{customEventSchemaId} | get | Get Custom Event Schema | | | -| /management/v1/projects/{projectId}/custom-event-schemas/{customEventSchemaId} | put | Update Custom Event Schema | | | -| /management/v1/projects/{projectId}/custom-event-schemas/{customEventSchemaId} | delete | Delete Custom Event Schema | | | -| /management/v1/projects/{projectId}/webhooks | post | Create Webhook | | | -| /management/v1/projects/{projectId}/webhooks | get | List Webhooks | | | -| /management/v1/projects/{projectId}/webhooks/{webhookId} | get | Get Webhook | | | -| /management/v1/projects/{projectId}/webhooks/{webhookId} | put | Update Webhook | | | -| /management/v1/projects/{projectId}/webhooks/{webhookId} | delete | Delete Webhook | | | -| /management/v1/projects/{projectId}/branding | post | Create Brand | | | -| /management/v1/projects/{projectId}/branding | get | List Brands | | | -| /management/v1/projects/{projectId}/branding/{brandingId} | get | Get Brand | | | -| /management/v1/projects/{projectId}/branding/{brandingId} | put | Update Brand | | | -| /management/v1/projects/{projectId}/branding/{brandingId} | delete | Delete Brand | | | +| endpoint | method | summary | is supported | is deprecated | +| ------------------------------------------------------------------------------ | ------ | -------------------------- | ------------------------------------ | ------------- | +| /management/v1/projects | post | Create Project | supported | | +| /management/v1/projects | get | List Projects | supported | | +| /management/v1/projects/{projectId} | get | Get Project | supported | | +| /management/v1/projects/{projectId} | put | Update Project | supported | | +| /management/v1/projects/{projectId} | delete | Delete Project | supported | | +| /management/v1/projects/{projectId}/users | post | Assign User | supported | | +| /management/v1/projects/{projectId}/users | get | List Users | supported | | +| /management/v1/projects/{projectId}/users/{userId} | get | Get User | supported | | +| /management/v1/projects/{projectId}/users/{userId} | put | Update User | supported | | +| /management/v1/projects/{projectId}/users/{userId} | delete | Unassign User | supported | | +| /management/v1/projects/users/invite | post | Invite a New User | supported | | +| /management/v1/projects/{projectId}/stacking-rules | post | Create Stacking Rules | supported | | +| /management/v1/projects/{projectId}/stacking-rules | get | List Stacking Rules | supported | | +| /management/v1/projects/{projectId}/stacking-rules/{stackingRulesId} | get | Get Stacking Rules | supported | | +| /management/v1/projects/{projectId}/stacking-rules/{stackingRulesId} | put | Update Stacking Rules | supported | | +| /management/v1/projects/{projectId}/stacking-rules/{stackingRulesId} | delete | Delete Stacking Rules | supported | | +| /management/v1/projects/{projectId}/metadata-schemas | post | Create Metadata Schema | supported | | +| /management/v1/projects/{projectId}/metadata-schemas | get | List Metadata Schemas | supported | | +| /management/v1/projects/{projectId}/metadata-schemas/{metadataSchemaId} | get | Get Metadata Schema | supported | | +| /management/v1/projects/{projectId}/metadata-schemas/{metadataSchemaId} | put | Update Metadata Schema | supported | | +| /management/v1/projects/{projectId}/metadata-schemas/{metadataSchemaId} | delete | Delete Metadata Schema | supported | | +| /management/v1/projects/{projectId}/custom-event-schemas | post | Create Custom Event Schema | supported | | +| /management/v1/projects/{projectId}/custom-event-schemas | get | List Custom Event Schemas | supported | | +| /management/v1/projects/{projectId}/custom-event-schemas/{customEventSchemaId} | get | Get Custom Event Schema | supported | | +| /management/v1/projects/{projectId}/custom-event-schemas/{customEventSchemaId} | put | Update Custom Event Schema | supported | | +| /management/v1/projects/{projectId}/custom-event-schemas/{customEventSchemaId} | delete | Delete Custom Event Schema | supported | | +| /management/v1/projects/{projectId}/webhooks | post | Create Webhook | supported | | +| /management/v1/projects/{projectId}/webhooks | get | List Webhooks | supported | | +| /management/v1/projects/{projectId}/webhooks/{webhookId} | get | Get Webhook | supported | | +| /management/v1/projects/{projectId}/webhooks/{webhookId} | put | Update Webhook | supported | | +| /management/v1/projects/{projectId}/webhooks/{webhookId} | delete | Delete Webhook | supported | | +| /management/v1/projects/{projectId}/branding | post | Create Brand | supported | | +| /management/v1/projects/{projectId}/branding | get | List Brands | supported | | +| /management/v1/projects/{projectId}/branding/{brandingId} | get | Get Brand | supported | | +| /management/v1/projects/{projectId}/branding/{brandingId} | put | Update Brand | supported | | +| /management/v1/projects/{projectId}/branding/{brandingId} | delete | Delete Brand | supported | | ## Client-side | endpoint | method | summary | is supported | is deprecated | | --------------------------- | ------ | ------------------------------------------- | ------------------------------------ | ------------------------------------ | diff --git a/README.md b/README.md index 67fcf12c..d0117583 100644 --- a/README.md +++ b/README.md @@ -102,7 +102,69 @@ Read more about how to Contribute to Voucherify Python SDK by visiting main repo Remember that this SDK is auto generated (except of the tests) so changes made here will be overwritten by generator. ## 📅 Changelog - +- **2024-10-02** - `4.0.0` + - Fix object parsing in query. For example filters while listing redemptions. + - !!! BREAKING CHANGES !!! + - `listPublications` parameter `filters` have changed - now uses `ParameterFiltersListPublications` instead of `String` + - `ParameterFiltersListRedemptions` and `ParameterFiltersListCustomerRedeemables` have been updated + - enum `LUCKY_DRAW`, `LUCKY_DRAW_CODE`, `VOUCHER_LUCKY_DRAW_CODE`, `CAMPAIGN_LUCKY_DRAW` have been deleted from everywhere and no longer supported + - CampaignsUpdateRequestBody - properties `activity_duration_after_publishing`, `join_once`, `auto_join`, `type`, `winners_count`, `unique_winners_per_draw`, `unique_winners` have been deleted and no longer supported + - `FilterConditionsDateTimeConditions` model has been renamed to `FilterConditionsDateTime` + - FilterConditionsDateTime - `conditions` property has been divided on `after`, `before`, `has_value`, `is_unknown`, `more_than`, `less_than` properties + ParamterFiltersListCustomerRedeemables - model name of `createdAt` has been renamed from `FilterConditionsDateTime` to `ParameterFiltersListCustomerRedeemablesCreatedAt` + - `junction` property is deleted is no longer supported in models: + - `ParameterFiltersListCustomerRedeemablesCampaignId`, + - `ParamaterFiltersListCuomsterRedeemablesCampaignType`, + - `ParameterFiltersListCustomerRedeemablesHolderRole`, + - `ParameterFiltersListCuomsterRedeemablesId`, + - `ParameterFiltersListCuomsterRedeemablesRedeemableId`, + - `ParameterFiltersListCustomerRedeemablesVoucherType`, + - `ParameterFiltersListCustomerRedeemablesCreatedAt`, + - `ParameterFiltersListCustomerRedeemablesRedeemableObject`, + - `ParameterFiltersListRedemptionsCampaignName`, + - `ParameterFiltersListRedemptionsCustomerId`, + - `ParameterFiltersListRedemptionsFailureCode`, + - `ParameterFiltersListRedemptionsObject`, + - `ParameterFiltersListRedemptionsParentRedemptionId` + - `ParameterFiltersListRedemptionsRelatedObjectId` + - `ParameterFiltersListRedemptionsRelatedObjectParentId` + - `ParameterFiltersListRedemptionsResult` + - `ParameterFiltersListRedemptionsUserLogin` + - `ParameterFiltersListRedemptionsVoucherCode` + + + - Added support: + - /management/v1/projects/users/invite, post - Invite Users + - /management/v1/projects/{projectId}/users, get - Get Project + - /management/v1/projects/{projectId}/users, post - Create Project + - /management/v1/projects/{projectId}/users/{userId}, get - Get User + - /management/v1/projects/{projectId}/users/{userId}, put - Update User + - /management/v1/projects/{projectId}/users/{userId}, delete - Unassign User + - /management/v1/projects/{projectId}/metadata-schemas, post - Create Metadata Schema + - /management/v1/projects/{projectId}/metadata-schemas, get - List Metadata Schemas + - /management/v1/projects/{projectId}/metadata-schemas/{metadataSchemaId}, get - Get Metadata Schema + - /management/v1/projects/{projectId}/metadata-schemas/{metadataSchemaId}, put - Update Metadata Schema + - /management/v1/projects/{projectId}/metadata-schemas/{metadataSchemaId}, delete - Delete Metadata Schema + - /management/v1/projects/{projectId}/custom-event-schemas, post - Create Custom Event Schema + - /management/v1/projects/{projectId}/custom-event-schemas, get - List Custom Event Schema + - /management/v1/projects/{projectId}/custom-event-schemas/{customEventSchemaId}, get - Get Custom Event Schema + - /management/v1/projects/{projectId}/custom-event-schemas/{customEventSchemaId}, put - Update Custom Event Schema + - /management/v1/projects/{projectId}/custom-event-schemas/{customEventSchemaId}, delete - Delete Custom Event Schema + - /management/v1/projects/{projectId}/stacking-rules, post - Create Stacking Rules + - /management/v1/projects/{projectId}/stacking-rules, get - List Stacking Rules + - /management/v1/projects/{projectId}/stacking-rules/{stackingRulesId}, get - Get Stacking Rules + - /management/v1/projects/{projectId}/stacking-rules/{stackingRulesId}, put - Update Stacking Rules + - /management/v1/projects/{projectId}/stacking-rules/{stackingRulesId}, delete - Delete Stacking Rules + - /management/v1/projects/{projectId}/webhooks, post - Create Webhook + - /management/v1/projects/{projectId}/webhooks, get - List Webhooks + - /management/v1/projects/{projectId}/webhooks/{webhookId}, get - Get Webhook + - /management/v1/projects/{projectId}/webhooks/{webhookId}, put - Update Webhook + - /management/v1/projects/{projectId}/webhooks/{webhookId}, delete - Delete Webhook + - /management/v1/projects/{projectId}/branding, post - Create Brand + - /management/v1/projects/{projectId}/branding, get - List Brands + - /management/v1/projects/{projectId}/branding/{brandingId}, get - Get Brand + - /management/v1/projects/{projectId}/branding/{brandingId}, put - Update Brand + - /management/v1/projects/{projectId}/branding/{brandingId}, delete - Delete Brand - **2024-09-18** - `3.0.0` - The new version of the SDK includes coverage for all the most commonly used Voucherify endpoints and supports typed models. @@ -159,6 +221,8 @@ Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- *AsyncActionsApi* | [**get_async_action**](docs/AsyncActionsApi.md#get_async_action) | **GET** /v1/async-actions/{asyncActionId} | Get Async Action *AsyncActionsApi* | [**list_async_actions**](docs/AsyncActionsApi.md#list_async_actions) | **GET** /v1/async-actions | List Async Actions +*BinApi* | [**delete_bin_entry**](docs/BinApi.md#delete_bin_entry) | **DELETE** /v1/trash-bin/{binEntryId} | Delete Bin Entry +*BinApi* | [**list_bin_entries**](docs/BinApi.md#list_bin_entries) | **GET** /v1/trash-bin | List Bin Entries *CampaignsApi* | [**add_voucher_with_specific_code_to_campaign**](docs/CampaignsApi.md#add_voucher_with_specific_code_to_campaign) | **POST** /v1/campaigns/{campaignId}/vouchers/{code} | Add Voucher with Specific Code to Campaign *CampaignsApi* | [**add_vouchers_to_campaign**](docs/CampaignsApi.md#add_vouchers_to_campaign) | **POST** /v1/campaigns/{campaignId}/vouchers | Add Vouchers to Campaign *CampaignsApi* | [**create_campaign**](docs/CampaignsApi.md#create_campaign) | **POST** /v1/campaigns | Create Campaign @@ -242,6 +306,42 @@ Class | Method | HTTP request | Description *LoyaltiesApi* | [**update_loyalty_card_balance1**](docs/LoyaltiesApi.md#update_loyalty_card_balance1) | **POST** /v1/loyalties/{campaignId}/members/{memberId}/balance | Add or Remove Loyalty Card Balance *LoyaltiesApi* | [**update_loyalty_program**](docs/LoyaltiesApi.md#update_loyalty_program) | **PUT** /v1/loyalties/{campaignId} | Update Loyalty Campaign *LoyaltiesApi* | [**update_reward_assignment1**](docs/LoyaltiesApi.md#update_reward_assignment1) | **PUT** /v1/loyalties/{campaignId}/rewards/{assignmentId} | Update Reward Assignment +*ManagementApi* | [**assign_user**](docs/ManagementApi.md#assign_user) | **POST** /management/v1/projects/{projectId}/users | Assign User +*ManagementApi* | [**create_brand**](docs/ManagementApi.md#create_brand) | **POST** /management/v1/projects/{projectId}/branding | Create Brand +*ManagementApi* | [**create_custom_event_schema**](docs/ManagementApi.md#create_custom_event_schema) | **POST** /management/v1/projects/{projectId}/custom-event-schemas | Create Custom Event Schema +*ManagementApi* | [**create_metadata_schema**](docs/ManagementApi.md#create_metadata_schema) | **POST** /management/v1/projects/{projectId}/metadata-schemas | Create Metadata Schema +*ManagementApi* | [**create_project**](docs/ManagementApi.md#create_project) | **POST** /management/v1/projects | Create Project +*ManagementApi* | [**create_stacking_rules**](docs/ManagementApi.md#create_stacking_rules) | **POST** /management/v1/projects/{projectId}/stacking-rules | Create Stacking Rules +*ManagementApi* | [**create_webhook**](docs/ManagementApi.md#create_webhook) | **POST** /management/v1/projects/{projectId}/webhooks | Create Webhook +*ManagementApi* | [**delete_brand**](docs/ManagementApi.md#delete_brand) | **DELETE** /management/v1/projects/{projectId}/branding/{brandingId} | Delete Brand +*ManagementApi* | [**delete_custom_event_schema**](docs/ManagementApi.md#delete_custom_event_schema) | **DELETE** /management/v1/projects/{projectId}/custom-event-schemas/{customEventSchemaId} | Delete Custom Event Schema +*ManagementApi* | [**delete_metadata_schema**](docs/ManagementApi.md#delete_metadata_schema) | **DELETE** /management/v1/projects/{projectId}/metadata-schemas/{metadataSchemaId} | Delete Metadata Schema +*ManagementApi* | [**delete_project**](docs/ManagementApi.md#delete_project) | **DELETE** /management/v1/projects/{projectId} | Delete Project +*ManagementApi* | [**delete_stacking_rules**](docs/ManagementApi.md#delete_stacking_rules) | **DELETE** /management/v1/projects/{projectId}/stacking-rules/{stackingRulesId} | Delete Stacking Rules +*ManagementApi* | [**delete_webhook**](docs/ManagementApi.md#delete_webhook) | **DELETE** /management/v1/projects/{projectId}/webhooks/{webhookId} | Delete Webhook +*ManagementApi* | [**get_brand**](docs/ManagementApi.md#get_brand) | **GET** /management/v1/projects/{projectId}/branding/{brandingId} | Get Brand +*ManagementApi* | [**get_custom_event_schema**](docs/ManagementApi.md#get_custom_event_schema) | **GET** /management/v1/projects/{projectId}/custom-event-schemas/{customEventSchemaId} | Get Custom Event Schema +*ManagementApi* | [**get_metadata_schema1**](docs/ManagementApi.md#get_metadata_schema1) | **GET** /management/v1/projects/{projectId}/metadata-schemas/{metadataSchemaId} | Get Metadata Schema +*ManagementApi* | [**get_project**](docs/ManagementApi.md#get_project) | **GET** /management/v1/projects/{projectId} | Get Project +*ManagementApi* | [**get_stacking_rules**](docs/ManagementApi.md#get_stacking_rules) | **GET** /management/v1/projects/{projectId}/stacking-rules/{stackingRulesId} | Get Stacking Rules +*ManagementApi* | [**get_user**](docs/ManagementApi.md#get_user) | **GET** /management/v1/projects/{projectId}/users/{userId} | Get User +*ManagementApi* | [**get_webhook**](docs/ManagementApi.md#get_webhook) | **GET** /management/v1/projects/{projectId}/webhooks/{webhookId} | Get Webhook +*ManagementApi* | [**invite_user**](docs/ManagementApi.md#invite_user) | **POST** /management/v1/projects/users/invite | Invite a New User +*ManagementApi* | [**list_brands**](docs/ManagementApi.md#list_brands) | **GET** /management/v1/projects/{projectId}/branding | List Brands +*ManagementApi* | [**list_custom_event_schemas**](docs/ManagementApi.md#list_custom_event_schemas) | **GET** /management/v1/projects/{projectId}/custom-event-schemas | List Custom Event Schemas +*ManagementApi* | [**list_metadata_schemas1**](docs/ManagementApi.md#list_metadata_schemas1) | **GET** /management/v1/projects/{projectId}/metadata-schemas | List Metadata Schemas +*ManagementApi* | [**list_projects**](docs/ManagementApi.md#list_projects) | **GET** /management/v1/projects | List Projects +*ManagementApi* | [**list_stacking_rules**](docs/ManagementApi.md#list_stacking_rules) | **GET** /management/v1/projects/{projectId}/stacking-rules | List Stacking Rules +*ManagementApi* | [**list_users**](docs/ManagementApi.md#list_users) | **GET** /management/v1/projects/{projectId}/users | List Users +*ManagementApi* | [**list_webhooks**](docs/ManagementApi.md#list_webhooks) | **GET** /management/v1/projects/{projectId}/webhooks | List Webhooks +*ManagementApi* | [**unassign_user**](docs/ManagementApi.md#unassign_user) | **DELETE** /management/v1/projects/{projectId}/users/{userId} | Unassign User +*ManagementApi* | [**update_brand**](docs/ManagementApi.md#update_brand) | **PUT** /management/v1/projects/{projectId}/branding/{brandingId} | Update Brand +*ManagementApi* | [**update_custom_event_schema**](docs/ManagementApi.md#update_custom_event_schema) | **PUT** /management/v1/projects/{projectId}/custom-event-schemas/{customEventSchemaId} | Update Custom Event Schema +*ManagementApi* | [**update_metadata_schema**](docs/ManagementApi.md#update_metadata_schema) | **PUT** /management/v1/projects/{projectId}/metadata-schemas/{metadataSchemaId} | Update Metadata Schema +*ManagementApi* | [**update_project**](docs/ManagementApi.md#update_project) | **PUT** /management/v1/projects/{projectId} | Update Project +*ManagementApi* | [**update_stacking_rules**](docs/ManagementApi.md#update_stacking_rules) | **PUT** /management/v1/projects/{projectId}/stacking-rules/{stackingRulesId} | Update Stacking Rules +*ManagementApi* | [**update_user**](docs/ManagementApi.md#update_user) | **PUT** /management/v1/projects/{projectId}/users/{userId} | Update User +*ManagementApi* | [**update_webhook**](docs/ManagementApi.md#update_webhook) | **PUT** /management/v1/projects/{projectId}/webhooks/{webhookId} | Update Webhook *OrdersApi* | [**create_order**](docs/OrdersApi.md#create_order) | **POST** /v1/orders | Create Order *OrdersApi* | [**create_order_export**](docs/OrdersApi.md#create_order_export) | **POST** /v1/orders/export | Create Orders Export *OrdersApi* | [**get_order**](docs/OrdersApi.md#get_order) | **GET** /v1/orders/{orderId} | Get Order @@ -502,6 +602,7 @@ Class | Method | HTTP request | Description - [ExportsGetResponseBodyResult](docs/ExportsGetResponseBodyResult.md) - [ExportsListResponseBody](docs/ExportsListResponseBody.md) - [FieldConditions](docs/FieldConditions.md) + - [FilterConditionsDateTime](docs/FilterConditionsDateTime.md) - [FilterConditionsString](docs/FilterConditionsString.md) - [FiltersCondition](docs/FiltersCondition.md) - [Gift](docs/Gift.md) @@ -767,7 +868,125 @@ Class | Method | HTTP request | Description - [LoyaltyTiersExpirationAllExpirationDate](docs/LoyaltyTiersExpirationAllExpirationDate.md) - [LoyaltyTiersExpirationAllExpirationDateRounding](docs/LoyaltyTiersExpirationAllExpirationDateRounding.md) - [LoyaltyTiersExpirationAllStartDate](docs/LoyaltyTiersExpirationAllStartDate.md) - - [LuckyDraw](docs/LuckyDraw.md) + - [ManagementProject](docs/ManagementProject.md) + - [ManagementProjectApiUsageNotifications](docs/ManagementProjectApiUsageNotifications.md) + - [ManagementProjectDefaultCodeConfig](docs/ManagementProjectDefaultCodeConfig.md) + - [ManagementProjectLimits](docs/ManagementProjectLimits.md) + - [ManagementProjectLimitsApiCallsItem](docs/ManagementProjectLimitsApiCallsItem.md) + - [ManagementProjectLimitsBulkApiCallsItem](docs/ManagementProjectLimitsBulkApiCallsItem.md) + - [ManagementProjectWebhooksCalloutNotifications](docs/ManagementProjectWebhooksCalloutNotifications.md) + - [ManagementProjectWebhooksCalloutNotificationsDistributions](docs/ManagementProjectWebhooksCalloutNotificationsDistributions.md) + - [ManagementProjectWebhooksCalloutNotificationsWebhooks](docs/ManagementProjectWebhooksCalloutNotificationsWebhooks.md) + - [ManagementProjectsBranding](docs/ManagementProjectsBranding.md) + - [ManagementProjectsBrandingAddress](docs/ManagementProjectsBrandingAddress.md) + - [ManagementProjectsBrandingBrand](docs/ManagementProjectsBrandingBrand.md) + - [ManagementProjectsBrandingCockpits](docs/ManagementProjectsBrandingCockpits.md) + - [ManagementProjectsBrandingContact](docs/ManagementProjectsBrandingContact.md) + - [ManagementProjectsBrandingCreateRequestBody](docs/ManagementProjectsBrandingCreateRequestBody.md) + - [ManagementProjectsBrandingCreateRequestBodyAddress](docs/ManagementProjectsBrandingCreateRequestBodyAddress.md) + - [ManagementProjectsBrandingCreateRequestBodyBrand](docs/ManagementProjectsBrandingCreateRequestBodyBrand.md) + - [ManagementProjectsBrandingCreateRequestBodyCockpits](docs/ManagementProjectsBrandingCreateRequestBodyCockpits.md) + - [ManagementProjectsBrandingCreateRequestBodyContact](docs/ManagementProjectsBrandingCreateRequestBodyContact.md) + - [ManagementProjectsBrandingCreateResponseBody](docs/ManagementProjectsBrandingCreateResponseBody.md) + - [ManagementProjectsBrandingCreateResponseBodyAddress](docs/ManagementProjectsBrandingCreateResponseBodyAddress.md) + - [ManagementProjectsBrandingCreateResponseBodyBrand](docs/ManagementProjectsBrandingCreateResponseBodyBrand.md) + - [ManagementProjectsBrandingCreateResponseBodyCockpits](docs/ManagementProjectsBrandingCreateResponseBodyCockpits.md) + - [ManagementProjectsBrandingCreateResponseBodyContact](docs/ManagementProjectsBrandingCreateResponseBodyContact.md) + - [ManagementProjectsBrandingGetResponseBody](docs/ManagementProjectsBrandingGetResponseBody.md) + - [ManagementProjectsBrandingGetResponseBodyAddress](docs/ManagementProjectsBrandingGetResponseBodyAddress.md) + - [ManagementProjectsBrandingGetResponseBodyBrand](docs/ManagementProjectsBrandingGetResponseBodyBrand.md) + - [ManagementProjectsBrandingGetResponseBodyCockpits](docs/ManagementProjectsBrandingGetResponseBodyCockpits.md) + - [ManagementProjectsBrandingGetResponseBodyContact](docs/ManagementProjectsBrandingGetResponseBodyContact.md) + - [ManagementProjectsBrandingListResponseBody](docs/ManagementProjectsBrandingListResponseBody.md) + - [ManagementProjectsBrandingUpdateRequestBody](docs/ManagementProjectsBrandingUpdateRequestBody.md) + - [ManagementProjectsBrandingUpdateRequestBodyAddress](docs/ManagementProjectsBrandingUpdateRequestBodyAddress.md) + - [ManagementProjectsBrandingUpdateRequestBodyBrand](docs/ManagementProjectsBrandingUpdateRequestBodyBrand.md) + - [ManagementProjectsBrandingUpdateRequestBodyCockpits](docs/ManagementProjectsBrandingUpdateRequestBodyCockpits.md) + - [ManagementProjectsBrandingUpdateRequestBodyContact](docs/ManagementProjectsBrandingUpdateRequestBodyContact.md) + - [ManagementProjectsBrandingUpdateResponseBody](docs/ManagementProjectsBrandingUpdateResponseBody.md) + - [ManagementProjectsBrandingUpdateResponseBodyAddress](docs/ManagementProjectsBrandingUpdateResponseBodyAddress.md) + - [ManagementProjectsBrandingUpdateResponseBodyBrand](docs/ManagementProjectsBrandingUpdateResponseBodyBrand.md) + - [ManagementProjectsBrandingUpdateResponseBodyCockpits](docs/ManagementProjectsBrandingUpdateResponseBodyCockpits.md) + - [ManagementProjectsBrandingUpdateResponseBodyContact](docs/ManagementProjectsBrandingUpdateResponseBodyContact.md) + - [ManagementProjectsCreateRequestBody](docs/ManagementProjectsCreateRequestBody.md) + - [ManagementProjectsCreateRequestBodyApiUsageNotifications](docs/ManagementProjectsCreateRequestBodyApiUsageNotifications.md) + - [ManagementProjectsCreateRequestBodyUsersItem](docs/ManagementProjectsCreateRequestBodyUsersItem.md) + - [ManagementProjectsCreateRequestBodyWebhooksCalloutNotifications](docs/ManagementProjectsCreateRequestBodyWebhooksCalloutNotifications.md) + - [ManagementProjectsCreateRequestBodyWebhooksCalloutNotificationsDistributions](docs/ManagementProjectsCreateRequestBodyWebhooksCalloutNotificationsDistributions.md) + - [ManagementProjectsCreateRequestBodyWebhooksCalloutNotificationsWebhooks](docs/ManagementProjectsCreateRequestBodyWebhooksCalloutNotificationsWebhooks.md) + - [ManagementProjectsCreateResponseBody](docs/ManagementProjectsCreateResponseBody.md) + - [ManagementProjectsCreateResponseBodyApiUsageNotifications](docs/ManagementProjectsCreateResponseBodyApiUsageNotifications.md) + - [ManagementProjectsCreateResponseBodyClientSideKey](docs/ManagementProjectsCreateResponseBodyClientSideKey.md) + - [ManagementProjectsCreateResponseBodyServerSideKey](docs/ManagementProjectsCreateResponseBodyServerSideKey.md) + - [ManagementProjectsCreateResponseBodyWebhooksCalloutNotifications](docs/ManagementProjectsCreateResponseBodyWebhooksCalloutNotifications.md) + - [ManagementProjectsCreateResponseBodyWebhooksCalloutNotificationsDistributions](docs/ManagementProjectsCreateResponseBodyWebhooksCalloutNotificationsDistributions.md) + - [ManagementProjectsCreateResponseBodyWebhooksCalloutNotificationsWebhooks](docs/ManagementProjectsCreateResponseBodyWebhooksCalloutNotificationsWebhooks.md) + - [ManagementProjectsCustomEventSchema](docs/ManagementProjectsCustomEventSchema.md) + - [ManagementProjectsCustomEventSchemaSchema](docs/ManagementProjectsCustomEventSchemaSchema.md) + - [ManagementProjectsCustomEventSchemasCreateRequestBody](docs/ManagementProjectsCustomEventSchemasCreateRequestBody.md) + - [ManagementProjectsCustomEventSchemasCreateRequestBodySchema](docs/ManagementProjectsCustomEventSchemasCreateRequestBodySchema.md) + - [ManagementProjectsCustomEventSchemasCreateResponseBody](docs/ManagementProjectsCustomEventSchemasCreateResponseBody.md) + - [ManagementProjectsCustomEventSchemasCreateResponseBodySchema](docs/ManagementProjectsCustomEventSchemasCreateResponseBodySchema.md) + - [ManagementProjectsCustomEventSchemasGetResponseBody](docs/ManagementProjectsCustomEventSchemasGetResponseBody.md) + - [ManagementProjectsCustomEventSchemasGetResponseBodySchema](docs/ManagementProjectsCustomEventSchemasGetResponseBodySchema.md) + - [ManagementProjectsCustomEventSchemasListResponseBody](docs/ManagementProjectsCustomEventSchemasListResponseBody.md) + - [ManagementProjectsCustomEventSchemasUpdateRequestBody](docs/ManagementProjectsCustomEventSchemasUpdateRequestBody.md) + - [ManagementProjectsCustomEventSchemasUpdateRequestBodySchema](docs/ManagementProjectsCustomEventSchemasUpdateRequestBodySchema.md) + - [ManagementProjectsCustomEventSchemasUpdateResponseBody](docs/ManagementProjectsCustomEventSchemasUpdateResponseBody.md) + - [ManagementProjectsCustomEventSchemasUpdateResponseBodySchema](docs/ManagementProjectsCustomEventSchemasUpdateResponseBodySchema.md) + - [ManagementProjectsGetResponseBody](docs/ManagementProjectsGetResponseBody.md) + - [ManagementProjectsGetResponseBodyApiUsageNotifications](docs/ManagementProjectsGetResponseBodyApiUsageNotifications.md) + - [ManagementProjectsGetResponseBodyDefaultCodeConfig](docs/ManagementProjectsGetResponseBodyDefaultCodeConfig.md) + - [ManagementProjectsGetResponseBodyLimits](docs/ManagementProjectsGetResponseBodyLimits.md) + - [ManagementProjectsGetResponseBodyLimitsApiCallsItem](docs/ManagementProjectsGetResponseBodyLimitsApiCallsItem.md) + - [ManagementProjectsGetResponseBodyLimitsBulkApiCallsItem](docs/ManagementProjectsGetResponseBodyLimitsBulkApiCallsItem.md) + - [ManagementProjectsGetResponseBodyWebhooksCalloutNotifications](docs/ManagementProjectsGetResponseBodyWebhooksCalloutNotifications.md) + - [ManagementProjectsGetResponseBodyWebhooksCalloutNotificationsDistributions](docs/ManagementProjectsGetResponseBodyWebhooksCalloutNotificationsDistributions.md) + - [ManagementProjectsGetResponseBodyWebhooksCalloutNotificationsWebhooks](docs/ManagementProjectsGetResponseBodyWebhooksCalloutNotificationsWebhooks.md) + - [ManagementProjectsListResponseBody](docs/ManagementProjectsListResponseBody.md) + - [ManagementProjectsMetadataSchema](docs/ManagementProjectsMetadataSchema.md) + - [ManagementProjectsMetadataSchemasCreateRequestBody](docs/ManagementProjectsMetadataSchemasCreateRequestBody.md) + - [ManagementProjectsMetadataSchemasCreateResponseBody](docs/ManagementProjectsMetadataSchemasCreateResponseBody.md) + - [ManagementProjectsMetadataSchemasGetResponseBody](docs/ManagementProjectsMetadataSchemasGetResponseBody.md) + - [ManagementProjectsMetadataSchemasListResponseBody](docs/ManagementProjectsMetadataSchemasListResponseBody.md) + - [ManagementProjectsMetadataSchemasUpdateRequestBody](docs/ManagementProjectsMetadataSchemasUpdateRequestBody.md) + - [ManagementProjectsMetadataSchemasUpdateResponseBody](docs/ManagementProjectsMetadataSchemasUpdateResponseBody.md) + - [ManagementProjectsStackingRules](docs/ManagementProjectsStackingRules.md) + - [ManagementProjectsStackingRulesCreateRequestBody](docs/ManagementProjectsStackingRulesCreateRequestBody.md) + - [ManagementProjectsStackingRulesCreateResponseBody](docs/ManagementProjectsStackingRulesCreateResponseBody.md) + - [ManagementProjectsStackingRulesGetResponseBody](docs/ManagementProjectsStackingRulesGetResponseBody.md) + - [ManagementProjectsStackingRulesListResponseBody](docs/ManagementProjectsStackingRulesListResponseBody.md) + - [ManagementProjectsStackingRulesUpdateRequestBody](docs/ManagementProjectsStackingRulesUpdateRequestBody.md) + - [ManagementProjectsStackingRulesUpdateResponseBody](docs/ManagementProjectsStackingRulesUpdateResponseBody.md) + - [ManagementProjectsUpdateRequestBody](docs/ManagementProjectsUpdateRequestBody.md) + - [ManagementProjectsUpdateRequestBodyApiUsageNotifications](docs/ManagementProjectsUpdateRequestBodyApiUsageNotifications.md) + - [ManagementProjectsUpdateRequestBodyDefaultCodeConfig](docs/ManagementProjectsUpdateRequestBodyDefaultCodeConfig.md) + - [ManagementProjectsUpdateRequestBodyWebhooksCalloutNotifications](docs/ManagementProjectsUpdateRequestBodyWebhooksCalloutNotifications.md) + - [ManagementProjectsUpdateRequestBodyWebhooksCalloutNotificationsDistributions](docs/ManagementProjectsUpdateRequestBodyWebhooksCalloutNotificationsDistributions.md) + - [ManagementProjectsUpdateRequestBodyWebhooksCalloutNotificationsWebhooks](docs/ManagementProjectsUpdateRequestBodyWebhooksCalloutNotificationsWebhooks.md) + - [ManagementProjectsUpdateResponseBody](docs/ManagementProjectsUpdateResponseBody.md) + - [ManagementProjectsUpdateResponseBodyApiUsageNotifications](docs/ManagementProjectsUpdateResponseBodyApiUsageNotifications.md) + - [ManagementProjectsUpdateResponseBodyDefaultCodeConfig](docs/ManagementProjectsUpdateResponseBodyDefaultCodeConfig.md) + - [ManagementProjectsUpdateResponseBodyLimits](docs/ManagementProjectsUpdateResponseBodyLimits.md) + - [ManagementProjectsUpdateResponseBodyLimitsApiCallsItem](docs/ManagementProjectsUpdateResponseBodyLimitsApiCallsItem.md) + - [ManagementProjectsUpdateResponseBodyLimitsBulkApiCallsItem](docs/ManagementProjectsUpdateResponseBodyLimitsBulkApiCallsItem.md) + - [ManagementProjectsUpdateResponseBodyWebhooksCalloutNotifications](docs/ManagementProjectsUpdateResponseBodyWebhooksCalloutNotifications.md) + - [ManagementProjectsUpdateResponseBodyWebhooksCalloutNotificationsDistributions](docs/ManagementProjectsUpdateResponseBodyWebhooksCalloutNotificationsDistributions.md) + - [ManagementProjectsUpdateResponseBodyWebhooksCalloutNotificationsWebhooks](docs/ManagementProjectsUpdateResponseBodyWebhooksCalloutNotificationsWebhooks.md) + - [ManagementProjectsUsersAssignRequestBody](docs/ManagementProjectsUsersAssignRequestBody.md) + - [ManagementProjectsUsersAssignResponseBody](docs/ManagementProjectsUsersAssignResponseBody.md) + - [ManagementProjectsUsersGetUserResponseBody](docs/ManagementProjectsUsersGetUserResponseBody.md) + - [ManagementProjectsUsersInviteCreateRequestBody](docs/ManagementProjectsUsersInviteCreateRequestBody.md) + - [ManagementProjectsUsersListResponseBody](docs/ManagementProjectsUsersListResponseBody.md) + - [ManagementProjectsUsersUpdateRoleRequestBody](docs/ManagementProjectsUsersUpdateRoleRequestBody.md) + - [ManagementProjectsUsersUpdateRoleResponseBody](docs/ManagementProjectsUsersUpdateRoleResponseBody.md) + - [ManagementProjectsWebhook](docs/ManagementProjectsWebhook.md) + - [ManagementProjectsWebhooksCreateRequestBody](docs/ManagementProjectsWebhooksCreateRequestBody.md) + - [ManagementProjectsWebhooksCreateResponseBody](docs/ManagementProjectsWebhooksCreateResponseBody.md) + - [ManagementProjectsWebhooksGetResponseBody](docs/ManagementProjectsWebhooksGetResponseBody.md) + - [ManagementProjectsWebhooksListResponseBody](docs/ManagementProjectsWebhooksListResponseBody.md) + - [ManagementProjectsWebhooksUpdateRequestBody](docs/ManagementProjectsWebhooksUpdateRequestBody.md) + - [ManagementProjectsWebhooksUpdateResponseBody](docs/ManagementProjectsWebhooksUpdateResponseBody.md) - [MemberActivity](docs/MemberActivity.md) - [Order](docs/Order.md) - [OrderCalculated](docs/OrderCalculated.md) @@ -793,12 +1012,25 @@ Class | Method | HTTP request | Description - [ParameterCampaignType](docs/ParameterCampaignType.md) - [ParameterCreatedBeforeAfter](docs/ParameterCreatedBeforeAfter.md) - [ParameterExpandListCampaigns](docs/ParameterExpandListCampaigns.md) + - [ParameterFiltersListBin](docs/ParameterFiltersListBin.md) + - [ParameterFiltersListBinId](docs/ParameterFiltersListBinId.md) + - [ParameterFiltersListBinResourceId](docs/ParameterFiltersListBinResourceId.md) + - [ParameterFiltersListBinResourceName](docs/ParameterFiltersListBinResourceName.md) + - [ParameterFiltersListBinResourceType](docs/ParameterFiltersListBinResourceType.md) + - [ParameterFiltersListBinResourceTypeConditions](docs/ParameterFiltersListBinResourceTypeConditions.md) + - [ParameterFiltersListCampaigns](docs/ParameterFiltersListCampaigns.md) + - [ParameterFiltersListCampaignsCampaignStatus](docs/ParameterFiltersListCampaignsCampaignStatus.md) + - [ParameterFiltersListCampaignsCampaignStatusConditions](docs/ParameterFiltersListCampaignsCampaignStatusConditions.md) + - [ParameterFiltersListCampaignsCategories](docs/ParameterFiltersListCampaignsCategories.md) + - [ParameterFiltersListCampaignsCategoryIds](docs/ParameterFiltersListCampaignsCategoryIds.md) + - [ParameterFiltersListCampaignsIsReferralCode](docs/ParameterFiltersListCampaignsIsReferralCode.md) + - [ParameterFiltersListCampaignsValidityTimeframe](docs/ParameterFiltersListCampaignsValidityTimeframe.md) + - [ParameterFiltersListCampaignsVoucherType](docs/ParameterFiltersListCampaignsVoucherType.md) - [ParameterFiltersListCustomerRedeemables](docs/ParameterFiltersListCustomerRedeemables.md) - [ParameterFiltersListCustomerRedeemablesCampaignId](docs/ParameterFiltersListCustomerRedeemablesCampaignId.md) - [ParameterFiltersListCustomerRedeemablesCampaignType](docs/ParameterFiltersListCustomerRedeemablesCampaignType.md) - [ParameterFiltersListCustomerRedeemablesCampaignTypeConditions](docs/ParameterFiltersListCustomerRedeemablesCampaignTypeConditions.md) - [ParameterFiltersListCustomerRedeemablesCreatedAt](docs/ParameterFiltersListCustomerRedeemablesCreatedAt.md) - - [ParameterFiltersListCustomerRedeemablesCreatedAtConditions](docs/ParameterFiltersListCustomerRedeemablesCreatedAtConditions.md) - [ParameterFiltersListCustomerRedeemablesHolderRole](docs/ParameterFiltersListCustomerRedeemablesHolderRole.md) - [ParameterFiltersListCustomerRedeemablesHolderRoleConditions](docs/ParameterFiltersListCustomerRedeemablesHolderRoleConditions.md) - [ParameterFiltersListCustomerRedeemablesId](docs/ParameterFiltersListCustomerRedeemablesId.md) @@ -807,6 +1039,16 @@ Class | Method | HTTP request | Description - [ParameterFiltersListCustomerRedeemablesRedeemableObjectConditions](docs/ParameterFiltersListCustomerRedeemablesRedeemableObjectConditions.md) - [ParameterFiltersListCustomerRedeemablesVoucherType](docs/ParameterFiltersListCustomerRedeemablesVoucherType.md) - [ParameterFiltersListCustomerRedeemablesVoucherTypeConditions](docs/ParameterFiltersListCustomerRedeemablesVoucherTypeConditions.md) + - [ParameterFiltersListPublications](docs/ParameterFiltersListPublications.md) + - [ParameterFiltersListPublicationsCampaignName](docs/ParameterFiltersListPublicationsCampaignName.md) + - [ParameterFiltersListPublicationsCustomerId](docs/ParameterFiltersListPublicationsCustomerId.md) + - [ParameterFiltersListPublicationsFailureCode](docs/ParameterFiltersListPublicationsFailureCode.md) + - [ParameterFiltersListPublicationsIsReferralCode](docs/ParameterFiltersListPublicationsIsReferralCode.md) + - [ParameterFiltersListPublicationsParentObjectId](docs/ParameterFiltersListPublicationsParentObjectId.md) + - [ParameterFiltersListPublicationsRelatedObjectId](docs/ParameterFiltersListPublicationsRelatedObjectId.md) + - [ParameterFiltersListPublicationsResult](docs/ParameterFiltersListPublicationsResult.md) + - [ParameterFiltersListPublicationsSourceId](docs/ParameterFiltersListPublicationsSourceId.md) + - [ParameterFiltersListPublicationsVoucherType](docs/ParameterFiltersListPublicationsVoucherType.md) - [ParameterFiltersListRedemptions](docs/ParameterFiltersListRedemptions.md) - [ParameterFiltersListRedemptionsCampaignName](docs/ParameterFiltersListRedemptionsCampaignName.md) - [ParameterFiltersListRedemptionsCustomerId](docs/ParameterFiltersListRedemptionsCustomerId.md) @@ -821,6 +1063,7 @@ Class | Method | HTTP request | Description - [ParameterOrder](docs/ParameterOrder.md) - [ParameterOrderCreatedAt](docs/ParameterOrderCreatedAt.md) - [ParameterOrderListAllPromotionStacks](docs/ParameterOrderListAllPromotionStacks.md) + - [ParameterOrderListBin](docs/ParameterOrderListBin.md) - [ParameterOrderListCampaigns](docs/ParameterOrderListCampaigns.md) - [ParameterOrderListCustomers](docs/ParameterOrderListCustomers.md) - [ParameterOrderListEarningRules](docs/ParameterOrderListEarningRules.md) @@ -1136,6 +1379,10 @@ Class | Method | HTTP request | Description - [SkusImportCsvCreateResponseBody](docs/SkusImportCsvCreateResponseBody.md) - [SkusListForProduct](docs/SkusListForProduct.md) - [StackingRules](docs/StackingRules.md) + - [TrashBinItem](docs/TrashBinItem.md) + - [TrashBinListResponseBody](docs/TrashBinListResponseBody.md) + - [UsageNotifications](docs/UsageNotifications.md) + - [User](docs/User.md) - [ValidationRule](docs/ValidationRule.md) - [ValidationRuleApplicableTo](docs/ValidationRuleApplicableTo.md) - [ValidationRuleAssignment](docs/ValidationRuleAssignment.md) @@ -1296,6 +1543,20 @@ Authentication schemes defined for the API: - **API key parameter name**: X-Client-Application-Id - **Location**: HTTP header + +### X-Management-Id + +- **Type**: API key +- **API key parameter name**: X-Management-Id +- **Location**: HTTP header + + +### X-Management-Token + +- **Type**: API key +- **API key parameter name**: X-Management-Token +- **Location**: HTTP header + ## Author diff --git a/__tests__/test_02_redemption.py b/__tests__/test_02_redemption.py index 6487ab6f..35ec9d01 100644 --- a/__tests__/test_02_redemption.py +++ b/__tests__/test_02_redemption.py @@ -105,20 +105,19 @@ def test_03_get_customer(self): def test_04_list_redemptions(self): with voucherifyClient.ApiClient(spec_utils.configuration) as api_client: api_instance = voucherifyClient.RedemptionsApi(api_client) - # OBJECTS IN QUERY ARE NOT YET SUPPORTED !! - # - # list_redemptions_filters = voucherifyClient.ParameterFiltersListRedemptions( - # voucher_code=voucherifyClient.ParameterFiltersListRedemptionsVoucherCode( - # conditions=voucherifyClient.FilterConditionsString( - # var_is=voucher_code - # ) - # ) - # ) + + list_redemptions_filters = voucherifyClient.ParameterFiltersListRedemptions( + voucher_code=voucherifyClient.ParameterFiltersListRedemptionsVoucherCode( + conditions=voucherifyClient.FilterConditionsString( + is_not=voucher_code + ) + ) + ) try: result = api_instance.list_redemptions( 100, None,None,None,None,None,None, - # list_redemptions_filters + list_redemptions_filters ) self.assertEqual(result.object, 'list') except voucherifyClient.ApiException as e: diff --git a/docs/BinApi.md b/docs/BinApi.md new file mode 100644 index 00000000..be6568d2 --- /dev/null +++ b/docs/BinApi.md @@ -0,0 +1,187 @@ +# voucherify.BinApi + +All URIs are relative to *https://api.voucherify.io* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**delete_bin_entry**](BinApi.md#delete_bin_entry) | **DELETE** /v1/trash-bin/{binEntryId} | Delete Bin Entry +[**list_bin_entries**](BinApi.md#list_bin_entries) | **GET** /v1/trash-bin | List Bin Entries + + +# **delete_bin_entry** +> delete_bin_entry(bin_entry_id) + +Delete Bin Entry + +Deletes permanently a bin entry with a given ID.The following resources can be moved to the bin and permanently deleted: - campaigns - vouchers - products - SKUs To use this endpoint and delete a given resource type, you must have the following permissions: - vouchers.delete to delete a voucher, - campaigns.delete to delete a campaign, - products.delete to delete a product or SKU. + +### Example + +* Api Key Authentication (X-App-Id): +* Api Key Authentication (X-App-Token): + +```python +import voucherify +from voucherify.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.voucherify.io +# See configuration.py for a list of all supported configuration parameters. +configuration = voucherify.Configuration( + host = "https://api.voucherify.io" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: X-App-Id +configuration.api_key['X-App-Id'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['X-App-Id'] = 'Bearer' + +# Configure API key authorization: X-App-Token +configuration.api_key['X-App-Token'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['X-App-Token'] = 'Bearer' + +# Enter a context with an instance of the API client +with voucherify.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = voucherify.BinApi(api_client) + bin_entry_id = 'bin_entry_id_example' # str | Provide the unique identifier of the bin entry. + + try: + # Delete Bin Entry + api_instance.delete_bin_entry(bin_entry_id) + except Exception as e: + print("Exception when calling BinApi->delete_bin_entry: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **bin_entry_id** | **str**| Provide the unique identifier of the bin entry. | + +### Return type + +void (empty response body) + +### Authorization + +[X-App-Id](../README.md#X-App-Id), [X-App-Token](../README.md#X-App-Token) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**2XX** | Returns no content if deletion is successful. | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **list_bin_entries** +> TrashBinListResponseBody list_bin_entries(limit=limit, order=order, starting_after_id=starting_after_id, filters=filters) + +List Bin Entries + +Retrieves a list of resources moved to the bin. The following resources can be moved to the bin: - campaigns - vouchers - products - SKUs To use this endpoint, you must have the following permissions: - vouchers.read - campaigns.read - products.read + +### Example + +* Api Key Authentication (X-App-Id): +* Api Key Authentication (X-App-Token): + +```python +import voucherify +from voucherify.models.parameter_filters_list_bin import ParameterFiltersListBin +from voucherify.models.parameter_order_list_bin import ParameterOrderListBin +from voucherify.models.trash_bin_list_response_body import TrashBinListResponseBody +from voucherify.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.voucherify.io +# See configuration.py for a list of all supported configuration parameters. +configuration = voucherify.Configuration( + host = "https://api.voucherify.io" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: X-App-Id +configuration.api_key['X-App-Id'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['X-App-Id'] = 'Bearer' + +# Configure API key authorization: X-App-Token +configuration.api_key['X-App-Token'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['X-App-Token'] = 'Bearer' + +# Enter a context with an instance of the API client +with voucherify.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = voucherify.BinApi(api_client) + limit = 56 # int | Limits the number of objects to be returned. The limit can range between 1 and 100 items. If no limit is set, it returns 10 items. (optional) + order = voucherify.ParameterOrderListBin() # ParameterOrderListBin | Orders the bin entries according the date and time when they were moved to the bin or according to the bin entry ID. The dash - preceding a sorting option means sorting in a descending order. (optional) + starting_after_id = 'starting_after_id_example' # str | A cursor for pagination. It retrieves the events starting after an event with the given ID. (optional) + filters = voucherify.ParameterFiltersListBin() # ParameterFiltersListBin | Filters for listing bin entries. (optional) + + try: + # List Bin Entries + api_response = api_instance.list_bin_entries(limit=limit, order=order, starting_after_id=starting_after_id, filters=filters) + print("The response of BinApi->list_bin_entries:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling BinApi->list_bin_entries: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **limit** | **int**| Limits the number of objects to be returned. The limit can range between 1 and 100 items. If no limit is set, it returns 10 items. | [optional] + **order** | [**ParameterOrderListBin**](.md)| Orders the bin entries according the date and time when they were moved to the bin or according to the bin entry ID. The dash - preceding a sorting option means sorting in a descending order. | [optional] + **starting_after_id** | **str**| A cursor for pagination. It retrieves the events starting after an event with the given ID. | [optional] + **filters** | [**ParameterFiltersListBin**](.md)| Filters for listing bin entries. | [optional] + +### Return type + +[**TrashBinListResponseBody**](TrashBinListResponseBody.md) + +### Authorization + +[X-App-Id](../README.md#X-App-Id), [X-App-Token](../README.md#X-App-Token) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**2XX** | Returns the list of all the bin entries matching the query parameters. | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/docs/CampaignBase.md b/docs/CampaignBase.md index a035510a..97ea392a 100644 --- a/docs/CampaignBase.md +++ b/docs/CampaignBase.md @@ -29,6 +29,7 @@ Name | Type | Description | Notes **category** | **str** | Unique category name. | [optional] **creation_status** | **str** | Indicates the status of the campaign creation. | [optional] **vouchers_generation_status** | **str** | Indicates the status of the campaign's voucher generation. | [optional] +**readonly** | **bool** | Indicates whether the campaign can be only read by a restricted user in the Areas and Stores enterprise feature. It is returned only to restricted users; this field is not returned for users with other roles. | [optional] **protected** | **bool** | Indicates whether the resource can be deleted. | [optional] **category_id** | **str** | Unique category ID that this campaign belongs to. | [optional] **categories** | [**List[Category]**](Category.md) | Contains details about the category. | [optional] diff --git a/docs/CampaignsApi.md b/docs/CampaignsApi.md index b6c65b03..82d22a1b 100644 --- a/docs/CampaignsApi.md +++ b/docs/CampaignsApi.md @@ -808,7 +808,7 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **list_campaigns** -> CampaignsListResponseBody list_campaigns(limit=limit, page=page, campaign_type=campaign_type, expand=expand, order=order) +> CampaignsListResponseBody list_campaigns(limit=limit, page=page, campaign_type=campaign_type, expand=expand, order=order, filters=filters) List Campaigns @@ -824,6 +824,7 @@ import voucherify from voucherify.models.campaigns_list_response_body import CampaignsListResponseBody from voucherify.models.parameter_campaign_type import ParameterCampaignType from voucherify.models.parameter_expand_list_campaigns import ParameterExpandListCampaigns +from voucherify.models.parameter_filters_list_campaigns import ParameterFiltersListCampaigns from voucherify.models.parameter_order_list_campaigns import ParameterOrderListCampaigns from voucherify.rest import ApiException from pprint import pprint @@ -860,10 +861,11 @@ with voucherify.ApiClient(configuration) as api_client: campaign_type = voucherify.ParameterCampaignType() # ParameterCampaignType | This attribute allows filtering by campaign type. (optional) expand = category # ParameterExpandListCampaigns | Include an expanded categories object in the response. (optional) (default to category) order = voucherify.ParameterOrderListCampaigns() # ParameterOrderListCampaigns | Sorts the results using one of the filtering options, where the dash - preceding a sorting option means sorting in a descending order. (optional) + filters = voucherify.ParameterFiltersListCampaigns() # ParameterFiltersListCampaigns | Filters the results by campaign status or whether the campaign is a referral campaign. (optional) try: # List Campaigns - api_response = api_instance.list_campaigns(limit=limit, page=page, campaign_type=campaign_type, expand=expand, order=order) + api_response = api_instance.list_campaigns(limit=limit, page=page, campaign_type=campaign_type, expand=expand, order=order, filters=filters) print("The response of CampaignsApi->list_campaigns:\n") pprint(api_response) except Exception as e: @@ -882,6 +884,7 @@ Name | Type | Description | Notes **campaign_type** | [**ParameterCampaignType**](.md)| This attribute allows filtering by campaign type. | [optional] **expand** | [**ParameterExpandListCampaigns**](.md)| Include an expanded categories object in the response. | [optional] [default to category] **order** | [**ParameterOrderListCampaigns**](.md)| Sorts the results using one of the filtering options, where the dash - preceding a sorting option means sorting in a descending order. | [optional] + **filters** | [**ParameterFiltersListCampaigns**](.md)| Filters the results by campaign status or whether the campaign is a referral campaign. | [optional] ### Return type diff --git a/docs/CampaignsCreateRequestBody.md b/docs/CampaignsCreateRequestBody.md index f9c059df..9624db1c 100644 --- a/docs/CampaignsCreateRequestBody.md +++ b/docs/CampaignsCreateRequestBody.md @@ -26,7 +26,6 @@ Name | Type | Description | Notes **voucher** | [**CampaignsCreateRequestBodyVoucher**](CampaignsCreateRequestBodyVoucher.md) | | [optional] **referral_program** | [**ReferralProgram**](ReferralProgram.md) | | [optional] **promotion** | [**CampaignsCreateRequestBodyPromotion**](CampaignsCreateRequestBodyPromotion.md) | | [optional] -**lucky_draw** | [**LuckyDraw**](LuckyDraw.md) | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/CampaignsCreateResponseBody.md b/docs/CampaignsCreateResponseBody.md index 9994b6a1..9a6be731 100644 --- a/docs/CampaignsCreateResponseBody.md +++ b/docs/CampaignsCreateResponseBody.md @@ -29,6 +29,7 @@ Name | Type | Description | Notes **category** | **str** | Unique category name. | [optional] **creation_status** | **str** | Indicates the status of the campaign creation. | [optional] **vouchers_generation_status** | **str** | Indicates the status of the campaign's voucher generation. | [optional] +**readonly** | **bool** | Indicates whether the campaign can be only read by a restricted user in the Areas and Stores enterprise feature. It is returned only to restricted users; this field is not returned for users with other roles. | [optional] **protected** | **bool** | Indicates whether the resource can be deleted. | [optional] **category_id** | **str** | Unique category ID that this campaign belongs to. | [optional] **categories** | [**List[Category]**](Category.md) | Contains details about the category. | [optional] diff --git a/docs/CampaignsGetResponseBody.md b/docs/CampaignsGetResponseBody.md index 7f080b57..5a495eed 100644 --- a/docs/CampaignsGetResponseBody.md +++ b/docs/CampaignsGetResponseBody.md @@ -29,6 +29,7 @@ Name | Type | Description | Notes **category** | **str** | Unique category name. | [optional] **creation_status** | **str** | Indicates the status of the campaign creation. | [optional] **vouchers_generation_status** | **str** | Indicates the status of the campaign's voucher generation. | [optional] +**readonly** | **bool** | Indicates whether the campaign can be only read by a restricted user in the Areas and Stores enterprise feature. It is returned only to restricted users; this field is not returned for users with other roles. | [optional] **protected** | **bool** | Indicates whether the resource can be deleted. | [optional] **category_id** | **str** | Unique category ID that this campaign belongs to. | [optional] **categories** | [**List[Category]**](Category.md) | Contains details about the category. | [optional] diff --git a/docs/CampaignsUpdateRequestBody.md b/docs/CampaignsUpdateRequestBody.md index e5c8eaf2..e4ba3471 100644 --- a/docs/CampaignsUpdateRequestBody.md +++ b/docs/CampaignsUpdateRequestBody.md @@ -5,6 +5,11 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- +**discount** | **object** | | [optional] +**referral_program** | [**ReferralProgram**](ReferralProgram.md) | | [optional] +**gift** | [**Gift**](Gift.md) | | [optional] +**loyalty_tiers_expiration** | [**LoyaltyTiersExpirationAll**](LoyaltyTiersExpirationAll.md) | | [optional] +**options** | [**CampaignsUpdateRequestBodyOptions**](CampaignsUpdateRequestBodyOptions.md) | | [optional] **start_date** | **datetime** | Activation timestamp defines when the campaign starts to be active in ISO 8601 format. Campaign is *inactive before* this date. | [optional] **expiration_date** | **datetime** | Expiration timestamp defines when the campaign expires in ISO 8601 format. Campaign is *inactive after* this date. | [optional] **validity_timeframe** | [**ValidityTimeframe**](ValidityTimeframe.md) | | [optional] @@ -12,21 +17,9 @@ Name | Type | Description | Notes **validity_hours** | [**ValidityHours**](ValidityHours.md) | | [optional] **description** | **str** | An optional field to keep any extra textual information about the campaign such as a campaign description and details. | [optional] **category** | **str** | The category assigned to the campaign. Either pass this parameter OR the `category_id`. | [optional] -**metadata** | **object** | | [optional] +**metadata** | **object** | The metadata object stores all custom attributes assigned to the campaign. A set of key/value pairs that you can attach to a campaign object. It can be useful for storing additional information about the campaign in a structured format. | [optional] **unset_metadata_fields** | **List[str]** | Determine which metadata should be removed from campaign. | [optional] **category_id** | **str** | Unique category ID that this campaign belongs to. Either pass this parameter OR the `category`. | [optional] -**activity_duration_after_publishing** | **str** | Defines the amount of time the vouchers will be active after publishing. The value is shown in the ISO 8601 format. For example, a voucher with the value of P24D will be valid for a duration of 24 days. | [optional] -**join_once** | **bool** | If this value is set to `true`, customers will be able to join the campaign only once. | [optional] -**auto_join** | **bool** | Indicates whether customers will be able to auto-join a loyalty campaign if any earning rule is fulfilled. | [optional] -**type** | **str** | Defines whether the campaign can be updated with new vouchers after campaign creation. - `AUTO_UPDATE`: By choosing the auto update option you will create a campaign that can be enhanced by new vouchers after the time of creation (e.g. by publish vouchers method). - `STATIC`: vouchers need to be manually published. | [optional] -**discount** | **object** | | [optional] -**referral_program** | [**ReferralProgram**](ReferralProgram.md) | | [optional] -**gift** | [**Gift**](Gift.md) | | [optional] -**loyalty_tiers_expiration** | [**LoyaltyTiersExpirationAll**](LoyaltyTiersExpirationAll.md) | | [optional] -**options** | [**CampaignsUpdateRequestBodyOptions**](CampaignsUpdateRequestBodyOptions.md) | | [optional] -**winners_count** | **str** | It represents the total number of winners in a lucky draw. | [optional] -**unique_winners_per_draw** | **str** | It indicates whether each winner in a draw is unique or not. | [optional] -**unique_winners** | **str** | Specifies whether each participant can win only once across multiple draws. | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/CampaignsUpdateResponseBody.md b/docs/CampaignsUpdateResponseBody.md index 2964f0d5..ffccce4e 100644 --- a/docs/CampaignsUpdateResponseBody.md +++ b/docs/CampaignsUpdateResponseBody.md @@ -29,6 +29,7 @@ Name | Type | Description | Notes **category** | **str** | Unique category name. | [optional] **creation_status** | **str** | Indicates the status of the campaign creation. | [optional] **vouchers_generation_status** | **str** | Indicates the status of the campaign's voucher generation. | [optional] +**readonly** | **bool** | Indicates whether the campaign can be only read by a restricted user in the Areas and Stores enterprise feature. It is returned only to restricted users; this field is not returned for users with other roles. | [optional] **protected** | **bool** | Indicates whether the resource can be deleted. | [optional] **category_id** | **str** | Unique category ID that this campaign belongs to. | [optional] **categories** | [**List[Category]**](Category.md) | Contains details about the category. | [optional] diff --git a/docs/FilterConditionsDateTime.md b/docs/FilterConditionsDateTime.md new file mode 100644 index 00000000..4a17ab29 --- /dev/null +++ b/docs/FilterConditionsDateTime.md @@ -0,0 +1,18 @@ +# FilterConditionsDateTime + +Data filters used to narrow down the data records to be returned in the result. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**after** | **datetime** | Value is after this date. The value for this parameter is shown in the ISO 8601 format. | [optional] +**before** | **datetime** | Value is before this date. The value for this parameter is shown in the ISO 8601 format. | [optional] +**has_value** | **str** | Value is NOT null. The value for this parameter is an empty string. | [optional] +**is_unknown** | **str** | Value is null. The value for this parameter is an empty string. | [optional] +**more_than** | **int** | Value is more days ago before the current date and time, e.g. more than `10` days ago. | [optional] +**less_than** | **int** | Value is less days before the current date and time, e.g. less than `10` days ago. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/FilterConditionsDateTimeConditions.md b/docs/FilterConditionsDateTimeConditions.md new file mode 100644 index 00000000..5e8ce319 --- /dev/null +++ b/docs/FilterConditionsDateTimeConditions.md @@ -0,0 +1,18 @@ +# FilterConditionsDateTimeConditions + +Data filters used to narrow down the data records to be returned in the result. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**after** | **datetime** | Value is after this date. The value for this parameter is shown in the ISO 8601 format. | [optional] +**before** | **datetime** | Value is before this date. The value for this parameter is shown in the ISO 8601 format. | [optional] +**has_value** | **str** | Value is NOT null. The value for this parameter is an empty string. | [optional] +**is_unknown** | **str** | Value is null. The value for this parameter is an empty string. | [optional] +**more_than** | **int** | Value is more days ago before the current date and time, e.g. more than `10` days ago. | [optional] +**less_than** | **int** | Value is less days before the current date and time, e.g. less than `10` days ago. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/LoyaltiesCreateCampaignResponseBody.md b/docs/LoyaltiesCreateCampaignResponseBody.md index 5eb58828..83860f95 100644 --- a/docs/LoyaltiesCreateCampaignResponseBody.md +++ b/docs/LoyaltiesCreateCampaignResponseBody.md @@ -29,6 +29,7 @@ Name | Type | Description | Notes **category** | **str** | Unique category name. | [optional] **creation_status** | **str** | Indicates the status of the campaign creation. | [optional] **vouchers_generation_status** | **str** | Indicates the status of the campaign's voucher generation. | [optional] +**readonly** | **bool** | Indicates whether the campaign can be only read by a restricted user in the Areas and Stores enterprise feature. It is returned only to restricted users; this field is not returned for users with other roles. | [optional] **protected** | **bool** | Indicates whether the resource can be deleted. | [optional] **category_id** | **str** | Unique category ID that this campaign belongs to. | [optional] **categories** | [**List[Category]**](Category.md) | Contains details about the category. | [optional] diff --git a/docs/LoyaltiesGetCampaignResponseBody.md b/docs/LoyaltiesGetCampaignResponseBody.md index 57c4c116..0868c716 100644 --- a/docs/LoyaltiesGetCampaignResponseBody.md +++ b/docs/LoyaltiesGetCampaignResponseBody.md @@ -29,6 +29,7 @@ Name | Type | Description | Notes **category** | **str** | Unique category name. | [optional] **creation_status** | **str** | Indicates the status of the campaign creation. | [optional] **vouchers_generation_status** | **str** | Indicates the status of the campaign's voucher generation. | [optional] +**readonly** | **bool** | Indicates whether the campaign can be only read by a restricted user in the Areas and Stores enterprise feature. It is returned only to restricted users; this field is not returned for users with other roles. | [optional] **protected** | **bool** | Indicates whether the resource can be deleted. | [optional] **category_id** | **str** | Unique category ID that this campaign belongs to. | [optional] **categories** | [**List[Category]**](Category.md) | Contains details about the category. | [optional] diff --git a/docs/LoyaltiesUpdateCampaignResponseBody.md b/docs/LoyaltiesUpdateCampaignResponseBody.md index faa913a7..82269a2d 100644 --- a/docs/LoyaltiesUpdateCampaignResponseBody.md +++ b/docs/LoyaltiesUpdateCampaignResponseBody.md @@ -29,6 +29,7 @@ Name | Type | Description | Notes **category** | **str** | Unique category name. | [optional] **creation_status** | **str** | Indicates the status of the campaign creation. | [optional] **vouchers_generation_status** | **str** | Indicates the status of the campaign's voucher generation. | [optional] +**readonly** | **bool** | Indicates whether the campaign can be only read by a restricted user in the Areas and Stores enterprise feature. It is returned only to restricted users; this field is not returned for users with other roles. | [optional] **protected** | **bool** | Indicates whether the resource can be deleted. | [optional] **category_id** | **str** | Unique category ID that this campaign belongs to. | [optional] **categories** | [**List[Category]**](Category.md) | Contains details about the category. | [optional] diff --git a/docs/LoyaltyCampaign.md b/docs/LoyaltyCampaign.md index 6bb2f3eb..6e32a055 100644 --- a/docs/LoyaltyCampaign.md +++ b/docs/LoyaltyCampaign.md @@ -28,6 +28,7 @@ Name | Type | Description | Notes **category** | **str** | Unique category name. | [optional] **creation_status** | **str** | Indicates the status of the campaign creation. | [optional] **vouchers_generation_status** | **str** | Indicates the status of the campaign's voucher generation. | [optional] +**readonly** | **bool** | Indicates whether the campaign can be only read by a restricted user in the Areas and Stores enterprise feature. It is returned only to restricted users; this field is not returned for users with other roles. | [optional] **protected** | **bool** | Indicates whether the resource can be deleted. | [optional] **category_id** | **str** | Unique category ID that this campaign belongs to. | [optional] **categories** | [**List[Category]**](Category.md) | Contains details about the category. | [optional] diff --git a/docs/ManagementApi.md b/docs/ManagementApi.md new file mode 100644 index 00000000..a20ba6d4 --- /dev/null +++ b/docs/ManagementApi.md @@ -0,0 +1,3189 @@ +# voucherify.ManagementApi + +All URIs are relative to *https://api.voucherify.io* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**assign_user**](ManagementApi.md#assign_user) | **POST** /management/v1/projects/{projectId}/users | Assign User +[**create_brand**](ManagementApi.md#create_brand) | **POST** /management/v1/projects/{projectId}/branding | Create Brand +[**create_custom_event_schema**](ManagementApi.md#create_custom_event_schema) | **POST** /management/v1/projects/{projectId}/custom-event-schemas | Create Custom Event Schema +[**create_metadata_schema**](ManagementApi.md#create_metadata_schema) | **POST** /management/v1/projects/{projectId}/metadata-schemas | Create Metadata Schema +[**create_project**](ManagementApi.md#create_project) | **POST** /management/v1/projects | Create Project +[**create_stacking_rules**](ManagementApi.md#create_stacking_rules) | **POST** /management/v1/projects/{projectId}/stacking-rules | Create Stacking Rules +[**create_webhook**](ManagementApi.md#create_webhook) | **POST** /management/v1/projects/{projectId}/webhooks | Create Webhook +[**delete_brand**](ManagementApi.md#delete_brand) | **DELETE** /management/v1/projects/{projectId}/branding/{brandingId} | Delete Brand +[**delete_custom_event_schema**](ManagementApi.md#delete_custom_event_schema) | **DELETE** /management/v1/projects/{projectId}/custom-event-schemas/{customEventSchemaId} | Delete Custom Event Schema +[**delete_metadata_schema**](ManagementApi.md#delete_metadata_schema) | **DELETE** /management/v1/projects/{projectId}/metadata-schemas/{metadataSchemaId} | Delete Metadata Schema +[**delete_project**](ManagementApi.md#delete_project) | **DELETE** /management/v1/projects/{projectId} | Delete Project +[**delete_stacking_rules**](ManagementApi.md#delete_stacking_rules) | **DELETE** /management/v1/projects/{projectId}/stacking-rules/{stackingRulesId} | Delete Stacking Rules +[**delete_webhook**](ManagementApi.md#delete_webhook) | **DELETE** /management/v1/projects/{projectId}/webhooks/{webhookId} | Delete Webhook +[**get_brand**](ManagementApi.md#get_brand) | **GET** /management/v1/projects/{projectId}/branding/{brandingId} | Get Brand +[**get_custom_event_schema**](ManagementApi.md#get_custom_event_schema) | **GET** /management/v1/projects/{projectId}/custom-event-schemas/{customEventSchemaId} | Get Custom Event Schema +[**get_metadata_schema1**](ManagementApi.md#get_metadata_schema1) | **GET** /management/v1/projects/{projectId}/metadata-schemas/{metadataSchemaId} | Get Metadata Schema +[**get_project**](ManagementApi.md#get_project) | **GET** /management/v1/projects/{projectId} | Get Project +[**get_stacking_rules**](ManagementApi.md#get_stacking_rules) | **GET** /management/v1/projects/{projectId}/stacking-rules/{stackingRulesId} | Get Stacking Rules +[**get_user**](ManagementApi.md#get_user) | **GET** /management/v1/projects/{projectId}/users/{userId} | Get User +[**get_webhook**](ManagementApi.md#get_webhook) | **GET** /management/v1/projects/{projectId}/webhooks/{webhookId} | Get Webhook +[**invite_user**](ManagementApi.md#invite_user) | **POST** /management/v1/projects/users/invite | Invite a New User +[**list_brands**](ManagementApi.md#list_brands) | **GET** /management/v1/projects/{projectId}/branding | List Brands +[**list_custom_event_schemas**](ManagementApi.md#list_custom_event_schemas) | **GET** /management/v1/projects/{projectId}/custom-event-schemas | List Custom Event Schemas +[**list_metadata_schemas1**](ManagementApi.md#list_metadata_schemas1) | **GET** /management/v1/projects/{projectId}/metadata-schemas | List Metadata Schemas +[**list_projects**](ManagementApi.md#list_projects) | **GET** /management/v1/projects | List Projects +[**list_stacking_rules**](ManagementApi.md#list_stacking_rules) | **GET** /management/v1/projects/{projectId}/stacking-rules | List Stacking Rules +[**list_users**](ManagementApi.md#list_users) | **GET** /management/v1/projects/{projectId}/users | List Users +[**list_webhooks**](ManagementApi.md#list_webhooks) | **GET** /management/v1/projects/{projectId}/webhooks | List Webhooks +[**unassign_user**](ManagementApi.md#unassign_user) | **DELETE** /management/v1/projects/{projectId}/users/{userId} | Unassign User +[**update_brand**](ManagementApi.md#update_brand) | **PUT** /management/v1/projects/{projectId}/branding/{brandingId} | Update Brand +[**update_custom_event_schema**](ManagementApi.md#update_custom_event_schema) | **PUT** /management/v1/projects/{projectId}/custom-event-schemas/{customEventSchemaId} | Update Custom Event Schema +[**update_metadata_schema**](ManagementApi.md#update_metadata_schema) | **PUT** /management/v1/projects/{projectId}/metadata-schemas/{metadataSchemaId} | Update Metadata Schema +[**update_project**](ManagementApi.md#update_project) | **PUT** /management/v1/projects/{projectId} | Update Project +[**update_stacking_rules**](ManagementApi.md#update_stacking_rules) | **PUT** /management/v1/projects/{projectId}/stacking-rules/{stackingRulesId} | Update Stacking Rules +[**update_user**](ManagementApi.md#update_user) | **PUT** /management/v1/projects/{projectId}/users/{userId} | Update User +[**update_webhook**](ManagementApi.md#update_webhook) | **PUT** /management/v1/projects/{projectId}/webhooks/{webhookId} | Update Webhook + + +# **assign_user** +> ManagementProjectsUsersAssignResponseBody assign_user(project_id, management_projects_users_assign_request_body=management_projects_users_assign_request_body) + +Assign User + +Assigns a user to a given project. The user must be an existing user in Voucherify. 🚧 Correct Use of Data To avoid errors, use the role key with either id or login keys. + +### Example + +* Api Key Authentication (X-Management-Token): +* Api Key Authentication (X-Management-Id): + +```python +import voucherify +from voucherify.models.management_projects_users_assign_request_body import ManagementProjectsUsersAssignRequestBody +from voucherify.models.management_projects_users_assign_response_body import ManagementProjectsUsersAssignResponseBody +from voucherify.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.voucherify.io +# See configuration.py for a list of all supported configuration parameters. +configuration = voucherify.Configuration( + host = "https://api.voucherify.io" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: X-Management-Token +configuration.api_key['X-Management-Token'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['X-Management-Token'] = 'Bearer' + +# Configure API key authorization: X-Management-Id +configuration.api_key['X-Management-Id'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['X-Management-Id'] = 'Bearer' + +# Enter a context with an instance of the API client +with voucherify.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = voucherify.ManagementApi(api_client) + project_id = 'project_id_example' # str | Provide the unique identifier of the project. + management_projects_users_assign_request_body = voucherify.ManagementProjectsUsersAssignRequestBody() # ManagementProjectsUsersAssignRequestBody | Defines the user details. (optional) + + try: + # Assign User + api_response = api_instance.assign_user(project_id, management_projects_users_assign_request_body=management_projects_users_assign_request_body) + print("The response of ManagementApi->assign_user:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling ManagementApi->assign_user: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **project_id** | **str**| Provide the unique identifier of the project. | + **management_projects_users_assign_request_body** | [**ManagementProjectsUsersAssignRequestBody**](ManagementProjectsUsersAssignRequestBody.md)| Defines the user details. | [optional] + +### Return type + +[**ManagementProjectsUsersAssignResponseBody**](ManagementProjectsUsersAssignResponseBody.md) + +### Authorization + +[X-Management-Token](../README.md#X-Management-Token), [X-Management-Id](../README.md#X-Management-Id) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**2XX** | Returns the details about the user assigned to the project. | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **create_brand** +> ManagementProjectsBrandingCreateResponseBody create_brand(project_id, management_projects_branding_create_request_body=management_projects_branding_create_request_body) + +Create Brand + +Creates a new brand configuration. You can have only one brand configured for a project. 📘 White Labelling The white labelling settings which can be found in Project Settings > Brand Details and which are available only for Enterprise clients as a separate service can be configured only in the user interface. + +### Example + +* Api Key Authentication (X-Management-Token): +* Api Key Authentication (X-Management-Id): + +```python +import voucherify +from voucherify.models.management_projects_branding_create_request_body import ManagementProjectsBrandingCreateRequestBody +from voucherify.models.management_projects_branding_create_response_body import ManagementProjectsBrandingCreateResponseBody +from voucherify.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.voucherify.io +# See configuration.py for a list of all supported configuration parameters. +configuration = voucherify.Configuration( + host = "https://api.voucherify.io" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: X-Management-Token +configuration.api_key['X-Management-Token'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['X-Management-Token'] = 'Bearer' + +# Configure API key authorization: X-Management-Id +configuration.api_key['X-Management-Id'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['X-Management-Id'] = 'Bearer' + +# Enter a context with an instance of the API client +with voucherify.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = voucherify.ManagementApi(api_client) + project_id = 'project_id_example' # str | Provide the unique identifier of the project. + management_projects_branding_create_request_body = {"brand":{"name":"Voucherify PSA","privacy_policy_url":null,"terms_of_use_url":null,"permission_reminder":"You are receiving this email because you opted in at our website.","website_url":"voucherify.io"},"address":{"street":"Porcelanowa 23","city":"Katowice","postal":"43-246","state":null,"country":"Poland"},"contact":{"email":"support@voucherify.io","phone":null},"cockpits":{"campaigns_overview_enabled":false,"loyalty_enabled":true,"gift_cards_enabled":true,"coupons_enabled":true,"referrals_enabled":true,"theme":"default","use_custom_double_opt_in_redirect_url":false,"custom_double_opt_in_redirect_url":null}} # ManagementProjectsBrandingCreateRequestBody | Defines a brand configuration. (optional) + + try: + # Create Brand + api_response = api_instance.create_brand(project_id, management_projects_branding_create_request_body=management_projects_branding_create_request_body) + print("The response of ManagementApi->create_brand:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling ManagementApi->create_brand: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **project_id** | **str**| Provide the unique identifier of the project. | + **management_projects_branding_create_request_body** | [**ManagementProjectsBrandingCreateRequestBody**](ManagementProjectsBrandingCreateRequestBody.md)| Defines a brand configuration. | [optional] + +### Return type + +[**ManagementProjectsBrandingCreateResponseBody**](ManagementProjectsBrandingCreateResponseBody.md) + +### Authorization + +[X-Management-Token](../README.md#X-Management-Token), [X-Management-Id](../README.md#X-Management-Id) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**2XX** | Returns the details about the brand configuration. | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **create_custom_event_schema** +> ManagementProjectsCustomEventSchemasCreateResponseBody create_custom_event_schema(project_id, management_projects_custom_event_schemas_create_request_body=management_projects_custom_event_schemas_create_request_body) + +Create Custom Event Schema + +Creates a custom event schema. The properties object is required, but it can be empty, however. This object is for optional custom properties (metadata). 📘 Custom Event Documentation Read [Custom Events](https://support.voucherify.io/article/111-custom-events) article to learn how custom events work in Voucherify. Read also the details about the Track Custom Event endpoint and the Custom Event Object. + +### Example + +* Api Key Authentication (X-Management-Token): +* Api Key Authentication (X-Management-Id): + +```python +import voucherify +from voucherify.models.management_projects_custom_event_schemas_create_request_body import ManagementProjectsCustomEventSchemasCreateRequestBody +from voucherify.models.management_projects_custom_event_schemas_create_response_body import ManagementProjectsCustomEventSchemasCreateResponseBody +from voucherify.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.voucherify.io +# See configuration.py for a list of all supported configuration parameters. +configuration = voucherify.Configuration( + host = "https://api.voucherify.io" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: X-Management-Token +configuration.api_key['X-Management-Token'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['X-Management-Token'] = 'Bearer' + +# Configure API key authorization: X-Management-Id +configuration.api_key['X-Management-Id'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['X-Management-Id'] = 'Bearer' + +# Enter a context with an instance of the API client +with voucherify.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = voucherify.ManagementApi(api_client) + project_id = 'project_id_example' # str | Provide the unique identifier of the project. + management_projects_custom_event_schemas_create_request_body = voucherify.ManagementProjectsCustomEventSchemasCreateRequestBody() # ManagementProjectsCustomEventSchemasCreateRequestBody | Defines the custom event schema. (optional) + + try: + # Create Custom Event Schema + api_response = api_instance.create_custom_event_schema(project_id, management_projects_custom_event_schemas_create_request_body=management_projects_custom_event_schemas_create_request_body) + print("The response of ManagementApi->create_custom_event_schema:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling ManagementApi->create_custom_event_schema: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **project_id** | **str**| Provide the unique identifier of the project. | + **management_projects_custom_event_schemas_create_request_body** | [**ManagementProjectsCustomEventSchemasCreateRequestBody**](ManagementProjectsCustomEventSchemasCreateRequestBody.md)| Defines the custom event schema. | [optional] + +### Return type + +[**ManagementProjectsCustomEventSchemasCreateResponseBody**](ManagementProjectsCustomEventSchemasCreateResponseBody.md) + +### Authorization + +[X-Management-Token](../README.md#X-Management-Token), [X-Management-Id](../README.md#X-Management-Id) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**2XX** | Returns the details about the custom event schema. | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **create_metadata_schema** +> ManagementProjectsMetadataSchemasCreateResponseBody create_metadata_schema(project_id, management_projects_metadata_schemas_create_request_body=management_projects_metadata_schemas_create_request_body) + +Create Metadata Schema + +Creates a new metadata (custom attribute) schema. The schema consists of a set of key-value pairs to customize Voucherify resources. You can nest your object within a standard metadata schema, e.g. within a campaign or customer schema. However, your nested object cannot include another nested object. The standard metadata schemas are: - Campaign - Voucher - Publication - Redemption - Product - Customer - Order - Order line item - Loyalty Tier - Promotion Tier - Earning rule - Reward 📘 Metadata Documentation Read the Getting Started with Metadata articles to learn how metadata work in Voucherify. + +### Example + +* Api Key Authentication (X-Management-Token): +* Api Key Authentication (X-Management-Id): + +```python +import voucherify +from voucherify.models.management_projects_metadata_schemas_create_request_body import ManagementProjectsMetadataSchemasCreateRequestBody +from voucherify.models.management_projects_metadata_schemas_create_response_body import ManagementProjectsMetadataSchemasCreateResponseBody +from voucherify.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.voucherify.io +# See configuration.py for a list of all supported configuration parameters. +configuration = voucherify.Configuration( + host = "https://api.voucherify.io" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: X-Management-Token +configuration.api_key['X-Management-Token'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['X-Management-Token'] = 'Bearer' + +# Configure API key authorization: X-Management-Id +configuration.api_key['X-Management-Id'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['X-Management-Id'] = 'Bearer' + +# Enter a context with an instance of the API client +with voucherify.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = voucherify.ManagementApi(api_client) + project_id = 'project_id_example' # str | Provide the unique identifier of the project. + management_projects_metadata_schemas_create_request_body = voucherify.ManagementProjectsMetadataSchemasCreateRequestBody() # ManagementProjectsMetadataSchemasCreateRequestBody | Defines the metadata schema. (optional) + + try: + # Create Metadata Schema + api_response = api_instance.create_metadata_schema(project_id, management_projects_metadata_schemas_create_request_body=management_projects_metadata_schemas_create_request_body) + print("The response of ManagementApi->create_metadata_schema:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling ManagementApi->create_metadata_schema: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **project_id** | **str**| Provide the unique identifier of the project. | + **management_projects_metadata_schemas_create_request_body** | [**ManagementProjectsMetadataSchemasCreateRequestBody**](ManagementProjectsMetadataSchemasCreateRequestBody.md)| Defines the metadata schema. | [optional] + +### Return type + +[**ManagementProjectsMetadataSchemasCreateResponseBody**](ManagementProjectsMetadataSchemasCreateResponseBody.md) + +### Authorization + +[X-Management-Token](../README.md#X-Management-Token), [X-Management-Id](../README.md#X-Management-Id) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**2XX** | Returns the details about the metadata schema. | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **create_project** +> ManagementProjectsCreateResponseBody create_project(management_projects_create_request_body=management_projects_create_request_body) + +Create Project + +Creates a new project. You can add users, specify the cluster, timezone, currency, and other details. All owners are added to the project by default. + +### Example + +* Api Key Authentication (X-Management-Token): +* Api Key Authentication (X-Management-Id): + +```python +import voucherify +from voucherify.models.management_projects_create_request_body import ManagementProjectsCreateRequestBody +from voucherify.models.management_projects_create_response_body import ManagementProjectsCreateResponseBody +from voucherify.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.voucherify.io +# See configuration.py for a list of all supported configuration parameters. +configuration = voucherify.Configuration( + host = "https://api.voucherify.io" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: X-Management-Token +configuration.api_key['X-Management-Token'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['X-Management-Token'] = 'Bearer' + +# Configure API key authorization: X-Management-Id +configuration.api_key['X-Management-Id'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['X-Management-Id'] = 'Bearer' + +# Enter a context with an instance of the API client +with voucherify.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = voucherify.ManagementApi(api_client) + management_projects_create_request_body = voucherify.ManagementProjectsCreateRequestBody() # ManagementProjectsCreateRequestBody | Define project details. (optional) + + try: + # Create Project + api_response = api_instance.create_project(management_projects_create_request_body=management_projects_create_request_body) + print("The response of ManagementApi->create_project:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling ManagementApi->create_project: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **management_projects_create_request_body** | [**ManagementProjectsCreateRequestBody**](ManagementProjectsCreateRequestBody.md)| Define project details. | [optional] + +### Return type + +[**ManagementProjectsCreateResponseBody**](ManagementProjectsCreateResponseBody.md) + +### Authorization + +[X-Management-Token](../README.md#X-Management-Token), [X-Management-Id](../README.md#X-Management-Id) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**2XX** | Returns the details of a created project. | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **create_stacking_rules** +> ManagementProjectsStackingRulesCreateResponseBody create_stacking_rules(project_id, management_projects_stacking_rules_create_request_body=management_projects_stacking_rules_create_request_body) + +Create Stacking Rules + +Overwrites the default stacking rules. If new stacking rules have been created for the project earlier (e.g. in the user interface), it returns an error. Use Update Stacking Rules endpoint to change the rules. 📘 Stacking Rules Documentation Read [the Stacking Rules article](https://support.voucherify.io/article/604-stacking-rules) to learn how they work. + +### Example + +* Api Key Authentication (X-Management-Token): +* Api Key Authentication (X-Management-Id): + +```python +import voucherify +from voucherify.models.management_projects_stacking_rules_create_request_body import ManagementProjectsStackingRulesCreateRequestBody +from voucherify.models.management_projects_stacking_rules_create_response_body import ManagementProjectsStackingRulesCreateResponseBody +from voucherify.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.voucherify.io +# See configuration.py for a list of all supported configuration parameters. +configuration = voucherify.Configuration( + host = "https://api.voucherify.io" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: X-Management-Token +configuration.api_key['X-Management-Token'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['X-Management-Token'] = 'Bearer' + +# Configure API key authorization: X-Management-Id +configuration.api_key['X-Management-Id'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['X-Management-Id'] = 'Bearer' + +# Enter a context with an instance of the API client +with voucherify.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = voucherify.ManagementApi(api_client) + project_id = 'project_id_example' # str | Provide the unique identifier of the project. + management_projects_stacking_rules_create_request_body = voucherify.ManagementProjectsStackingRulesCreateRequestBody() # ManagementProjectsStackingRulesCreateRequestBody | Defines the stacking rule parameters. (optional) + + try: + # Create Stacking Rules + api_response = api_instance.create_stacking_rules(project_id, management_projects_stacking_rules_create_request_body=management_projects_stacking_rules_create_request_body) + print("The response of ManagementApi->create_stacking_rules:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling ManagementApi->create_stacking_rules: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **project_id** | **str**| Provide the unique identifier of the project. | + **management_projects_stacking_rules_create_request_body** | [**ManagementProjectsStackingRulesCreateRequestBody**](ManagementProjectsStackingRulesCreateRequestBody.md)| Defines the stacking rule parameters. | [optional] + +### Return type + +[**ManagementProjectsStackingRulesCreateResponseBody**](ManagementProjectsStackingRulesCreateResponseBody.md) + +### Authorization + +[X-Management-Token](../README.md#X-Management-Token), [X-Management-Id](../README.md#X-Management-Id) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**2XX** | Returns the details about the stacking rules assigned to the project. | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **create_webhook** +> ManagementProjectsWebhooksCreateResponseBody create_webhook(project_id, management_projects_webhooks_create_request_body=management_projects_webhooks_create_request_body) + +Create Webhook + +Creates a new webhook configuration. 📘 Webhook Documentation Read Webhooks v2024-01-01 article to learn how webhooks work in Voucherify. + +### Example + +* Api Key Authentication (X-Management-Token): +* Api Key Authentication (X-Management-Id): + +```python +import voucherify +from voucherify.models.management_projects_webhooks_create_request_body import ManagementProjectsWebhooksCreateRequestBody +from voucherify.models.management_projects_webhooks_create_response_body import ManagementProjectsWebhooksCreateResponseBody +from voucherify.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.voucherify.io +# See configuration.py for a list of all supported configuration parameters. +configuration = voucherify.Configuration( + host = "https://api.voucherify.io" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: X-Management-Token +configuration.api_key['X-Management-Token'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['X-Management-Token'] = 'Bearer' + +# Configure API key authorization: X-Management-Id +configuration.api_key['X-Management-Id'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['X-Management-Id'] = 'Bearer' + +# Enter a context with an instance of the API client +with voucherify.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = voucherify.ManagementApi(api_client) + project_id = 'project_id_example' # str | Provide the unique identifier of the project. + management_projects_webhooks_create_request_body = voucherify.ManagementProjectsWebhooksCreateRequestBody() # ManagementProjectsWebhooksCreateRequestBody | Defines a webhook configuration. (optional) + + try: + # Create Webhook + api_response = api_instance.create_webhook(project_id, management_projects_webhooks_create_request_body=management_projects_webhooks_create_request_body) + print("The response of ManagementApi->create_webhook:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling ManagementApi->create_webhook: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **project_id** | **str**| Provide the unique identifier of the project. | + **management_projects_webhooks_create_request_body** | [**ManagementProjectsWebhooksCreateRequestBody**](ManagementProjectsWebhooksCreateRequestBody.md)| Defines a webhook configuration. | [optional] + +### Return type + +[**ManagementProjectsWebhooksCreateResponseBody**](ManagementProjectsWebhooksCreateResponseBody.md) + +### Authorization + +[X-Management-Token](../README.md#X-Management-Token), [X-Management-Id](../README.md#X-Management-Id) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**2XX** | Returns the details about the webhook configuration. | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **delete_brand** +> delete_brand(project_id, branding_id) + +Delete Brand + +Deletes permanently a brand configuration. + +### Example + +* Api Key Authentication (X-Management-Token): +* Api Key Authentication (X-Management-Id): + +```python +import voucherify +from voucherify.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.voucherify.io +# See configuration.py for a list of all supported configuration parameters. +configuration = voucherify.Configuration( + host = "https://api.voucherify.io" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: X-Management-Token +configuration.api_key['X-Management-Token'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['X-Management-Token'] = 'Bearer' + +# Configure API key authorization: X-Management-Id +configuration.api_key['X-Management-Id'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['X-Management-Id'] = 'Bearer' + +# Enter a context with an instance of the API client +with voucherify.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = voucherify.ManagementApi(api_client) + project_id = 'project_id_example' # str | Provide the unique identifier of the project. + branding_id = 'branding_id_example' # str | Provide the unique identifier of the brand configuration. + + try: + # Delete Brand + api_instance.delete_brand(project_id, branding_id) + except Exception as e: + print("Exception when calling ManagementApi->delete_brand: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **project_id** | **str**| Provide the unique identifier of the project. | + **branding_id** | **str**| Provide the unique identifier of the brand configuration. | + +### Return type + +void (empty response body) + +### Authorization + +[X-Management-Token](../README.md#X-Management-Token), [X-Management-Id](../README.md#X-Management-Id) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**2XX** | Returns no content if the brand configuration has been successfully deleted. | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **delete_custom_event_schema** +> delete_custom_event_schema(project_id, custom_event_schema_id) + +Delete Custom Event Schema + +Deletes permanently the custom event schema with its custom properties (metadata). 📘 Custom Event Documentation Read [Custom Events](https://support.voucherify.io/article/111-custom-events) article to learn how custom events work in Voucherify. Read also the details about the Track Custom Event endpoint and the Custom Event Object. + +### Example + +* Api Key Authentication (X-Management-Token): +* Api Key Authentication (X-Management-Id): + +```python +import voucherify +from voucherify.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.voucherify.io +# See configuration.py for a list of all supported configuration parameters. +configuration = voucherify.Configuration( + host = "https://api.voucherify.io" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: X-Management-Token +configuration.api_key['X-Management-Token'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['X-Management-Token'] = 'Bearer' + +# Configure API key authorization: X-Management-Id +configuration.api_key['X-Management-Id'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['X-Management-Id'] = 'Bearer' + +# Enter a context with an instance of the API client +with voucherify.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = voucherify.ManagementApi(api_client) + project_id = 'project_id_example' # str | Provide the unique identifier of the project. + custom_event_schema_id = 'custom_event_schema_id_example' # str | Provide the unique identifier of the custom event schema. + + try: + # Delete Custom Event Schema + api_instance.delete_custom_event_schema(project_id, custom_event_schema_id) + except Exception as e: + print("Exception when calling ManagementApi->delete_custom_event_schema: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **project_id** | **str**| Provide the unique identifier of the project. | + **custom_event_schema_id** | **str**| Provide the unique identifier of the custom event schema. | + +### Return type + +void (empty response body) + +### Authorization + +[X-Management-Token](../README.md#X-Management-Token), [X-Management-Id](../README.md#X-Management-Id) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**2XX** | Returns no content if the custom event schema has been successfully deleted. | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **delete_metadata_schema** +> delete_metadata_schema(project_id, metadata_schema_id) + +Delete Metadata Schema + +Deletes permanently the metadata schema. In standard metadata schemas, this endpoint removes permanently all definitions. The standard metadata schemas are: - Campaign - Voucher - Publication - Redemption - Product - Customer - Order - Order line item - Loyalty Tier - Promotion Tier - Earning rule - Reward If you want to delete only one definition, use the Update Metadata Schema endpoint. In the request, provide the deleted: true pair in the definition object. This definition will be moved to Removed definitions. If you want to create a new standard metadata schema, use the Create Metadata Schema endpoint. 🚧 Metadata Purging This endpoint deletes permanently the metadata schemas only. However, it does not purge the metadata from associated entities, so the metadata added to those entities will remain. If you want to purge metadata from the entities: 1. Remove all the definitions you want to purge. You can do this either in Voucherify Project Settings > Metadata Schema tab or with the Update Metadata Schema endpoint. 2. In Voucherify Project Settings > Metadata Schema tab, go to the relevant metadata schema. 3. In Removed definitions, click the bin button next to the definitions whose metadata you want to purge from entities. Note: - This is an asynchronous action. You will be notified when it has been completed. - You cannot purge metadata for the Redemption and Publication schemas. 4. Use the Delete Metadata Schema request to delete the metadata schema from Voucherify. 📘 Metadata Documentation Read the Getting Started with Metadata articles to learn how metadata work in Voucherify. + +### Example + +* Api Key Authentication (X-Management-Token): +* Api Key Authentication (X-Management-Id): + +```python +import voucherify +from voucherify.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.voucherify.io +# See configuration.py for a list of all supported configuration parameters. +configuration = voucherify.Configuration( + host = "https://api.voucherify.io" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: X-Management-Token +configuration.api_key['X-Management-Token'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['X-Management-Token'] = 'Bearer' + +# Configure API key authorization: X-Management-Id +configuration.api_key['X-Management-Id'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['X-Management-Id'] = 'Bearer' + +# Enter a context with an instance of the API client +with voucherify.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = voucherify.ManagementApi(api_client) + project_id = 'project_id_example' # str | Provide the unique identifier of the project. + metadata_schema_id = 'metadata_schema_id_example' # str | Provide the unique identifier of the metadata schema. + + try: + # Delete Metadata Schema + api_instance.delete_metadata_schema(project_id, metadata_schema_id) + except Exception as e: + print("Exception when calling ManagementApi->delete_metadata_schema: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **project_id** | **str**| Provide the unique identifier of the project. | + **metadata_schema_id** | **str**| Provide the unique identifier of the metadata schema. | + +### Return type + +void (empty response body) + +### Authorization + +[X-Management-Token](../README.md#X-Management-Token), [X-Management-Id](../README.md#X-Management-Id) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**2XX** | Returns no content if the metadata schema has been successfully deleted. | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **delete_project** +> delete_project(project_id) + +Delete Project + +Deletes an existing project. The users currently using the deleted project will be automatically logged out. 🚧 Sandbox Project The sandbox project cannot be deleted. + +### Example + +* Api Key Authentication (X-Management-Token): +* Api Key Authentication (X-Management-Id): + +```python +import voucherify +from voucherify.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.voucherify.io +# See configuration.py for a list of all supported configuration parameters. +configuration = voucherify.Configuration( + host = "https://api.voucherify.io" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: X-Management-Token +configuration.api_key['X-Management-Token'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['X-Management-Token'] = 'Bearer' + +# Configure API key authorization: X-Management-Id +configuration.api_key['X-Management-Id'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['X-Management-Id'] = 'Bearer' + +# Enter a context with an instance of the API client +with voucherify.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = voucherify.ManagementApi(api_client) + project_id = 'project_id_example' # str | Provide the unique identifier of the project. + + try: + # Delete Project + api_instance.delete_project(project_id) + except Exception as e: + print("Exception when calling ManagementApi->delete_project: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **project_id** | **str**| Provide the unique identifier of the project. | + +### Return type + +void (empty response body) + +### Authorization + +[X-Management-Token](../README.md#X-Management-Token), [X-Management-Id](../README.md#X-Management-Id) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**2XX** | Returns no content if deletion is successful. | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **delete_stacking_rules** +> delete_stacking_rules(project_id, stacking_rules_id) + +Delete Stacking Rules + +Deletes permanently the current settings for the stacking rules. The stacking rules are restored to default values. 📘 Stacking Rules Documentation Read [the Stacking Rules article](https://support.voucherify.io/article/604-stacking-rules) to learn how they work. + +### Example + +* Api Key Authentication (X-Management-Token): +* Api Key Authentication (X-Management-Id): + +```python +import voucherify +from voucherify.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.voucherify.io +# See configuration.py for a list of all supported configuration parameters. +configuration = voucherify.Configuration( + host = "https://api.voucherify.io" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: X-Management-Token +configuration.api_key['X-Management-Token'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['X-Management-Token'] = 'Bearer' + +# Configure API key authorization: X-Management-Id +configuration.api_key['X-Management-Id'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['X-Management-Id'] = 'Bearer' + +# Enter a context with an instance of the API client +with voucherify.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = voucherify.ManagementApi(api_client) + project_id = 'project_id_example' # str | Provide the unique identifier of the project. + stacking_rules_id = 'stacking_rules_id_example' # str | Provide the unique identifier of the stacking rules. + + try: + # Delete Stacking Rules + api_instance.delete_stacking_rules(project_id, stacking_rules_id) + except Exception as e: + print("Exception when calling ManagementApi->delete_stacking_rules: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **project_id** | **str**| Provide the unique identifier of the project. | + **stacking_rules_id** | **str**| Provide the unique identifier of the stacking rules. | + +### Return type + +void (empty response body) + +### Authorization + +[X-Management-Token](../README.md#X-Management-Token), [X-Management-Id](../README.md#X-Management-Id) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**2XX** | Returns no content if the stacking rules have been successfully deleted. | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **delete_webhook** +> delete_webhook(project_id, webhook_id) + +Delete Webhook + +Deletes a webhook configuration. 📘 Webhook Documentation Read Webhooks v2024-01-1 article to learn how webhooks work in Voucherify. + +### Example + +* Api Key Authentication (X-Management-Token): +* Api Key Authentication (X-Management-Id): + +```python +import voucherify +from voucherify.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.voucherify.io +# See configuration.py for a list of all supported configuration parameters. +configuration = voucherify.Configuration( + host = "https://api.voucherify.io" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: X-Management-Token +configuration.api_key['X-Management-Token'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['X-Management-Token'] = 'Bearer' + +# Configure API key authorization: X-Management-Id +configuration.api_key['X-Management-Id'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['X-Management-Id'] = 'Bearer' + +# Enter a context with an instance of the API client +with voucherify.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = voucherify.ManagementApi(api_client) + project_id = 'project_id_example' # str | Provide the unique identifier of the project. + webhook_id = 'webhook_id_example' # str | Provide the unique identifier of the webhook configuration. + + try: + # Delete Webhook + api_instance.delete_webhook(project_id, webhook_id) + except Exception as e: + print("Exception when calling ManagementApi->delete_webhook: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **project_id** | **str**| Provide the unique identifier of the project. | + **webhook_id** | **str**| Provide the unique identifier of the webhook configuration. | + +### Return type + +void (empty response body) + +### Authorization + +[X-Management-Token](../README.md#X-Management-Token), [X-Management-Id](../README.md#X-Management-Id) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**2XX** | Returns no content if the webhook configuration has been successfully deleted. | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **get_brand** +> ManagementProjectsBrandingGetResponseBody get_brand(project_id, branding_id) + +Get Brand + +Retrieves a brand configuration. + +### Example + +* Api Key Authentication (X-Management-Token): +* Api Key Authentication (X-Management-Id): + +```python +import voucherify +from voucherify.models.management_projects_branding_get_response_body import ManagementProjectsBrandingGetResponseBody +from voucherify.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.voucherify.io +# See configuration.py for a list of all supported configuration parameters. +configuration = voucherify.Configuration( + host = "https://api.voucherify.io" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: X-Management-Token +configuration.api_key['X-Management-Token'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['X-Management-Token'] = 'Bearer' + +# Configure API key authorization: X-Management-Id +configuration.api_key['X-Management-Id'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['X-Management-Id'] = 'Bearer' + +# Enter a context with an instance of the API client +with voucherify.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = voucherify.ManagementApi(api_client) + project_id = 'project_id_example' # str | Provide the unique identifier of the project. + branding_id = 'branding_id_example' # str | Provide the unique identifier of the brand configuration. + + try: + # Get Brand + api_response = api_instance.get_brand(project_id, branding_id) + print("The response of ManagementApi->get_brand:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling ManagementApi->get_brand: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **project_id** | **str**| Provide the unique identifier of the project. | + **branding_id** | **str**| Provide the unique identifier of the brand configuration. | + +### Return type + +[**ManagementProjectsBrandingGetResponseBody**](ManagementProjectsBrandingGetResponseBody.md) + +### Authorization + +[X-Management-Token](../README.md#X-Management-Token), [X-Management-Id](../README.md#X-Management-Id) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**2XX** | Returns the brand configuration. | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **get_custom_event_schema** +> ManagementProjectsCustomEventSchemasGetResponseBody get_custom_event_schema(project_id, custom_event_schema_id) + +Get Custom Event Schema + +Retrieves a custom event schema. 📘 Custom Event Documentation Read [Custom Events](https://support.voucherify.io/article/111-custom-events) article to learn how custom events work in Voucherify. Read also the details about the Track Custom Event endpoint and the Custom Event Object. + +### Example + +* Api Key Authentication (X-Management-Token): +* Api Key Authentication (X-Management-Id): + +```python +import voucherify +from voucherify.models.management_projects_custom_event_schemas_get_response_body import ManagementProjectsCustomEventSchemasGetResponseBody +from voucherify.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.voucherify.io +# See configuration.py for a list of all supported configuration parameters. +configuration = voucherify.Configuration( + host = "https://api.voucherify.io" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: X-Management-Token +configuration.api_key['X-Management-Token'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['X-Management-Token'] = 'Bearer' + +# Configure API key authorization: X-Management-Id +configuration.api_key['X-Management-Id'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['X-Management-Id'] = 'Bearer' + +# Enter a context with an instance of the API client +with voucherify.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = voucherify.ManagementApi(api_client) + project_id = 'project_id_example' # str | Provide the unique identifier of the project. + custom_event_schema_id = 'custom_event_schema_id_example' # str | Provide the unique identifier of the custom event schema. + + try: + # Get Custom Event Schema + api_response = api_instance.get_custom_event_schema(project_id, custom_event_schema_id) + print("The response of ManagementApi->get_custom_event_schema:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling ManagementApi->get_custom_event_schema: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **project_id** | **str**| Provide the unique identifier of the project. | + **custom_event_schema_id** | **str**| Provide the unique identifier of the custom event schema. | + +### Return type + +[**ManagementProjectsCustomEventSchemasGetResponseBody**](ManagementProjectsCustomEventSchemasGetResponseBody.md) + +### Authorization + +[X-Management-Token](../README.md#X-Management-Token), [X-Management-Id](../README.md#X-Management-Id) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**2XX** | Returns the custom event schema. | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **get_metadata_schema1** +> ManagementProjectsMetadataSchemasGetResponseBody get_metadata_schema1(project_id, metadata_schema_id) + +Get Metadata Schema + +Retrieves a metadata schema. 📘 Metadata Documentation Read the Getting Started with Metadata articles to learn how metadata work in Voucherify. + +### Example + +* Api Key Authentication (X-Management-Token): +* Api Key Authentication (X-Management-Id): + +```python +import voucherify +from voucherify.models.management_projects_metadata_schemas_get_response_body import ManagementProjectsMetadataSchemasGetResponseBody +from voucherify.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.voucherify.io +# See configuration.py for a list of all supported configuration parameters. +configuration = voucherify.Configuration( + host = "https://api.voucherify.io" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: X-Management-Token +configuration.api_key['X-Management-Token'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['X-Management-Token'] = 'Bearer' + +# Configure API key authorization: X-Management-Id +configuration.api_key['X-Management-Id'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['X-Management-Id'] = 'Bearer' + +# Enter a context with an instance of the API client +with voucherify.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = voucherify.ManagementApi(api_client) + project_id = 'project_id_example' # str | Provide the unique identifier of the project. + metadata_schema_id = 'metadata_schema_id_example' # str | Provide the unique identifier of the metadata schema. + + try: + # Get Metadata Schema + api_response = api_instance.get_metadata_schema1(project_id, metadata_schema_id) + print("The response of ManagementApi->get_metadata_schema1:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling ManagementApi->get_metadata_schema1: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **project_id** | **str**| Provide the unique identifier of the project. | + **metadata_schema_id** | **str**| Provide the unique identifier of the metadata schema. | + +### Return type + +[**ManagementProjectsMetadataSchemasGetResponseBody**](ManagementProjectsMetadataSchemasGetResponseBody.md) + +### Authorization + +[X-Management-Token](../README.md#X-Management-Token), [X-Management-Id](../README.md#X-Management-Id) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**2XX** | Returns the metadata schema. | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **get_project** +> ManagementProjectsGetResponseBody get_project(project_id) + +Get Project + +Retrieves an existing project. + +### Example + +* Api Key Authentication (X-Management-Token): +* Api Key Authentication (X-Management-Id): + +```python +import voucherify +from voucherify.models.management_projects_get_response_body import ManagementProjectsGetResponseBody +from voucherify.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.voucherify.io +# See configuration.py for a list of all supported configuration parameters. +configuration = voucherify.Configuration( + host = "https://api.voucherify.io" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: X-Management-Token +configuration.api_key['X-Management-Token'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['X-Management-Token'] = 'Bearer' + +# Configure API key authorization: X-Management-Id +configuration.api_key['X-Management-Id'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['X-Management-Id'] = 'Bearer' + +# Enter a context with an instance of the API client +with voucherify.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = voucherify.ManagementApi(api_client) + project_id = 'project_id_example' # str | Provide the unique identifier of the project. + + try: + # Get Project + api_response = api_instance.get_project(project_id) + print("The response of ManagementApi->get_project:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling ManagementApi->get_project: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **project_id** | **str**| Provide the unique identifier of the project. | + +### Return type + +[**ManagementProjectsGetResponseBody**](ManagementProjectsGetResponseBody.md) + +### Authorization + +[X-Management-Token](../README.md#X-Management-Token), [X-Management-Id](../README.md#X-Management-Id) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**2XX** | Returns the details of a project. | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **get_stacking_rules** +> ManagementProjectsStackingRulesGetResponseBody get_stacking_rules(project_id, stacking_rules_id) + +Get Stacking Rules + +Retrieves the stacking rules for the project. 📘 Stacking Rules Documentation Read [the Stacking Rules article](https://support.voucherify.io/article/604-stacking-rules) to learn how they work. + +### Example + +* Api Key Authentication (X-Management-Token): +* Api Key Authentication (X-Management-Id): + +```python +import voucherify +from voucherify.models.management_projects_stacking_rules_get_response_body import ManagementProjectsStackingRulesGetResponseBody +from voucherify.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.voucherify.io +# See configuration.py for a list of all supported configuration parameters. +configuration = voucherify.Configuration( + host = "https://api.voucherify.io" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: X-Management-Token +configuration.api_key['X-Management-Token'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['X-Management-Token'] = 'Bearer' + +# Configure API key authorization: X-Management-Id +configuration.api_key['X-Management-Id'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['X-Management-Id'] = 'Bearer' + +# Enter a context with an instance of the API client +with voucherify.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = voucherify.ManagementApi(api_client) + project_id = 'project_id_example' # str | Provide the unique identifier of the project. + stacking_rules_id = 'stacking_rules_id_example' # str | Provide the unique identifier of the stacking rules. + + try: + # Get Stacking Rules + api_response = api_instance.get_stacking_rules(project_id, stacking_rules_id) + print("The response of ManagementApi->get_stacking_rules:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling ManagementApi->get_stacking_rules: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **project_id** | **str**| Provide the unique identifier of the project. | + **stacking_rules_id** | **str**| Provide the unique identifier of the stacking rules. | + +### Return type + +[**ManagementProjectsStackingRulesGetResponseBody**](ManagementProjectsStackingRulesGetResponseBody.md) + +### Authorization + +[X-Management-Token](../README.md#X-Management-Token), [X-Management-Id](../README.md#X-Management-Id) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**2XX** | Returns the stacking rules for the project. | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **get_user** +> ManagementProjectsUsersGetUserResponseBody get_user(project_id, user_id) + +Get User + +Retrieves the project users details. + +### Example + +* Api Key Authentication (X-Management-Token): +* Api Key Authentication (X-Management-Id): + +```python +import voucherify +from voucherify.models.management_projects_users_get_user_response_body import ManagementProjectsUsersGetUserResponseBody +from voucherify.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.voucherify.io +# See configuration.py for a list of all supported configuration parameters. +configuration = voucherify.Configuration( + host = "https://api.voucherify.io" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: X-Management-Token +configuration.api_key['X-Management-Token'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['X-Management-Token'] = 'Bearer' + +# Configure API key authorization: X-Management-Id +configuration.api_key['X-Management-Id'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['X-Management-Id'] = 'Bearer' + +# Enter a context with an instance of the API client +with voucherify.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = voucherify.ManagementApi(api_client) + project_id = 'project_id_example' # str | Provide the unique identifier of the project. + user_id = 'user_id_example' # str | Provide the unique identifier of the user. Alternatively, provide the users login. + + try: + # Get User + api_response = api_instance.get_user(project_id, user_id) + print("The response of ManagementApi->get_user:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling ManagementApi->get_user: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **project_id** | **str**| Provide the unique identifier of the project. | + **user_id** | **str**| Provide the unique identifier of the user. Alternatively, provide the users login. | + +### Return type + +[**ManagementProjectsUsersGetUserResponseBody**](ManagementProjectsUsersGetUserResponseBody.md) + +### Authorization + +[X-Management-Token](../README.md#X-Management-Token), [X-Management-Id](../README.md#X-Management-Id) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**2XX** | Returns the project user's details. | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **get_webhook** +> ManagementProjectsWebhooksGetResponseBody get_webhook(project_id, webhook_id) + +Get Webhook + +Retrieves a webhook configuration. 📘 Webhook Documentation Read Webhooks v2024-01-1 article to learn how webhooks work in Voucherify. + +### Example + +* Api Key Authentication (X-Management-Token): +* Api Key Authentication (X-Management-Id): + +```python +import voucherify +from voucherify.models.management_projects_webhooks_get_response_body import ManagementProjectsWebhooksGetResponseBody +from voucherify.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.voucherify.io +# See configuration.py for a list of all supported configuration parameters. +configuration = voucherify.Configuration( + host = "https://api.voucherify.io" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: X-Management-Token +configuration.api_key['X-Management-Token'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['X-Management-Token'] = 'Bearer' + +# Configure API key authorization: X-Management-Id +configuration.api_key['X-Management-Id'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['X-Management-Id'] = 'Bearer' + +# Enter a context with an instance of the API client +with voucherify.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = voucherify.ManagementApi(api_client) + project_id = 'project_id_example' # str | Provide the unique identifier of the project. + webhook_id = 'webhook_id_example' # str | Provide the unique identifier of the webhook configuration. + + try: + # Get Webhook + api_response = api_instance.get_webhook(project_id, webhook_id) + print("The response of ManagementApi->get_webhook:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling ManagementApi->get_webhook: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **project_id** | **str**| Provide the unique identifier of the project. | + **webhook_id** | **str**| Provide the unique identifier of the webhook configuration. | + +### Return type + +[**ManagementProjectsWebhooksGetResponseBody**](ManagementProjectsWebhooksGetResponseBody.md) + +### Authorization + +[X-Management-Token](../README.md#X-Management-Token), [X-Management-Id](../README.md#X-Management-Id) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**2XX** | Returns the webhook configuration. | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **invite_user** +> invite_user(management_projects_users_invite_create_request_body=management_projects_users_invite_create_request_body) + +Invite a New User + +Sends an invitation to an email address that has not been used yet as a Voucherify user login. You can specify the projects to which the invited user will be assigned and define their roles. + +### Example + +* Api Key Authentication (X-Management-Token): +* Api Key Authentication (X-Management-Id): + +```python +import voucherify +from voucherify.models.management_projects_users_invite_create_request_body import ManagementProjectsUsersInviteCreateRequestBody +from voucherify.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.voucherify.io +# See configuration.py for a list of all supported configuration parameters. +configuration = voucherify.Configuration( + host = "https://api.voucherify.io" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: X-Management-Token +configuration.api_key['X-Management-Token'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['X-Management-Token'] = 'Bearer' + +# Configure API key authorization: X-Management-Id +configuration.api_key['X-Management-Id'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['X-Management-Id'] = 'Bearer' + +# Enter a context with an instance of the API client +with voucherify.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = voucherify.ManagementApi(api_client) + management_projects_users_invite_create_request_body = voucherify.ManagementProjectsUsersInviteCreateRequestBody() # ManagementProjectsUsersInviteCreateRequestBody | Defines the details of the invitation, the project, and roles to which the user will be assigned. (optional) + + try: + # Invite a New User + api_instance.invite_user(management_projects_users_invite_create_request_body=management_projects_users_invite_create_request_body) + except Exception as e: + print("Exception when calling ManagementApi->invite_user: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **management_projects_users_invite_create_request_body** | [**ManagementProjectsUsersInviteCreateRequestBody**](ManagementProjectsUsersInviteCreateRequestBody.md)| Defines the details of the invitation, the project, and roles to which the user will be assigned. | [optional] + +### Return type + +void (empty response body) + +### Authorization + +[X-Management-Token](../README.md#X-Management-Token), [X-Management-Id](../README.md#X-Management-Id) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**2XX** | Returns no content if the invitation has been sent successfully. | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **list_brands** +> ManagementProjectsBrandingListResponseBody list_brands(project_id) + +List Brands + +Lists all brand configurations. Because a project can have only one brand, it always returns a list with one item. This endpoint can be used to retrieve the brand configuration created with the Voucherify Dashboard and the ID. + +### Example + +* Api Key Authentication (X-Management-Token): +* Api Key Authentication (X-Management-Id): + +```python +import voucherify +from voucherify.models.management_projects_branding_list_response_body import ManagementProjectsBrandingListResponseBody +from voucherify.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.voucherify.io +# See configuration.py for a list of all supported configuration parameters. +configuration = voucherify.Configuration( + host = "https://api.voucherify.io" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: X-Management-Token +configuration.api_key['X-Management-Token'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['X-Management-Token'] = 'Bearer' + +# Configure API key authorization: X-Management-Id +configuration.api_key['X-Management-Id'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['X-Management-Id'] = 'Bearer' + +# Enter a context with an instance of the API client +with voucherify.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = voucherify.ManagementApi(api_client) + project_id = 'project_id_example' # str | Provide the unique identifier of the project. + + try: + # List Brands + api_response = api_instance.list_brands(project_id) + print("The response of ManagementApi->list_brands:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling ManagementApi->list_brands: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **project_id** | **str**| Provide the unique identifier of the project. | + +### Return type + +[**ManagementProjectsBrandingListResponseBody**](ManagementProjectsBrandingListResponseBody.md) + +### Authorization + +[X-Management-Token](../README.md#X-Management-Token), [X-Management-Id](../README.md#X-Management-Id) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**2XX** | Returns the details about the brand created in the project. | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **list_custom_event_schemas** +> ManagementProjectsCustomEventSchemasListResponseBody list_custom_event_schemas(project_id) + +List Custom Event Schemas + +Lists all custom event schemas available in the project. 📘 Custom Event Documentation Read [Custom Events](https://support.voucherify.io/article/111-custom-events) article to learn how custom events work in Voucherify. Read also the details about the Track Custom Event endpoint and the Custom Event Object. + +### Example + +* Api Key Authentication (X-Management-Token): +* Api Key Authentication (X-Management-Id): + +```python +import voucherify +from voucherify.models.management_projects_custom_event_schemas_list_response_body import ManagementProjectsCustomEventSchemasListResponseBody +from voucherify.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.voucherify.io +# See configuration.py for a list of all supported configuration parameters. +configuration = voucherify.Configuration( + host = "https://api.voucherify.io" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: X-Management-Token +configuration.api_key['X-Management-Token'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['X-Management-Token'] = 'Bearer' + +# Configure API key authorization: X-Management-Id +configuration.api_key['X-Management-Id'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['X-Management-Id'] = 'Bearer' + +# Enter a context with an instance of the API client +with voucherify.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = voucherify.ManagementApi(api_client) + project_id = 'project_id_example' # str | Provide the unique identifier of the project. + + try: + # List Custom Event Schemas + api_response = api_instance.list_custom_event_schemas(project_id) + print("The response of ManagementApi->list_custom_event_schemas:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling ManagementApi->list_custom_event_schemas: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **project_id** | **str**| Provide the unique identifier of the project. | + +### Return type + +[**ManagementProjectsCustomEventSchemasListResponseBody**](ManagementProjectsCustomEventSchemasListResponseBody.md) + +### Authorization + +[X-Management-Token](../README.md#X-Management-Token), [X-Management-Id](../README.md#X-Management-Id) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**2XX** | Returns the details about the custom event schemas created in the project. | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **list_metadata_schemas1** +> ManagementProjectsMetadataSchemasListResponseBody list_metadata_schemas1(project_id) + +List Metadata Schemas + +Lists all metadata schemas available in the project. 📘 Metadata Documentation Read the Getting Started with Metadata articles to learn how metadata work in Voucherify. + +### Example + +* Api Key Authentication (X-Management-Token): +* Api Key Authentication (X-Management-Id): + +```python +import voucherify +from voucherify.models.management_projects_metadata_schemas_list_response_body import ManagementProjectsMetadataSchemasListResponseBody +from voucherify.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.voucherify.io +# See configuration.py for a list of all supported configuration parameters. +configuration = voucherify.Configuration( + host = "https://api.voucherify.io" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: X-Management-Token +configuration.api_key['X-Management-Token'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['X-Management-Token'] = 'Bearer' + +# Configure API key authorization: X-Management-Id +configuration.api_key['X-Management-Id'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['X-Management-Id'] = 'Bearer' + +# Enter a context with an instance of the API client +with voucherify.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = voucherify.ManagementApi(api_client) + project_id = 'project_id_example' # str | Provide the unique identifier of the project. + + try: + # List Metadata Schemas + api_response = api_instance.list_metadata_schemas1(project_id) + print("The response of ManagementApi->list_metadata_schemas1:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling ManagementApi->list_metadata_schemas1: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **project_id** | **str**| Provide the unique identifier of the project. | + +### Return type + +[**ManagementProjectsMetadataSchemasListResponseBody**](ManagementProjectsMetadataSchemasListResponseBody.md) + +### Authorization + +[X-Management-Token](../README.md#X-Management-Token), [X-Management-Id](../README.md#X-Management-Id) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**2XX** | Returns the details about the metadata schemas created in the project. | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **list_projects** +> ManagementProjectsListResponseBody list_projects() + +List Projects + +Lists all projects for the organization. The endpoint does not require any query parameters. + +### Example + +* Api Key Authentication (X-Management-Token): +* Api Key Authentication (X-Management-Id): + +```python +import voucherify +from voucherify.models.management_projects_list_response_body import ManagementProjectsListResponseBody +from voucherify.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.voucherify.io +# See configuration.py for a list of all supported configuration parameters. +configuration = voucherify.Configuration( + host = "https://api.voucherify.io" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: X-Management-Token +configuration.api_key['X-Management-Token'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['X-Management-Token'] = 'Bearer' + +# Configure API key authorization: X-Management-Id +configuration.api_key['X-Management-Id'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['X-Management-Id'] = 'Bearer' + +# Enter a context with an instance of the API client +with voucherify.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = voucherify.ManagementApi(api_client) + + try: + # List Projects + api_response = api_instance.list_projects() + print("The response of ManagementApi->list_projects:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling ManagementApi->list_projects: %s\n" % e) +``` + + + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +[**ManagementProjectsListResponseBody**](ManagementProjectsListResponseBody.md) + +### Authorization + +[X-Management-Token](../README.md#X-Management-Token), [X-Management-Id](../README.md#X-Management-Id) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**2XX** | Returns the list of all projects with their details. | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **list_stacking_rules** +> ManagementProjectsStackingRulesListResponseBody list_stacking_rules(project_id) + +List Stacking Rules + +Lists all stacking rules. Returns always a list with one item. This endpoint can be used to retrieve the default stacking rules. The default stacking rules do not have an ID that could be used with the Get Stacking Rules or Update Stacking Rules endpoints. 📘 Stacking Rules Documentation Read [the Stacking Rules article](https://support.voucherify.io/article/604-stacking-rules) to learn how they work. + +### Example + +* Api Key Authentication (X-Management-Token): +* Api Key Authentication (X-Management-Id): + +```python +import voucherify +from voucherify.models.management_projects_stacking_rules_list_response_body import ManagementProjectsStackingRulesListResponseBody +from voucherify.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.voucherify.io +# See configuration.py for a list of all supported configuration parameters. +configuration = voucherify.Configuration( + host = "https://api.voucherify.io" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: X-Management-Token +configuration.api_key['X-Management-Token'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['X-Management-Token'] = 'Bearer' + +# Configure API key authorization: X-Management-Id +configuration.api_key['X-Management-Id'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['X-Management-Id'] = 'Bearer' + +# Enter a context with an instance of the API client +with voucherify.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = voucherify.ManagementApi(api_client) + project_id = 'project_id_example' # str | Provide the unique identifier of the project. + + try: + # List Stacking Rules + api_response = api_instance.list_stacking_rules(project_id) + print("The response of ManagementApi->list_stacking_rules:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling ManagementApi->list_stacking_rules: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **project_id** | **str**| Provide the unique identifier of the project. | + +### Return type + +[**ManagementProjectsStackingRulesListResponseBody**](ManagementProjectsStackingRulesListResponseBody.md) + +### Authorization + +[X-Management-Token](../README.md#X-Management-Token), [X-Management-Id](../README.md#X-Management-Id) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**2XX** | Returns the details about the stacking rules assigned to the project. These can be either the default stacking rules or the created ones. | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **list_users** +> ManagementProjectsUsersListResponseBody list_users(project_id) + +List Users + +Lists all users assigned to the project. + +### Example + +* Api Key Authentication (X-Management-Token): +* Api Key Authentication (X-Management-Id): + +```python +import voucherify +from voucherify.models.management_projects_users_list_response_body import ManagementProjectsUsersListResponseBody +from voucherify.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.voucherify.io +# See configuration.py for a list of all supported configuration parameters. +configuration = voucherify.Configuration( + host = "https://api.voucherify.io" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: X-Management-Token +configuration.api_key['X-Management-Token'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['X-Management-Token'] = 'Bearer' + +# Configure API key authorization: X-Management-Id +configuration.api_key['X-Management-Id'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['X-Management-Id'] = 'Bearer' + +# Enter a context with an instance of the API client +with voucherify.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = voucherify.ManagementApi(api_client) + project_id = 'project_id_example' # str | Provide the unique identifier of the project. + + try: + # List Users + api_response = api_instance.list_users(project_id) + print("The response of ManagementApi->list_users:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling ManagementApi->list_users: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **project_id** | **str**| Provide the unique identifier of the project. | + +### Return type + +[**ManagementProjectsUsersListResponseBody**](ManagementProjectsUsersListResponseBody.md) + +### Authorization + +[X-Management-Token](../README.md#X-Management-Token), [X-Management-Id](../README.md#X-Management-Id) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**2XX** | Returns the list of all the users assigned to the project. | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **list_webhooks** +> ManagementProjectsWebhooksListResponseBody list_webhooks(project_id) + +List Webhooks + +Lists all webhook configurations for the project. 📘 Webhook Documentation Read Webhooks v2024-01-1 article to learn how webhooks work in Voucherify. + +### Example + +* Api Key Authentication (X-Management-Token): +* Api Key Authentication (X-Management-Id): + +```python +import voucherify +from voucherify.models.management_projects_webhooks_list_response_body import ManagementProjectsWebhooksListResponseBody +from voucherify.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.voucherify.io +# See configuration.py for a list of all supported configuration parameters. +configuration = voucherify.Configuration( + host = "https://api.voucherify.io" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: X-Management-Token +configuration.api_key['X-Management-Token'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['X-Management-Token'] = 'Bearer' + +# Configure API key authorization: X-Management-Id +configuration.api_key['X-Management-Id'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['X-Management-Id'] = 'Bearer' + +# Enter a context with an instance of the API client +with voucherify.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = voucherify.ManagementApi(api_client) + project_id = 'project_id_example' # str | Provide the unique identifier of the project. + + try: + # List Webhooks + api_response = api_instance.list_webhooks(project_id) + print("The response of ManagementApi->list_webhooks:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling ManagementApi->list_webhooks: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **project_id** | **str**| Provide the unique identifier of the project. | + +### Return type + +[**ManagementProjectsWebhooksListResponseBody**](ManagementProjectsWebhooksListResponseBody.md) + +### Authorization + +[X-Management-Token](../README.md#X-Management-Token), [X-Management-Id](../README.md#X-Management-Id) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**2XX** | Returns the details about webhook configurations created in the project. | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **unassign_user** +> unassign_user(project_id, user_id) + +Unassign User + +Unassigns the user from the project. If the user is currently logged in, they are automatically logged out. If the user is assigned to only one project, they cannot be unassigned from that project. + +### Example + +* Api Key Authentication (X-Management-Token): +* Api Key Authentication (X-Management-Id): + +```python +import voucherify +from voucherify.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.voucherify.io +# See configuration.py for a list of all supported configuration parameters. +configuration = voucherify.Configuration( + host = "https://api.voucherify.io" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: X-Management-Token +configuration.api_key['X-Management-Token'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['X-Management-Token'] = 'Bearer' + +# Configure API key authorization: X-Management-Id +configuration.api_key['X-Management-Id'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['X-Management-Id'] = 'Bearer' + +# Enter a context with an instance of the API client +with voucherify.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = voucherify.ManagementApi(api_client) + project_id = 'project_id_example' # str | Provide the unique identifier of the project. + user_id = 'user_id_example' # str | Provide the unique identifier of the user. Alternatively, provide the users login. + + try: + # Unassign User + api_instance.unassign_user(project_id, user_id) + except Exception as e: + print("Exception when calling ManagementApi->unassign_user: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **project_id** | **str**| Provide the unique identifier of the project. | + **user_id** | **str**| Provide the unique identifier of the user. Alternatively, provide the users login. | + +### Return type + +void (empty response body) + +### Authorization + +[X-Management-Token](../README.md#X-Management-Token), [X-Management-Id](../README.md#X-Management-Id) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**2XX** | Returns no content if the user has been successfully unnassigned. | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **update_brand** +> ManagementProjectsBrandingUpdateResponseBody update_brand(project_id, branding_id, management_projects_branding_update_request_body=management_projects_branding_update_request_body) + +Update Brand + +Updates a brand configuration. Only the fields sent in the request will be updated. The fields omitted in the request will remain unchanged. 📘 White Labelling The white labelling settings which can be found in Project Settings > Brand Details and which are available only for Enterprise clients as a separate service can be configured only in the user interface. + +### Example + +* Api Key Authentication (X-Management-Token): +* Api Key Authentication (X-Management-Id): + +```python +import voucherify +from voucherify.models.management_projects_branding_update_request_body import ManagementProjectsBrandingUpdateRequestBody +from voucherify.models.management_projects_branding_update_response_body import ManagementProjectsBrandingUpdateResponseBody +from voucherify.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.voucherify.io +# See configuration.py for a list of all supported configuration parameters. +configuration = voucherify.Configuration( + host = "https://api.voucherify.io" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: X-Management-Token +configuration.api_key['X-Management-Token'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['X-Management-Token'] = 'Bearer' + +# Configure API key authorization: X-Management-Id +configuration.api_key['X-Management-Id'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['X-Management-Id'] = 'Bearer' + +# Enter a context with an instance of the API client +with voucherify.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = voucherify.ManagementApi(api_client) + project_id = 'project_id_example' # str | Provide the unique identifier of the project. + branding_id = 'branding_id_example' # str | Provide the unique identifier of the brand configuration. + management_projects_branding_update_request_body = voucherify.ManagementProjectsBrandingUpdateRequestBody() # ManagementProjectsBrandingUpdateRequestBody | Defines the brand configuration to be updated. (optional) + + try: + # Update Brand + api_response = api_instance.update_brand(project_id, branding_id, management_projects_branding_update_request_body=management_projects_branding_update_request_body) + print("The response of ManagementApi->update_brand:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling ManagementApi->update_brand: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **project_id** | **str**| Provide the unique identifier of the project. | + **branding_id** | **str**| Provide the unique identifier of the brand configuration. | + **management_projects_branding_update_request_body** | [**ManagementProjectsBrandingUpdateRequestBody**](ManagementProjectsBrandingUpdateRequestBody.md)| Defines the brand configuration to be updated. | [optional] + +### Return type + +[**ManagementProjectsBrandingUpdateResponseBody**](ManagementProjectsBrandingUpdateResponseBody.md) + +### Authorization + +[X-Management-Token](../README.md#X-Management-Token), [X-Management-Id](../README.md#X-Management-Id) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**2XX** | Returns the details about the updated brand configuration. | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **update_custom_event_schema** +> ManagementProjectsCustomEventSchemasUpdateResponseBody update_custom_event_schema(project_id, custom_event_schema_id, management_projects_custom_event_schemas_update_request_body=management_projects_custom_event_schemas_update_request_body) + +Update Custom Event Schema + +Updates a custom event schema. With this request, you can: - Add a non-existing property to a custom event schema. - Update an existing property. In the request, you can provide only those properties you want to add or update. Definitions omitted in the request remain unchanged. 👍 Additional Notes - You can change the type of an existing property, e.g. from string to number. - You can remove a custom property with this endpoint by providing deleted: true in the request. However, you cannot permanently remove an event definition or its property with this endpoint. 📘 Custom Event Documentation Read [Custom Events](https://support.voucherify.io/article/111-custom-events) article to learn how custom events work in Voucherify. Read also the details about the Track Custom Event endpoint and the Custom Event Object. + +### Example + +* Api Key Authentication (X-Management-Token): +* Api Key Authentication (X-Management-Id): + +```python +import voucherify +from voucherify.models.management_projects_custom_event_schemas_update_request_body import ManagementProjectsCustomEventSchemasUpdateRequestBody +from voucherify.models.management_projects_custom_event_schemas_update_response_body import ManagementProjectsCustomEventSchemasUpdateResponseBody +from voucherify.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.voucherify.io +# See configuration.py for a list of all supported configuration parameters. +configuration = voucherify.Configuration( + host = "https://api.voucherify.io" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: X-Management-Token +configuration.api_key['X-Management-Token'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['X-Management-Token'] = 'Bearer' + +# Configure API key authorization: X-Management-Id +configuration.api_key['X-Management-Id'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['X-Management-Id'] = 'Bearer' + +# Enter a context with an instance of the API client +with voucherify.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = voucherify.ManagementApi(api_client) + project_id = 'project_id_example' # str | Provide the unique identifier of the project. + custom_event_schema_id = 'custom_event_schema_id_example' # str | Provide the unique identifier of the custom event schema. + management_projects_custom_event_schemas_update_request_body = voucherify.ManagementProjectsCustomEventSchemasUpdateRequestBody() # ManagementProjectsCustomEventSchemasUpdateRequestBody | Defines the custom event schema to be updated. (optional) + + try: + # Update Custom Event Schema + api_response = api_instance.update_custom_event_schema(project_id, custom_event_schema_id, management_projects_custom_event_schemas_update_request_body=management_projects_custom_event_schemas_update_request_body) + print("The response of ManagementApi->update_custom_event_schema:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling ManagementApi->update_custom_event_schema: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **project_id** | **str**| Provide the unique identifier of the project. | + **custom_event_schema_id** | **str**| Provide the unique identifier of the custom event schema. | + **management_projects_custom_event_schemas_update_request_body** | [**ManagementProjectsCustomEventSchemasUpdateRequestBody**](ManagementProjectsCustomEventSchemasUpdateRequestBody.md)| Defines the custom event schema to be updated. | [optional] + +### Return type + +[**ManagementProjectsCustomEventSchemasUpdateResponseBody**](ManagementProjectsCustomEventSchemasUpdateResponseBody.md) + +### Authorization + +[X-Management-Token](../README.md#X-Management-Token), [X-Management-Id](../README.md#X-Management-Id) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**2XX** | Returns the details about the updated custom event schema. | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **update_metadata_schema** +> ManagementProjectsMetadataSchemasUpdateResponseBody update_metadata_schema(project_id, metadata_schema_id, management_projects_metadata_schemas_update_request_body=management_projects_metadata_schemas_update_request_body) + +Update Metadata Schema + +Updates a metadata schema. With this request, you can: - Add a non-existing attribute definition to the metadata schema. - Update an existing attribute definition by overwriting its current values. In the request, you can provide only those definitions you want to add or update. Definitions omitted in the request remain unchanged. However, if you want to update a definition, you will have to add all its current key-value pairs as well. Only the pairs sent in the request are saved for this definition. This means that the key-value pairs that are not sent in a request are restored to default values. For example, if your definition has an array with values and it is not sent in an update request, the array values will be deleted. 👍 Additional Notes - You cannot change the type of an existing schema, e.g. from string to number. - You can remove a definition with this endpoint by providing deleted: true in the request. It will be moved to the Removed definitions section in the user interface. However, you cannot permanently remove a definition with this endpoint. 📘 Metadata Documentation Read the Getting Started with Metadata articles to learn how metadata work in Voucherify. + +### Example + +* Api Key Authentication (X-Management-Token): +* Api Key Authentication (X-Management-Id): + +```python +import voucherify +from voucherify.models.management_projects_metadata_schemas_update_request_body import ManagementProjectsMetadataSchemasUpdateRequestBody +from voucherify.models.management_projects_metadata_schemas_update_response_body import ManagementProjectsMetadataSchemasUpdateResponseBody +from voucherify.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.voucherify.io +# See configuration.py for a list of all supported configuration parameters. +configuration = voucherify.Configuration( + host = "https://api.voucherify.io" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: X-Management-Token +configuration.api_key['X-Management-Token'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['X-Management-Token'] = 'Bearer' + +# Configure API key authorization: X-Management-Id +configuration.api_key['X-Management-Id'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['X-Management-Id'] = 'Bearer' + +# Enter a context with an instance of the API client +with voucherify.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = voucherify.ManagementApi(api_client) + project_id = 'project_id_example' # str | Provide the unique identifier of the project. + metadata_schema_id = 'metadata_schema_id_example' # str | Provide the unique identifier of the metadata schema. + management_projects_metadata_schemas_update_request_body = voucherify.ManagementProjectsMetadataSchemasUpdateRequestBody() # ManagementProjectsMetadataSchemasUpdateRequestBody | Defines the metadata schema to be updated. (optional) + + try: + # Update Metadata Schema + api_response = api_instance.update_metadata_schema(project_id, metadata_schema_id, management_projects_metadata_schemas_update_request_body=management_projects_metadata_schemas_update_request_body) + print("The response of ManagementApi->update_metadata_schema:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling ManagementApi->update_metadata_schema: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **project_id** | **str**| Provide the unique identifier of the project. | + **metadata_schema_id** | **str**| Provide the unique identifier of the metadata schema. | + **management_projects_metadata_schemas_update_request_body** | [**ManagementProjectsMetadataSchemasUpdateRequestBody**](ManagementProjectsMetadataSchemasUpdateRequestBody.md)| Defines the metadata schema to be updated. | [optional] + +### Return type + +[**ManagementProjectsMetadataSchemasUpdateResponseBody**](ManagementProjectsMetadataSchemasUpdateResponseBody.md) + +### Authorization + +[X-Management-Token](../README.md#X-Management-Token), [X-Management-Id](../README.md#X-Management-Id) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**2XX** | Returns the details about the updated metadata schema. | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **update_project** +> ManagementProjectsUpdateResponseBody update_project(project_id, management_projects_update_request_body=management_projects_update_request_body) + +Update Project + +Updates an existing project. You can add or modify settings for timezone, currency, notifications, and other details. Only the fields sent in the request will be updated. + +### Example + +* Api Key Authentication (X-Management-Token): +* Api Key Authentication (X-Management-Id): + +```python +import voucherify +from voucherify.models.management_projects_update_request_body import ManagementProjectsUpdateRequestBody +from voucherify.models.management_projects_update_response_body import ManagementProjectsUpdateResponseBody +from voucherify.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.voucherify.io +# See configuration.py for a list of all supported configuration parameters. +configuration = voucherify.Configuration( + host = "https://api.voucherify.io" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: X-Management-Token +configuration.api_key['X-Management-Token'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['X-Management-Token'] = 'Bearer' + +# Configure API key authorization: X-Management-Id +configuration.api_key['X-Management-Id'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['X-Management-Id'] = 'Bearer' + +# Enter a context with an instance of the API client +with voucherify.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = voucherify.ManagementApi(api_client) + project_id = 'project_id_example' # str | Provide the unique identifier of the project. + management_projects_update_request_body = voucherify.ManagementProjectsUpdateRequestBody() # ManagementProjectsUpdateRequestBody | Define the project details to be updated. (optional) + + try: + # Update Project + api_response = api_instance.update_project(project_id, management_projects_update_request_body=management_projects_update_request_body) + print("The response of ManagementApi->update_project:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling ManagementApi->update_project: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **project_id** | **str**| Provide the unique identifier of the project. | + **management_projects_update_request_body** | [**ManagementProjectsUpdateRequestBody**](ManagementProjectsUpdateRequestBody.md)| Define the project details to be updated. | [optional] + +### Return type + +[**ManagementProjectsUpdateResponseBody**](ManagementProjectsUpdateResponseBody.md) + +### Authorization + +[X-Management-Token](../README.md#X-Management-Token), [X-Management-Id](../README.md#X-Management-Id) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**2XX** | Returns the details of an updated project. | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **update_stacking_rules** +> ManagementProjectsStackingRulesUpdateResponseBody update_stacking_rules(project_id, stacking_rules_id, management_projects_stacking_rules_update_request_body=management_projects_stacking_rules_update_request_body) + +Update Stacking Rules + +Updates the stacking rules. Only the provided fields will be updated. However, if you update an array, the content of the array is overwritten. This means that if you want to add new values to an array and retain existing ones, you need to provide both the existing and new values in the request. 📘 Stacking Rules Documentation Read [the Stacking Rules article](https://support.voucherify.io/article/604-stacking-rules) to learn how they work. + +### Example + +* Api Key Authentication (X-Management-Token): +* Api Key Authentication (X-Management-Id): + +```python +import voucherify +from voucherify.models.management_projects_stacking_rules_update_request_body import ManagementProjectsStackingRulesUpdateRequestBody +from voucherify.models.management_projects_stacking_rules_update_response_body import ManagementProjectsStackingRulesUpdateResponseBody +from voucherify.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.voucherify.io +# See configuration.py for a list of all supported configuration parameters. +configuration = voucherify.Configuration( + host = "https://api.voucherify.io" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: X-Management-Token +configuration.api_key['X-Management-Token'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['X-Management-Token'] = 'Bearer' + +# Configure API key authorization: X-Management-Id +configuration.api_key['X-Management-Id'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['X-Management-Id'] = 'Bearer' + +# Enter a context with an instance of the API client +with voucherify.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = voucherify.ManagementApi(api_client) + project_id = 'project_id_example' # str | Provide the unique identifier of the project. + stacking_rules_id = 'stacking_rules_id_example' # str | Provide the unique identifier of the stacking rules. + management_projects_stacking_rules_update_request_body = voucherify.ManagementProjectsStackingRulesUpdateRequestBody() # ManagementProjectsStackingRulesUpdateRequestBody | Defines the stacking rules to be updated. (optional) + + try: + # Update Stacking Rules + api_response = api_instance.update_stacking_rules(project_id, stacking_rules_id, management_projects_stacking_rules_update_request_body=management_projects_stacking_rules_update_request_body) + print("The response of ManagementApi->update_stacking_rules:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling ManagementApi->update_stacking_rules: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **project_id** | **str**| Provide the unique identifier of the project. | + **stacking_rules_id** | **str**| Provide the unique identifier of the stacking rules. | + **management_projects_stacking_rules_update_request_body** | [**ManagementProjectsStackingRulesUpdateRequestBody**](ManagementProjectsStackingRulesUpdateRequestBody.md)| Defines the stacking rules to be updated. | [optional] + +### Return type + +[**ManagementProjectsStackingRulesUpdateResponseBody**](ManagementProjectsStackingRulesUpdateResponseBody.md) + +### Authorization + +[X-Management-Token](../README.md#X-Management-Token), [X-Management-Id](../README.md#X-Management-Id) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**2XX** | Returns the details about the updated stacking rules. | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **update_user** +> ManagementProjectsUsersUpdateRoleResponseBody update_user(project_id, user_id, management_projects_users_update_role_request_body=management_projects_users_update_role_request_body) + +Update User + +Updates the users role. + +### Example + +* Api Key Authentication (X-Management-Token): +* Api Key Authentication (X-Management-Id): + +```python +import voucherify +from voucherify.models.management_projects_users_update_role_request_body import ManagementProjectsUsersUpdateRoleRequestBody +from voucherify.models.management_projects_users_update_role_response_body import ManagementProjectsUsersUpdateRoleResponseBody +from voucherify.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.voucherify.io +# See configuration.py for a list of all supported configuration parameters. +configuration = voucherify.Configuration( + host = "https://api.voucherify.io" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: X-Management-Token +configuration.api_key['X-Management-Token'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['X-Management-Token'] = 'Bearer' + +# Configure API key authorization: X-Management-Id +configuration.api_key['X-Management-Id'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['X-Management-Id'] = 'Bearer' + +# Enter a context with an instance of the API client +with voucherify.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = voucherify.ManagementApi(api_client) + project_id = 'project_id_example' # str | Provide the unique identifier of the project. + user_id = 'user_id_example' # str | Provide the unique identifier of the user. Alternatively, provide the users login. + management_projects_users_update_role_request_body = voucherify.ManagementProjectsUsersUpdateRoleRequestBody() # ManagementProjectsUsersUpdateRoleRequestBody | Defines the users new role. (optional) + + try: + # Update User + api_response = api_instance.update_user(project_id, user_id, management_projects_users_update_role_request_body=management_projects_users_update_role_request_body) + print("The response of ManagementApi->update_user:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling ManagementApi->update_user: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **project_id** | **str**| Provide the unique identifier of the project. | + **user_id** | **str**| Provide the unique identifier of the user. Alternatively, provide the users login. | + **management_projects_users_update_role_request_body** | [**ManagementProjectsUsersUpdateRoleRequestBody**](ManagementProjectsUsersUpdateRoleRequestBody.md)| Defines the users new role. | [optional] + +### Return type + +[**ManagementProjectsUsersUpdateRoleResponseBody**](ManagementProjectsUsersUpdateRoleResponseBody.md) + +### Authorization + +[X-Management-Token](../README.md#X-Management-Token), [X-Management-Id](../README.md#X-Management-Id) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**2XX** | Returns the details about the user assigned to the project. | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **update_webhook** +> ManagementProjectsWebhooksUpdateResponseBody update_webhook(project_id, webhook_id, management_projects_webhooks_update_request_body=management_projects_webhooks_update_request_body) + +Update Webhook + +Updates a webhook configuration. The events listed in the request are overwritten. If you want to add more events, provide also the events that are already in the webhook configuration. 📘 Webhook Documentation Read Webhooks v2024-01-1 article to learn how webhooks work in Voucherify. + +### Example + +* Api Key Authentication (X-Management-Token): +* Api Key Authentication (X-Management-Id): + +```python +import voucherify +from voucherify.models.management_projects_webhooks_update_request_body import ManagementProjectsWebhooksUpdateRequestBody +from voucherify.models.management_projects_webhooks_update_response_body import ManagementProjectsWebhooksUpdateResponseBody +from voucherify.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.voucherify.io +# See configuration.py for a list of all supported configuration parameters. +configuration = voucherify.Configuration( + host = "https://api.voucherify.io" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: X-Management-Token +configuration.api_key['X-Management-Token'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['X-Management-Token'] = 'Bearer' + +# Configure API key authorization: X-Management-Id +configuration.api_key['X-Management-Id'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['X-Management-Id'] = 'Bearer' + +# Enter a context with an instance of the API client +with voucherify.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = voucherify.ManagementApi(api_client) + project_id = 'project_id_example' # str | Provide the unique identifier of the project. + webhook_id = 'webhook_id_example' # str | Provide the unique identifier of the webhook configuration. + management_projects_webhooks_update_request_body = voucherify.ManagementProjectsWebhooksUpdateRequestBody() # ManagementProjectsWebhooksUpdateRequestBody | Defines the webhook configuration to be updated. (optional) + + try: + # Update Webhook + api_response = api_instance.update_webhook(project_id, webhook_id, management_projects_webhooks_update_request_body=management_projects_webhooks_update_request_body) + print("The response of ManagementApi->update_webhook:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling ManagementApi->update_webhook: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **project_id** | **str**| Provide the unique identifier of the project. | + **webhook_id** | **str**| Provide the unique identifier of the webhook configuration. | + **management_projects_webhooks_update_request_body** | [**ManagementProjectsWebhooksUpdateRequestBody**](ManagementProjectsWebhooksUpdateRequestBody.md)| Defines the webhook configuration to be updated. | [optional] + +### Return type + +[**ManagementProjectsWebhooksUpdateResponseBody**](ManagementProjectsWebhooksUpdateResponseBody.md) + +### Authorization + +[X-Management-Token](../README.md#X-Management-Token), [X-Management-Id](../README.md#X-Management-Id) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**2XX** | Returns the details about the updated webhook configuration. | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/docs/ManagementProject.md b/docs/ManagementProject.md new file mode 100644 index 00000000..672fe8c6 --- /dev/null +++ b/docs/ManagementProject.md @@ -0,0 +1,34 @@ +# ManagementProject + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **str** | Unique identifier of the project. | [optional] +**name** | **str** | The name of the project. | [optional] +**description** | **str** | A user-defined description of the project, e.g. its purpose, scope, region. | [optional] +**timezone** | **str** | The time zone in which the project is established. It can be in the GMT format or in accordance with IANA time zone database. | [optional] +**currency** | **str** | The currency used in the project. It is equal to a 3-letter ISO 4217 code. | [optional] +**dial_code** | **str** | The country dial code for the project. It is equal to an ITU country code. | [optional] +**webhook_version** | **str** | The webhook version used in the project. | [optional] [default to 'v2024-01-01'] +**client_trusted_domains** | **List[str]** | An array of URL addresses that allow client requests. | [optional] +**client_redeem_enabled** | **bool** | Enables client-side redemption. | [optional] +**client_publish_enabled** | **bool** | Enables client-side publication. | [optional] +**client_list_vouchers_enabled** | **bool** | Enables client-side listing of vouchers. | [optional] +**client_create_customer_enabled** | **bool** | Enables client-side creation of customers. | [optional] +**client_loyalty_events_enabled** | **bool** | Enables client-side events for loyalty and referral programs. | [optional] +**client_set_voucher_expiration_date_enabled** | **bool** | Enables client-side setting of voucher expiration date. | [optional] +**api_usage_notifications** | [**ManagementProjectApiUsageNotifications**](ManagementProjectApiUsageNotifications.md) | | [optional] +**webhooks_callout_notifications** | [**ManagementProjectWebhooksCalloutNotifications**](ManagementProjectWebhooksCalloutNotifications.md) | | [optional] +**cluster_id** | **str** | The identifier of the cluster where the project will be created. | [optional] +**case_sensitive_codes** | **bool** | Determines if the vouchers in the project will be: - case sensitive - if `true`, `C0dE-cfV` is **not** equal to `c0de-cfv`), - case insensitive - if `false`, `C0dE-cfV` is equal to `c0de-cfv`. | [optional] +**api_version** | **str** | The API version used in the project. Currently, the default and only value is `v2018-08-01`. | [optional] [default to 'v2018-08-01'] +**is_sandbox** | **bool** | Determines if the project is a sandbox project. | [optional] +**webhook_token** | **str** | Webhook token used for authentication. | [optional] +**default_code_config** | [**ManagementProjectDefaultCodeConfig**](ManagementProjectDefaultCodeConfig.md) | | [optional] +**limits** | [**ManagementProjectLimits**](ManagementProjectLimits.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ManagementProjectApiUsageNotifications.md b/docs/ManagementProjectApiUsageNotifications.md new file mode 100644 index 00000000..c10dba6b --- /dev/null +++ b/docs/ManagementProjectApiUsageNotifications.md @@ -0,0 +1,18 @@ +# ManagementProjectApiUsageNotifications + +Determines the notification settings. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**redemptions** | [**UsageNotifications**](UsageNotifications.md) | | [optional] +**messages** | [**UsageNotifications**](UsageNotifications.md) | | [optional] +**api_calls** | [**UsageNotifications**](UsageNotifications.md) | | [optional] +**bulk_api_calls** | [**UsageNotifications**](UsageNotifications.md) | | [optional] +**webhook_calls** | [**UsageNotifications**](UsageNotifications.md) | | [optional] +**cycle_calls** | [**UsageNotifications**](UsageNotifications.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ManagementProjectDefaultCodeConfig.md b/docs/ManagementProjectDefaultCodeConfig.md new file mode 100644 index 00000000..91b591bc --- /dev/null +++ b/docs/ManagementProjectDefaultCodeConfig.md @@ -0,0 +1,13 @@ +# ManagementProjectDefaultCodeConfig + +Determines the character set that is used as default for vouchers. It is affected by the `\"case_sensitive_codes\"` setting. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**charset** | **str** | Lists all characters that are used as default for vouchers | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ManagementProjectLimits.md b/docs/ManagementProjectLimits.md new file mode 100644 index 00000000..82842461 --- /dev/null +++ b/docs/ManagementProjectLimits.md @@ -0,0 +1,14 @@ +# ManagementProjectLimits + +Determines additional limits set on a given project, e.g. the Sandbox project. If no limits are returned, the limits set for the whole organization apply. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**api_calls** | [**List[ManagementProjectLimitsApiCallsItem]**](ManagementProjectLimitsApiCallsItem.md) | | [optional] +**bulk_api_calls** | [**List[ManagementProjectLimitsBulkApiCallsItem]**](ManagementProjectLimitsBulkApiCallsItem.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ManagementProjectLimitsApiCallsItem.md b/docs/ManagementProjectLimitsApiCallsItem.md new file mode 100644 index 00000000..93be7275 --- /dev/null +++ b/docs/ManagementProjectLimitsApiCallsItem.md @@ -0,0 +1,14 @@ +# ManagementProjectLimitsApiCallsItem + +Determines the limit of API calls per given unit time. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**value** | **int** | Determines the maximum number of API calls per time set in `\"duration\"`. | [optional] +**duration** | **str** | Determines the amount of time during which the calls up to the number specified in the `value` can be made. The duration is presented in the ISO 8601 format, e.g. `PT1H` means one hour. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ManagementProjectLimitsBulkApiCallsItem.md b/docs/ManagementProjectLimitsBulkApiCallsItem.md new file mode 100644 index 00000000..61877fb6 --- /dev/null +++ b/docs/ManagementProjectLimitsBulkApiCallsItem.md @@ -0,0 +1,14 @@ +# ManagementProjectLimitsBulkApiCallsItem + + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**value** | **int** | Determines the maximum number of API calls per time set in `\"duration\"`. | [optional] +**duration** | **str** | Determines the amount of time during which the calls up to the number specified in the `value` can be made. The duration is presented in the ISO 8601 format, e.g. `PT1H` means one hour. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ManagementProjectWebhooksCalloutNotifications.md b/docs/ManagementProjectWebhooksCalloutNotifications.md new file mode 100644 index 00000000..7cf89446 --- /dev/null +++ b/docs/ManagementProjectWebhooksCalloutNotifications.md @@ -0,0 +1,14 @@ +# ManagementProjectWebhooksCalloutNotifications + +Determines the notification settings for webhook callouts configured in Distributions and Project settings. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**distributions** | [**ManagementProjectWebhooksCalloutNotificationsDistributions**](ManagementProjectWebhooksCalloutNotificationsDistributions.md) | | [optional] +**webhooks** | [**ManagementProjectWebhooksCalloutNotificationsWebhooks**](ManagementProjectWebhooksCalloutNotificationsWebhooks.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ManagementProjectWebhooksCalloutNotificationsDistributions.md b/docs/ManagementProjectWebhooksCalloutNotificationsDistributions.md new file mode 100644 index 00000000..1e4224b3 --- /dev/null +++ b/docs/ManagementProjectWebhooksCalloutNotificationsDistributions.md @@ -0,0 +1,15 @@ +# ManagementProjectWebhooksCalloutNotificationsDistributions + +Determines the notification settings for webhooks sent through Distributions. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**email** | **bool** | Enables the notification through an email. | [optional] +**in_app** | **bool** | Enables the notification through an email. | [optional] +**emails** | **List[str]** | An array of email addresses which will receive the notification. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ManagementProjectWebhooksCalloutNotificationsWebhooks.md b/docs/ManagementProjectWebhooksCalloutNotificationsWebhooks.md new file mode 100644 index 00000000..d73e4aef --- /dev/null +++ b/docs/ManagementProjectWebhooksCalloutNotificationsWebhooks.md @@ -0,0 +1,15 @@ +# ManagementProjectWebhooksCalloutNotificationsWebhooks + +Determines the notification settings for webhooks sent as set out in the Project settings. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**email** | **bool** | Enables the notification through an email. | [optional] +**in_app** | **bool** | Enables the notification through an email. | [optional] +**emails** | **List[str]** | An array of email addresses which will receive the notification. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ManagementProjectsBranding.md b/docs/ManagementProjectsBranding.md new file mode 100644 index 00000000..c5e3da34 --- /dev/null +++ b/docs/ManagementProjectsBranding.md @@ -0,0 +1,17 @@ +# ManagementProjectsBranding + +Response brand schema. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **str** | Unique identifier of the brand configuration. | [optional] +**brand** | [**ManagementProjectsBrandingBrand**](ManagementProjectsBrandingBrand.md) | | [optional] +**address** | [**ManagementProjectsBrandingAddress**](ManagementProjectsBrandingAddress.md) | | [optional] +**contact** | [**ManagementProjectsBrandingContact**](ManagementProjectsBrandingContact.md) | | [optional] +**cockpits** | [**ManagementProjectsBrandingCockpits**](ManagementProjectsBrandingCockpits.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ManagementProjectsBrandingAddress.md b/docs/ManagementProjectsBrandingAddress.md new file mode 100644 index 00000000..73f107f5 --- /dev/null +++ b/docs/ManagementProjectsBrandingAddress.md @@ -0,0 +1,17 @@ +# ManagementProjectsBrandingAddress + +Defines the address details. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**street** | **str** | Defines the brand's street. | [optional] +**city** | **str** | Defines the brand's city. | [optional] +**postal** | **str** | Defines the brand's postal code. | [optional] +**state** | **str** | Defines the brand's state or similar administrative area. | [optional] +**country** | **str** | Defines the brand's country. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ManagementProjectsBrandingBrand.md b/docs/ManagementProjectsBrandingBrand.md new file mode 100644 index 00000000..1b35308f --- /dev/null +++ b/docs/ManagementProjectsBrandingBrand.md @@ -0,0 +1,17 @@ +# ManagementProjectsBrandingBrand + +Defines basic brand details. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **str** | Defines brand name. | [optional] +**privacy_policy_url** | **str** | Defines the URL to the brand's privacy policy. It must be a valid URL format. | [optional] +**terms_of_use_url** | **str** | Defines the URL to the brand's terms of use. It must be a valid URL format. | [optional] +**permission_reminder** | **str** | Defines the message that is displayed to customers who opted in an email newsletter. | [optional] +**website_url** | **str** | Defines the URL to the brand's website. It must be a valid URL format. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ManagementProjectsBrandingCockpits.md b/docs/ManagementProjectsBrandingCockpits.md new file mode 100644 index 00000000..c819695e --- /dev/null +++ b/docs/ManagementProjectsBrandingCockpits.md @@ -0,0 +1,20 @@ +# ManagementProjectsBrandingCockpits + +Defines customer cockpit details. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**campaigns_overview_enabled** | **bool** | Enables the campaign overview for customers. | [optional] +**loyalty_enabled** | **bool** | Enables the loyalty campaign overview for customers. | [optional] +**gift_cards_enabled** | **bool** | Enables the gift card overview for customers. | [optional] +**coupons_enabled** | **bool** | Enables the discount coupon overview for customers. | [optional] +**referrals_enabled** | **bool** | Enables the referral campaign overview for customers. | [optional] +**theme** | **str** | Determines the color scheme of the customer cockpit. | [optional] +**use_custom_double_opt_in_redirect_url** | **bool** | Enables the double opt-in option. It must be a valid URL format. | [optional] +**custom_double_opt_in_redirect_url** | **str** | Defines the URL for the double opt-in consent. It must be a valid URL format. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ManagementProjectsBrandingContact.md b/docs/ManagementProjectsBrandingContact.md new file mode 100644 index 00000000..f57abf10 --- /dev/null +++ b/docs/ManagementProjectsBrandingContact.md @@ -0,0 +1,14 @@ +# ManagementProjectsBrandingContact + +Defines contact details. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**email** | **str** | Defines the brand's email address. It must be a valid email format. | [optional] +**phone** | **str** | Defines the brand's phone number. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ManagementProjectsBrandingCreateRequestBody.md b/docs/ManagementProjectsBrandingCreateRequestBody.md new file mode 100644 index 00000000..3a200d76 --- /dev/null +++ b/docs/ManagementProjectsBrandingCreateRequestBody.md @@ -0,0 +1,16 @@ +# ManagementProjectsBrandingCreateRequestBody + +Request body schema for **POST** `v1/management/v1/projects/{projectId}/branding`. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**brand** | [**ManagementProjectsBrandingCreateRequestBodyBrand**](ManagementProjectsBrandingCreateRequestBodyBrand.md) | | [optional] +**address** | [**ManagementProjectsBrandingCreateRequestBodyAddress**](ManagementProjectsBrandingCreateRequestBodyAddress.md) | | [optional] +**contact** | [**ManagementProjectsBrandingCreateRequestBodyContact**](ManagementProjectsBrandingCreateRequestBodyContact.md) | | [optional] +**cockpits** | [**ManagementProjectsBrandingCreateRequestBodyCockpits**](ManagementProjectsBrandingCreateRequestBodyCockpits.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ManagementProjectsBrandingCreateRequestBodyAddress.md b/docs/ManagementProjectsBrandingCreateRequestBodyAddress.md new file mode 100644 index 00000000..1e445e47 --- /dev/null +++ b/docs/ManagementProjectsBrandingCreateRequestBodyAddress.md @@ -0,0 +1,17 @@ +# ManagementProjectsBrandingCreateRequestBodyAddress + +Defines the address details. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**street** | **str** | Defines the brand's street. | [optional] +**city** | **str** | Defines the brand's city. | [optional] +**postal** | **str** | Defines the brand's postal code. | [optional] +**state** | **str** | Defines the brand's state or similar administrative area. | [optional] +**country** | **str** | Defines the brand's country. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ManagementProjectsBrandingCreateRequestBodyBrand.md b/docs/ManagementProjectsBrandingCreateRequestBodyBrand.md new file mode 100644 index 00000000..709ee660 --- /dev/null +++ b/docs/ManagementProjectsBrandingCreateRequestBodyBrand.md @@ -0,0 +1,17 @@ +# ManagementProjectsBrandingCreateRequestBodyBrand + +Defines basic brand details. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **str** | Defines brand name. | [optional] +**privacy_policy_url** | **str** | Defines the URL to the brand's privacy policy. It must be a valid URL format. | [optional] +**terms_of_use_url** | **str** | Defines the URL to the brand's terms of use. It must be a valid URL format. | [optional] +**permission_reminder** | **str** | Defines the message that is displayed to customers who opted in an email newsletter. | [optional] [default to 'You are receiving this email because you opted in at our website.'] +**website_url** | **str** | Defines the URL to the brand's website. It must be a valid URL format. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ManagementProjectsBrandingCreateRequestBodyCockpits.md b/docs/ManagementProjectsBrandingCreateRequestBodyCockpits.md new file mode 100644 index 00000000..4b4eddf0 --- /dev/null +++ b/docs/ManagementProjectsBrandingCreateRequestBodyCockpits.md @@ -0,0 +1,20 @@ +# ManagementProjectsBrandingCreateRequestBodyCockpits + +Defines customer cockpit details. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**campaigns_overview_enabled** | **bool** | Enables the campaign overview for customers. | [optional] [default to False] +**loyalty_enabled** | **bool** | Enables the loyalty campaign overview for customers. | [optional] [default to True] +**gift_cards_enabled** | **bool** | Enables the gift card overview for customers. | [optional] [default to True] +**coupons_enabled** | **bool** | Enables the discount coupon overview for customers. | [optional] [default to True] +**referrals_enabled** | **bool** | Enables the referral campaign overview for customers. | [optional] [default to True] +**theme** | **str** | Determines the color scheme of the customer cockpit. | [optional] [default to 'default'] +**use_custom_double_opt_in_redirect_url** | **bool** | Enables the double opt-in option. It must be a valid URL format. | [optional] [default to False] +**custom_double_opt_in_redirect_url** | **str** | Defines the URL for the double opt-in consent. It must be a valid URL format. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ManagementProjectsBrandingCreateRequestBodyContact.md b/docs/ManagementProjectsBrandingCreateRequestBodyContact.md new file mode 100644 index 00000000..3cd5ae39 --- /dev/null +++ b/docs/ManagementProjectsBrandingCreateRequestBodyContact.md @@ -0,0 +1,14 @@ +# ManagementProjectsBrandingCreateRequestBodyContact + +Defines contact details. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**email** | **str** | Defines the brand's email address. It must be a valid email format. | [optional] +**phone** | **str** | Defines the brand's phone number. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ManagementProjectsBrandingCreateResponseBody.md b/docs/ManagementProjectsBrandingCreateResponseBody.md new file mode 100644 index 00000000..2b69f5bb --- /dev/null +++ b/docs/ManagementProjectsBrandingCreateResponseBody.md @@ -0,0 +1,17 @@ +# ManagementProjectsBrandingCreateResponseBody + +Response body schema for **POST** `v1/management/v1/projects/{projectId}/branding`. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **str** | Unique identifier of the brand configuration. | [optional] +**brand** | [**ManagementProjectsBrandingCreateResponseBodyBrand**](ManagementProjectsBrandingCreateResponseBodyBrand.md) | | [optional] +**address** | [**ManagementProjectsBrandingCreateResponseBodyAddress**](ManagementProjectsBrandingCreateResponseBodyAddress.md) | | [optional] +**contact** | [**ManagementProjectsBrandingCreateResponseBodyContact**](ManagementProjectsBrandingCreateResponseBodyContact.md) | | [optional] +**cockpits** | [**ManagementProjectsBrandingCreateResponseBodyCockpits**](ManagementProjectsBrandingCreateResponseBodyCockpits.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ManagementProjectsBrandingCreateResponseBodyAddress.md b/docs/ManagementProjectsBrandingCreateResponseBodyAddress.md new file mode 100644 index 00000000..bee9d70a --- /dev/null +++ b/docs/ManagementProjectsBrandingCreateResponseBodyAddress.md @@ -0,0 +1,17 @@ +# ManagementProjectsBrandingCreateResponseBodyAddress + +Defines the address details. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**street** | **str** | Defines the brand's street. | [optional] +**city** | **str** | Defines the brand's city. | [optional] +**postal** | **str** | Defines the brand's postal code. | [optional] +**state** | **str** | Defines the brand's state or similar administrative area. | [optional] +**country** | **str** | Defines the brand's country. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ManagementProjectsBrandingCreateResponseBodyBrand.md b/docs/ManagementProjectsBrandingCreateResponseBodyBrand.md new file mode 100644 index 00000000..42463cd7 --- /dev/null +++ b/docs/ManagementProjectsBrandingCreateResponseBodyBrand.md @@ -0,0 +1,17 @@ +# ManagementProjectsBrandingCreateResponseBodyBrand + +Defines basic brand details. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **str** | Defines brand name. | [optional] +**privacy_policy_url** | **str** | Defines the URL to the brand's privacy policy. It must be a valid URL format. | [optional] +**terms_of_use_url** | **str** | Defines the URL to the brand's terms of use. It must be a valid URL format. | [optional] +**permission_reminder** | **str** | Defines the message that is displayed to customers who opted in an email newsletter. | [optional] +**website_url** | **str** | Defines the URL to the brand's website. It must be a valid URL format. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ManagementProjectsBrandingCreateResponseBodyCockpits.md b/docs/ManagementProjectsBrandingCreateResponseBodyCockpits.md new file mode 100644 index 00000000..febc2743 --- /dev/null +++ b/docs/ManagementProjectsBrandingCreateResponseBodyCockpits.md @@ -0,0 +1,20 @@ +# ManagementProjectsBrandingCreateResponseBodyCockpits + +Defines customer cockpit details. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**campaigns_overview_enabled** | **bool** | Enables the campaign overview for customers. | [optional] +**loyalty_enabled** | **bool** | Enables the loyalty campaign overview for customers. | [optional] +**gift_cards_enabled** | **bool** | Enables the gift card overview for customers. | [optional] +**coupons_enabled** | **bool** | Enables the discount coupon overview for customers. | [optional] +**referrals_enabled** | **bool** | Enables the referral campaign overview for customers. | [optional] +**theme** | **str** | Determines the color scheme of the customer cockpit. | [optional] +**use_custom_double_opt_in_redirect_url** | **bool** | Enables the double opt-in option. It must be a valid URL format. | [optional] +**custom_double_opt_in_redirect_url** | **str** | Defines the URL for the double opt-in consent. It must be a valid URL format. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ManagementProjectsBrandingCreateResponseBodyContact.md b/docs/ManagementProjectsBrandingCreateResponseBodyContact.md new file mode 100644 index 00000000..b6d915b1 --- /dev/null +++ b/docs/ManagementProjectsBrandingCreateResponseBodyContact.md @@ -0,0 +1,14 @@ +# ManagementProjectsBrandingCreateResponseBodyContact + +Defines contact details. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**email** | **str** | Defines the brand's email address. It must be a valid email format. | [optional] +**phone** | **str** | Defines the brand's phone number. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ManagementProjectsBrandingGetResponseBody.md b/docs/ManagementProjectsBrandingGetResponseBody.md new file mode 100644 index 00000000..2a039fe2 --- /dev/null +++ b/docs/ManagementProjectsBrandingGetResponseBody.md @@ -0,0 +1,17 @@ +# ManagementProjectsBrandingGetResponseBody + +Response body schema for **GET** `v1/management/v1/projects/{projectId}/branding/{brandingId}`. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **str** | Unique identifier of the brand configuration. | [optional] +**brand** | [**ManagementProjectsBrandingGetResponseBodyBrand**](ManagementProjectsBrandingGetResponseBodyBrand.md) | | [optional] +**address** | [**ManagementProjectsBrandingGetResponseBodyAddress**](ManagementProjectsBrandingGetResponseBodyAddress.md) | | [optional] +**contact** | [**ManagementProjectsBrandingGetResponseBodyContact**](ManagementProjectsBrandingGetResponseBodyContact.md) | | [optional] +**cockpits** | [**ManagementProjectsBrandingGetResponseBodyCockpits**](ManagementProjectsBrandingGetResponseBodyCockpits.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ManagementProjectsBrandingGetResponseBodyAddress.md b/docs/ManagementProjectsBrandingGetResponseBodyAddress.md new file mode 100644 index 00000000..7e564d28 --- /dev/null +++ b/docs/ManagementProjectsBrandingGetResponseBodyAddress.md @@ -0,0 +1,17 @@ +# ManagementProjectsBrandingGetResponseBodyAddress + +Defines the address details. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**street** | **str** | Defines the brand's street. | [optional] +**city** | **str** | Defines the brand's city. | [optional] +**postal** | **str** | Defines the brand's postal code. | [optional] +**state** | **str** | Defines the brand's state or similar administrative area. | [optional] +**country** | **str** | Defines the brand's country. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ManagementProjectsBrandingGetResponseBodyBrand.md b/docs/ManagementProjectsBrandingGetResponseBodyBrand.md new file mode 100644 index 00000000..7638f327 --- /dev/null +++ b/docs/ManagementProjectsBrandingGetResponseBodyBrand.md @@ -0,0 +1,17 @@ +# ManagementProjectsBrandingGetResponseBodyBrand + +Defines basic brand details. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **str** | Defines brand name. | [optional] +**privacy_policy_url** | **str** | Defines the URL to the brand's privacy policy. It must be a valid URL format. | [optional] +**terms_of_use_url** | **str** | Defines the URL to the brand's terms of use. It must be a valid URL format. | [optional] +**permission_reminder** | **str** | Defines the message that is displayed to customers who opted in an email newsletter. | [optional] +**website_url** | **str** | Defines the URL to the brand's website. It must be a valid URL format. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ManagementProjectsBrandingGetResponseBodyCockpits.md b/docs/ManagementProjectsBrandingGetResponseBodyCockpits.md new file mode 100644 index 00000000..9e9b80ab --- /dev/null +++ b/docs/ManagementProjectsBrandingGetResponseBodyCockpits.md @@ -0,0 +1,20 @@ +# ManagementProjectsBrandingGetResponseBodyCockpits + +Defines customer cockpit details. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**campaigns_overview_enabled** | **bool** | Enables the campaign overview for customers. | [optional] +**loyalty_enabled** | **bool** | Enables the loyalty campaign overview for customers. | [optional] +**gift_cards_enabled** | **bool** | Enables the gift card overview for customers. | [optional] +**coupons_enabled** | **bool** | Enables the discount coupon overview for customers. | [optional] +**referrals_enabled** | **bool** | Enables the referral campaign overview for customers. | [optional] +**theme** | **str** | Determines the color scheme of the customer cockpit. | [optional] +**use_custom_double_opt_in_redirect_url** | **bool** | Enables the double opt-in option. It must be a valid URL format. | [optional] +**custom_double_opt_in_redirect_url** | **str** | Defines the URL for the double opt-in consent. It must be a valid URL format. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ManagementProjectsBrandingGetResponseBodyContact.md b/docs/ManagementProjectsBrandingGetResponseBodyContact.md new file mode 100644 index 00000000..7daece19 --- /dev/null +++ b/docs/ManagementProjectsBrandingGetResponseBodyContact.md @@ -0,0 +1,14 @@ +# ManagementProjectsBrandingGetResponseBodyContact + +Defines contact details. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**email** | **str** | Defines the brand's email address. It must be a valid email format. | [optional] +**phone** | **str** | Defines the brand's phone number. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ManagementProjectsBrandingListResponseBody.md b/docs/ManagementProjectsBrandingListResponseBody.md new file mode 100644 index 00000000..764a4876 --- /dev/null +++ b/docs/ManagementProjectsBrandingListResponseBody.md @@ -0,0 +1,16 @@ +# ManagementProjectsBrandingListResponseBody + +Object containing a list of brand configurations. It always contains one item. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**object** | **str** | The type of the object represented by JSON. This object stores information about the brand in a dictionary. | [optional] [default to 'list'] +**data_ref** | **str** | Identifies the name of the attribute that contains the array of brand objects. | [optional] [default to 'data'] +**data** | [**List[ManagementProjectsBranding]**](ManagementProjectsBranding.md) | Array of brand objects. It contains only one object. | [optional] +**total** | **int** | The total number of brand objects. It is always `1`. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ManagementProjectsBrandingUpdateRequestBody.md b/docs/ManagementProjectsBrandingUpdateRequestBody.md new file mode 100644 index 00000000..1ffdbc0f --- /dev/null +++ b/docs/ManagementProjectsBrandingUpdateRequestBody.md @@ -0,0 +1,15 @@ +# ManagementProjectsBrandingUpdateRequestBody + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**brand** | [**ManagementProjectsBrandingUpdateRequestBodyBrand**](ManagementProjectsBrandingUpdateRequestBodyBrand.md) | | [optional] +**address** | [**ManagementProjectsBrandingUpdateRequestBodyAddress**](ManagementProjectsBrandingUpdateRequestBodyAddress.md) | | [optional] +**contact** | [**ManagementProjectsBrandingUpdateRequestBodyContact**](ManagementProjectsBrandingUpdateRequestBodyContact.md) | | [optional] +**cockpits** | [**ManagementProjectsBrandingUpdateRequestBodyCockpits**](ManagementProjectsBrandingUpdateRequestBodyCockpits.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ManagementProjectsBrandingUpdateRequestBodyAddress.md b/docs/ManagementProjectsBrandingUpdateRequestBodyAddress.md new file mode 100644 index 00000000..8f0264b1 --- /dev/null +++ b/docs/ManagementProjectsBrandingUpdateRequestBodyAddress.md @@ -0,0 +1,17 @@ +# ManagementProjectsBrandingUpdateRequestBodyAddress + +Defines the address details. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**street** | **str** | Defines the brand's street. | [optional] +**city** | **str** | Defines the brand's city. | [optional] +**postal** | **str** | Defines the brand's postal code | [optional] +**state** | **str** | Defines the brand's state or similar administrative area. | [optional] +**country** | **str** | Defines the brand's country. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ManagementProjectsBrandingUpdateRequestBodyBrand.md b/docs/ManagementProjectsBrandingUpdateRequestBodyBrand.md new file mode 100644 index 00000000..1993353d --- /dev/null +++ b/docs/ManagementProjectsBrandingUpdateRequestBodyBrand.md @@ -0,0 +1,17 @@ +# ManagementProjectsBrandingUpdateRequestBodyBrand + +Defines basic brand details. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **str** | Defines brand name. | [optional] +**privacy_policy_url** | **str** | Defines the URL to the brand's privacy policy. | [optional] +**terms_of_use_url** | **str** | Defines the URL to the brand's terms of use. | [optional] +**permission_reminder** | **str** | Defines the message that is displayed to customers who opted in an email newsletter. | [optional] +**website_url** | **str** | Defines the URL to the brand's website. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ManagementProjectsBrandingUpdateRequestBodyCockpits.md b/docs/ManagementProjectsBrandingUpdateRequestBodyCockpits.md new file mode 100644 index 00000000..e3e28e82 --- /dev/null +++ b/docs/ManagementProjectsBrandingUpdateRequestBodyCockpits.md @@ -0,0 +1,20 @@ +# ManagementProjectsBrandingUpdateRequestBodyCockpits + +Defines customer cockpit details. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**campaigns_overview_enabled** | **bool** | Indicates if the campaign overview is turned on for customers. | [optional] +**loyalty_enabled** | **bool** | Indicates if the loyalty campaign overview is turned on for customers. | [optional] +**gift_cards_enabled** | **bool** | Indicates if the gift card overview is turned on for customers. | [optional] +**coupons_enabled** | **bool** | Indicates if the discount coupon overview is turned on for customers. | [optional] +**referrals_enabled** | **bool** | Indicates if the referral campaign overview is turned on for customers. | [optional] +**theme** | **str** | Determines the color scheme of the customer cockpit. | [optional] +**use_custom_double_opt_in_redirect_url** | **bool** | Indicates if the double opt-in option is turned on. | [optional] +**custom_double_opt_in_redirect_url** | **str** | Defines the URL for the double opt-in consent. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ManagementProjectsBrandingUpdateRequestBodyContact.md b/docs/ManagementProjectsBrandingUpdateRequestBodyContact.md new file mode 100644 index 00000000..4b4ec3d2 --- /dev/null +++ b/docs/ManagementProjectsBrandingUpdateRequestBodyContact.md @@ -0,0 +1,14 @@ +# ManagementProjectsBrandingUpdateRequestBodyContact + +Defines contact details. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**email** | **str** | Defines the brand's email address. It must be a valid email format. | [optional] +**phone** | **str** | Defines the brand's phone number. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ManagementProjectsBrandingUpdateResponseBody.md b/docs/ManagementProjectsBrandingUpdateResponseBody.md new file mode 100644 index 00000000..7e928aa1 --- /dev/null +++ b/docs/ManagementProjectsBrandingUpdateResponseBody.md @@ -0,0 +1,17 @@ +# ManagementProjectsBrandingUpdateResponseBody + +Response body schema for **PUT** `v1/management/v1/projects/{projectId}/branding/{brandingId}`. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **str** | Unique identifier of the brand configuration. | [optional] +**brand** | [**ManagementProjectsBrandingUpdateResponseBodyBrand**](ManagementProjectsBrandingUpdateResponseBodyBrand.md) | | [optional] +**address** | [**ManagementProjectsBrandingUpdateResponseBodyAddress**](ManagementProjectsBrandingUpdateResponseBodyAddress.md) | | [optional] +**contact** | [**ManagementProjectsBrandingUpdateResponseBodyContact**](ManagementProjectsBrandingUpdateResponseBodyContact.md) | | [optional] +**cockpits** | [**ManagementProjectsBrandingUpdateResponseBodyCockpits**](ManagementProjectsBrandingUpdateResponseBodyCockpits.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ManagementProjectsBrandingUpdateResponseBodyAddress.md b/docs/ManagementProjectsBrandingUpdateResponseBodyAddress.md new file mode 100644 index 00000000..eb0f3f02 --- /dev/null +++ b/docs/ManagementProjectsBrandingUpdateResponseBodyAddress.md @@ -0,0 +1,17 @@ +# ManagementProjectsBrandingUpdateResponseBodyAddress + +Defines the address details. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**street** | **str** | Defines the brand's street. | [optional] +**city** | **str** | Defines the brand's city. | [optional] +**postal** | **str** | Defines the brand's postal code. | [optional] +**state** | **str** | Defines the brand's state or similar administrative area. | [optional] +**country** | **str** | Defines the brand's country. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ManagementProjectsBrandingUpdateResponseBodyBrand.md b/docs/ManagementProjectsBrandingUpdateResponseBodyBrand.md new file mode 100644 index 00000000..2071520a --- /dev/null +++ b/docs/ManagementProjectsBrandingUpdateResponseBodyBrand.md @@ -0,0 +1,17 @@ +# ManagementProjectsBrandingUpdateResponseBodyBrand + +Defines basic brand details. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **str** | Defines brand name. | [optional] +**privacy_policy_url** | **str** | Defines the URL to the brand's privacy policy. It must be a valid URL format. | [optional] +**terms_of_use_url** | **str** | Defines the URL to the brand's terms of use. It must be a valid URL format. | [optional] +**permission_reminder** | **str** | Defines the message that is displayed to customers who opted in an email newsletter. | [optional] +**website_url** | **str** | Defines the URL to the brand's website. It must be a valid URL format. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ManagementProjectsBrandingUpdateResponseBodyCockpits.md b/docs/ManagementProjectsBrandingUpdateResponseBodyCockpits.md new file mode 100644 index 00000000..c8d181fd --- /dev/null +++ b/docs/ManagementProjectsBrandingUpdateResponseBodyCockpits.md @@ -0,0 +1,20 @@ +# ManagementProjectsBrandingUpdateResponseBodyCockpits + +Defines customer cockpit details. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**campaigns_overview_enabled** | **bool** | Enables the campaign overview for customers. | [optional] +**loyalty_enabled** | **bool** | Enables the loyalty campaign overview for customers. | [optional] +**gift_cards_enabled** | **bool** | Enables the gift card overview for customers. | [optional] +**coupons_enabled** | **bool** | Enables the discount coupon overview for customers. | [optional] +**referrals_enabled** | **bool** | Enables the referral campaign overview for customers. | [optional] +**theme** | **str** | Determines the color scheme of the customer cockpit. | [optional] +**use_custom_double_opt_in_redirect_url** | **bool** | Enables the double opt-in option. It must be a valid URL format. | [optional] +**custom_double_opt_in_redirect_url** | **str** | Defines the URL for the double opt-in consent. It must be a valid URL format. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ManagementProjectsBrandingUpdateResponseBodyContact.md b/docs/ManagementProjectsBrandingUpdateResponseBodyContact.md new file mode 100644 index 00000000..6ffe98ad --- /dev/null +++ b/docs/ManagementProjectsBrandingUpdateResponseBodyContact.md @@ -0,0 +1,14 @@ +# ManagementProjectsBrandingUpdateResponseBodyContact + +Defines contact details. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**email** | **str** | Defines the brand's email address. It must be a valid email format. | [optional] +**phone** | **str** | Defines the brand's phone number. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ManagementProjectsCreateRequestBody.md b/docs/ManagementProjectsCreateRequestBody.md new file mode 100644 index 00000000..24692707 --- /dev/null +++ b/docs/ManagementProjectsCreateRequestBody.md @@ -0,0 +1,31 @@ +# ManagementProjectsCreateRequestBody + +Request body schema for **POST** `v1/management/v1/projects`. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**case_sensitive_codes** | **bool** | Determines if the vouchers in the project will be case sensitive (if `true`, `C0dE-cfV` is not equal to `c0de-cfv`) or case insensitive (if false, `C0dE-cfV` is equal to `c0de-cfv`). | [optional] +**name** | **str** | The name of the project. | [optional] +**description** | **str** | A user-defined description of the project, e.g. its purpose, scope, region. | [optional] +**timezone** | **str** | The time zone in which the project is established. It can be in the GMT format or in accordance with IANA time zone database. | [optional] +**currency** | **str** | The currency used in the project. It is equal to a 3-letter ISO 4217 code. | [optional] +**dial_code** | **str** | The country dial code for the project. It is equal to an ITU country code. | [optional] +**webhook_version** | **str** | The webhook version used in the project. | [optional] [default to 'v2024-01-01'] +**client_trusted_domains** | **List[str]** | An array of URL addresses that allow client requests. | [optional] +**client_redeem_enabled** | **bool** | Enables client-side redemption. | [optional] +**client_publish_enabled** | **bool** | Enables client-side publication. | [optional] +**client_list_vouchers_enabled** | **bool** | Enables client-side listing of vouchers. | [optional] +**client_create_customer_enabled** | **bool** | Enables client-side creation of customers. | [optional] +**client_loyalty_events_enabled** | **bool** | Enables client-side events for loyalty and referral programs. | [optional] +**client_set_voucher_expiration_date_enabled** | **bool** | Enables client-side setting of voucher expiration date. | [optional] +**api_usage_notifications** | [**ManagementProjectsCreateRequestBodyApiUsageNotifications**](ManagementProjectsCreateRequestBodyApiUsageNotifications.md) | | [optional] +**webhooks_callout_notifications** | [**ManagementProjectsCreateRequestBodyWebhooksCalloutNotifications**](ManagementProjectsCreateRequestBodyWebhooksCalloutNotifications.md) | | [optional] +**cluster_id** | **str** | The identifier of the cluster where the project will be created. The default cluster is `eu1` unless otherwise configured. | [optional] +**api_version** | **str** | The API version used in the project. Currently, the default and only value is `v2018-08-01`. | [optional] [default to 'v2018-08-01'] +**users** | [**List[ManagementProjectsCreateRequestBodyUsersItem]**](ManagementProjectsCreateRequestBodyUsersItem.md) | The users (their identifiers, logins, and roles) who will be assigned to the project. You can assign only existing Voucherify users. It must be used either in the following combinations: - `id` and `role`, or - `login` and `role`. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ManagementProjectsCreateRequestBodyApiUsageNotifications.md b/docs/ManagementProjectsCreateRequestBodyApiUsageNotifications.md new file mode 100644 index 00000000..c3c404e8 --- /dev/null +++ b/docs/ManagementProjectsCreateRequestBodyApiUsageNotifications.md @@ -0,0 +1,18 @@ +# ManagementProjectsCreateRequestBodyApiUsageNotifications + +Determines the notification settings. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**redemptions** | [**UsageNotifications**](UsageNotifications.md) | | [optional] +**messages** | [**UsageNotifications**](UsageNotifications.md) | | [optional] +**api_calls** | [**UsageNotifications**](UsageNotifications.md) | | [optional] +**bulk_api_calls** | [**UsageNotifications**](UsageNotifications.md) | | [optional] +**webhook_calls** | [**UsageNotifications**](UsageNotifications.md) | | [optional] +**cycle_calls** | [**UsageNotifications**](UsageNotifications.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ManagementProjectsCreateRequestBodyUsersItem.md b/docs/ManagementProjectsCreateRequestBodyUsersItem.md new file mode 100644 index 00000000..62e68176 --- /dev/null +++ b/docs/ManagementProjectsCreateRequestBodyUsersItem.md @@ -0,0 +1,15 @@ +# ManagementProjectsCreateRequestBodyUsersItem + +Contains details about the users who will be assigned to the project. Only the `id` and `role` or `login` and `role` should be provided in the request. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **str** | The unique identifier of the user who will be assigned to the project. It can be found in Team Settings > Team > Edit member. **Required** with the `role` string. Do **not** use with the `login` string. | [optional] +**login** | **str** | The login data of the user who will be assigned to the project. **Required** with the `role` string. Do **not** use with the `id` string. | [optional] +**role** | **str** | The role of the user to be added. It can be one of the following predefined roles: `ADMIN`, `USER`, `VIEWER`, `MERCHANT` or an ID of a custom role. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ManagementProjectsCreateRequestBodyWebhooksCalloutNotifications.md b/docs/ManagementProjectsCreateRequestBodyWebhooksCalloutNotifications.md new file mode 100644 index 00000000..106f5e02 --- /dev/null +++ b/docs/ManagementProjectsCreateRequestBodyWebhooksCalloutNotifications.md @@ -0,0 +1,14 @@ +# ManagementProjectsCreateRequestBodyWebhooksCalloutNotifications + +Determines the notification settings for webhook callouts configured in Distributions and Project settings. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**distributions** | [**ManagementProjectsCreateRequestBodyWebhooksCalloutNotificationsDistributions**](ManagementProjectsCreateRequestBodyWebhooksCalloutNotificationsDistributions.md) | | [optional] +**webhooks** | [**ManagementProjectsCreateRequestBodyWebhooksCalloutNotificationsWebhooks**](ManagementProjectsCreateRequestBodyWebhooksCalloutNotificationsWebhooks.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ManagementProjectsCreateRequestBodyWebhooksCalloutNotificationsDistributions.md b/docs/ManagementProjectsCreateRequestBodyWebhooksCalloutNotificationsDistributions.md new file mode 100644 index 00000000..fb064d57 --- /dev/null +++ b/docs/ManagementProjectsCreateRequestBodyWebhooksCalloutNotificationsDistributions.md @@ -0,0 +1,15 @@ +# ManagementProjectsCreateRequestBodyWebhooksCalloutNotificationsDistributions + +Determines the notification settings for webhooks sent through Distributions. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**email** | **bool** | Enables the notification through an email. | [optional] +**in_app** | **bool** | Enables the notification through an email. | [optional] +**emails** | **List[str]** | An array of email addresses which will receive the notification. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ManagementProjectsCreateRequestBodyWebhooksCalloutNotificationsWebhooks.md b/docs/ManagementProjectsCreateRequestBodyWebhooksCalloutNotificationsWebhooks.md new file mode 100644 index 00000000..2222efce --- /dev/null +++ b/docs/ManagementProjectsCreateRequestBodyWebhooksCalloutNotificationsWebhooks.md @@ -0,0 +1,15 @@ +# ManagementProjectsCreateRequestBodyWebhooksCalloutNotificationsWebhooks + +Determines the notification settings for webhooks sent as set out in the Project settings. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**email** | **bool** | Enables the notification through an email. | [optional] +**in_app** | **bool** | Enables the notification through an email. | [optional] +**emails** | **List[str]** | An array of email addresses which will receive the notification. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ManagementProjectsCreateResponseBody.md b/docs/ManagementProjectsCreateResponseBody.md new file mode 100644 index 00000000..7ca0ae3c --- /dev/null +++ b/docs/ManagementProjectsCreateResponseBody.md @@ -0,0 +1,35 @@ +# ManagementProjectsCreateResponseBody + +Response body schema for **POST** `management/v1/projects`. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **str** | Unique identifier of the project. | [optional] +**name** | **str** | The name of the project. | [optional] +**description** | **str** | A user-defined description of the project, e.g. its purpose, scope, region. | [optional] +**timezone** | **str** | The time zone in which the project is established. It can be in the GMT format or in accordance with IANA time zone database. | [optional] +**currency** | **str** | The currency used in the project. It is equal to a 3-letter ISO 4217 code. | [optional] +**dial_code** | **str** | The country dial code for the project. It is equal to an ITU country code. | [optional] +**webhook_version** | **str** | The webhook version used in the project. | [optional] [default to 'v2024-01-01'] +**client_trusted_domains** | **List[str]** | An array of URL addresses that allow client requests. | [optional] +**client_redeem_enabled** | **bool** | Enables client-side redemption. | [optional] +**client_publish_enabled** | **bool** | Enables client-side publication. | [optional] +**client_list_vouchers_enabled** | **bool** | Enables client-side listing of vouchers. | [optional] +**client_create_customer_enabled** | **bool** | Enables client-side creation of customers. | [optional] +**client_loyalty_events_enabled** | **bool** | Enables client-side events for loyalty and referral programs. | [optional] +**client_set_voucher_expiration_date_enabled** | **bool** | Enables client-side setting of voucher expiration date. | [optional] +**api_usage_notifications** | [**ManagementProjectsCreateResponseBodyApiUsageNotifications**](ManagementProjectsCreateResponseBodyApiUsageNotifications.md) | | [optional] +**webhooks_callout_notifications** | [**ManagementProjectsCreateResponseBodyWebhooksCalloutNotifications**](ManagementProjectsCreateResponseBodyWebhooksCalloutNotifications.md) | | [optional] +**cluster_id** | **str** | The identifier of the cluster where the project will be created. | [optional] +**case_sensitive_codes** | **bool** | Determines if the vouchers in the project will be: - case sensitive - if `true`, `C0dE-cfV` is **not** equal to `c0de-cfv`), - case insensitive - if `false`, `C0dE-cfV` is equal to `c0de-cfv`. | [optional] +**api_version** | **str** | The API version used in the project. Currently, the default and only value is `v2018-08-01`. | [optional] [default to 'v2018-08-01'] +**is_sandbox** | **bool** | Determines if the project is a sandbox project. | [optional] +**webhook_token** | **str** | Webhook token used for authentication. | [optional] +**server_side_key** | [**ManagementProjectsCreateResponseBodyServerSideKey**](ManagementProjectsCreateResponseBodyServerSideKey.md) | | [optional] +**client_side_key** | [**ManagementProjectsCreateResponseBodyClientSideKey**](ManagementProjectsCreateResponseBodyClientSideKey.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ManagementProjectsCreateResponseBodyApiUsageNotifications.md b/docs/ManagementProjectsCreateResponseBodyApiUsageNotifications.md new file mode 100644 index 00000000..ac0be035 --- /dev/null +++ b/docs/ManagementProjectsCreateResponseBodyApiUsageNotifications.md @@ -0,0 +1,18 @@ +# ManagementProjectsCreateResponseBodyApiUsageNotifications + +Determines the notification settings. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**redemptions** | [**UsageNotifications**](UsageNotifications.md) | | [optional] +**messages** | [**UsageNotifications**](UsageNotifications.md) | | [optional] +**api_calls** | [**UsageNotifications**](UsageNotifications.md) | | [optional] +**bulk_api_calls** | [**UsageNotifications**](UsageNotifications.md) | | [optional] +**webhook_calls** | [**UsageNotifications**](UsageNotifications.md) | | [optional] +**cycle_calls** | [**UsageNotifications**](UsageNotifications.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ManagementProjectsCreateResponseBodyClientSideKey.md b/docs/ManagementProjectsCreateResponseBodyClientSideKey.md new file mode 100644 index 00000000..bf0c99fc --- /dev/null +++ b/docs/ManagementProjectsCreateResponseBodyClientSideKey.md @@ -0,0 +1,14 @@ +# ManagementProjectsCreateResponseBodyClientSideKey + +Contains the `app_id` and `app_token` to authenticate client-side requests. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**app_id** | **str** | Application ID to be used as `X-App-Id` header in every HTTP request. | [optional] +**app_token** | **str** | Application token to be used as `X-App-Token` header in every HTTP request. The application token (secret key) for the client-side authentication is visible in the Project Settings for 14 days when it is first generated in a newly-created project. Write your application token down and keep it in a safe place. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ManagementProjectsCreateResponseBodyServerSideKey.md b/docs/ManagementProjectsCreateResponseBodyServerSideKey.md new file mode 100644 index 00000000..6efadc3b --- /dev/null +++ b/docs/ManagementProjectsCreateResponseBodyServerSideKey.md @@ -0,0 +1,14 @@ +# ManagementProjectsCreateResponseBodyServerSideKey + +Contains the `app_id` and `app_token` to authenticate server-side requests. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**app_id** | **str** | Application ID to be used as `X-App-Id` header in every HTTP request. | [optional] +**app_token** | **str** | Application token to be used as `X-App-Token` header in every HTTP request. The application token (secret key) for the server-side authentication is visible in the Project Settings for 14 days when it is first generated in a newly-created project. Write your application token down and keep it in a safe place. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ManagementProjectsCreateResponseBodyWebhooksCalloutNotifications.md b/docs/ManagementProjectsCreateResponseBodyWebhooksCalloutNotifications.md new file mode 100644 index 00000000..97b1ea67 --- /dev/null +++ b/docs/ManagementProjectsCreateResponseBodyWebhooksCalloutNotifications.md @@ -0,0 +1,14 @@ +# ManagementProjectsCreateResponseBodyWebhooksCalloutNotifications + +Determines the notification settings for webhook callouts configured in Distributions and Project settings. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**distributions** | [**ManagementProjectsCreateResponseBodyWebhooksCalloutNotificationsDistributions**](ManagementProjectsCreateResponseBodyWebhooksCalloutNotificationsDistributions.md) | | [optional] +**webhooks** | [**ManagementProjectsCreateResponseBodyWebhooksCalloutNotificationsWebhooks**](ManagementProjectsCreateResponseBodyWebhooksCalloutNotificationsWebhooks.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ManagementProjectsCreateResponseBodyWebhooksCalloutNotificationsDistributions.md b/docs/ManagementProjectsCreateResponseBodyWebhooksCalloutNotificationsDistributions.md new file mode 100644 index 00000000..d5d3ac25 --- /dev/null +++ b/docs/ManagementProjectsCreateResponseBodyWebhooksCalloutNotificationsDistributions.md @@ -0,0 +1,15 @@ +# ManagementProjectsCreateResponseBodyWebhooksCalloutNotificationsDistributions + +Determines the notification settings for webhooks sent through Distributions. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**email** | **bool** | Enables the notification through an email. | [optional] +**in_app** | **bool** | Enables the notification through an email. | [optional] +**emails** | **List[str]** | An array of email addresses which will receive the notification. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ManagementProjectsCreateResponseBodyWebhooksCalloutNotificationsWebhooks.md b/docs/ManagementProjectsCreateResponseBodyWebhooksCalloutNotificationsWebhooks.md new file mode 100644 index 00000000..cbe1d213 --- /dev/null +++ b/docs/ManagementProjectsCreateResponseBodyWebhooksCalloutNotificationsWebhooks.md @@ -0,0 +1,15 @@ +# ManagementProjectsCreateResponseBodyWebhooksCalloutNotificationsWebhooks + +Determines the notification settings for webhooks sent as set out in the Project settings. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**email** | **bool** | Enables the notification through an email. | [optional] +**in_app** | **bool** | Enables the notification through an email. | [optional] +**emails** | **List[str]** | An array of email addresses which will receive the notification. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ManagementProjectsCustomEventSchema.md b/docs/ManagementProjectsCustomEventSchema.md new file mode 100644 index 00000000..35dbbe60 --- /dev/null +++ b/docs/ManagementProjectsCustomEventSchema.md @@ -0,0 +1,18 @@ +# ManagementProjectsCustomEventSchema + +Object containing the response to creating a custom event schema. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **str** | Unique identifier of the custom event schema. | [optional] +**name** | **str** | User-defined name of the custom event. This is also shown in **Project Settings** > **Event Schema** in the Voucherify Dashboard. | [optional] +**var_schema** | [**ManagementProjectsCustomEventSchemaSchema**](ManagementProjectsCustomEventSchemaSchema.md) | | [optional] +**created_at** | **datetime** | Timestamp representing the date and time when the custom event schema was created. The value is shown in the ISO 8601 format. | [optional] +**updated_at** | **datetime** | Timestamp representing the date and time when the custom event schema was updated. The value is shown in the ISO 8601 format. | [optional] +**object** | **str** | The type of the object represented by JSON. | [optional] [default to 'custom-event-schema'] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ManagementProjectsCustomEventSchemaSchema.md b/docs/ManagementProjectsCustomEventSchemaSchema.md new file mode 100644 index 00000000..4ad03950 --- /dev/null +++ b/docs/ManagementProjectsCustomEventSchemaSchema.md @@ -0,0 +1,13 @@ +# ManagementProjectsCustomEventSchemaSchema + +Object containing custom event schema and its custom attributes (metadata). + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**properties** | **object** | Defines custom event custom attributes (metadata). | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ManagementProjectsCustomEventSchemasCreateRequestBody.md b/docs/ManagementProjectsCustomEventSchemasCreateRequestBody.md new file mode 100644 index 00000000..64fd0470 --- /dev/null +++ b/docs/ManagementProjectsCustomEventSchemasCreateRequestBody.md @@ -0,0 +1,14 @@ +# ManagementProjectsCustomEventSchemasCreateRequestBody + +Request body schema for **POST** `v1/management/v1/projects/{projectId}/custom-event-schema`. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **str** | User-defined name of the custom event. This is also shown in **Project Settings** > **Event Schema** in the Voucherify Dashboard. | [optional] +**var_schema** | [**ManagementProjectsCustomEventSchemasCreateRequestBodySchema**](ManagementProjectsCustomEventSchemasCreateRequestBodySchema.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ManagementProjectsCustomEventSchemasCreateRequestBodySchema.md b/docs/ManagementProjectsCustomEventSchemasCreateRequestBodySchema.md new file mode 100644 index 00000000..bc6b6f09 --- /dev/null +++ b/docs/ManagementProjectsCustomEventSchemasCreateRequestBodySchema.md @@ -0,0 +1,13 @@ +# ManagementProjectsCustomEventSchemasCreateRequestBodySchema + +Object containing custom event schema and its custom attributes (metadata). + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**properties** | **object** | Defines custom event custom attributes (metadata). | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ManagementProjectsCustomEventSchemasCreateResponseBody.md b/docs/ManagementProjectsCustomEventSchemasCreateResponseBody.md new file mode 100644 index 00000000..3ef7e6b2 --- /dev/null +++ b/docs/ManagementProjectsCustomEventSchemasCreateResponseBody.md @@ -0,0 +1,18 @@ +# ManagementProjectsCustomEventSchemasCreateResponseBody + +Response body schema for **POST** `v1/management/v1/projects/{projectId}/custom-event-schema`. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **str** | Unique identifier of the custom event schema. | [optional] +**name** | **str** | User-defined name of the custom event. This is also shown in **Project Settings** > **Event Schema** in the Voucherify Dashboard. | [optional] +**var_schema** | [**ManagementProjectsCustomEventSchemasCreateResponseBodySchema**](ManagementProjectsCustomEventSchemasCreateResponseBodySchema.md) | | [optional] +**created_at** | **datetime** | Timestamp representing the date and time when the custom event schema was created. The value is shown in the ISO 8601 format. | [optional] +**updated_at** | **datetime** | Timestamp representing the date and time when the custom event schema was updated. The value is shown in the ISO 8601 format. | [optional] +**object** | **str** | The type of the object represented by JSON. | [optional] [default to 'custom-event-schema'] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ManagementProjectsCustomEventSchemasCreateResponseBodySchema.md b/docs/ManagementProjectsCustomEventSchemasCreateResponseBodySchema.md new file mode 100644 index 00000000..94a6cbba --- /dev/null +++ b/docs/ManagementProjectsCustomEventSchemasCreateResponseBodySchema.md @@ -0,0 +1,13 @@ +# ManagementProjectsCustomEventSchemasCreateResponseBodySchema + +Object containing custom event schema and its custom attributes (metadata). + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**properties** | **object** | Defines custom event custom attributes (metadata). | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ManagementProjectsCustomEventSchemasGetResponseBody.md b/docs/ManagementProjectsCustomEventSchemasGetResponseBody.md new file mode 100644 index 00000000..d39a72fb --- /dev/null +++ b/docs/ManagementProjectsCustomEventSchemasGetResponseBody.md @@ -0,0 +1,18 @@ +# ManagementProjectsCustomEventSchemasGetResponseBody + +Response body schema for **GET** `v1/management/v1/projects/{projectId}/custom-event-schema/{customEventSchemaId}`. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **str** | Unique identifier of the custom event schema. | [optional] +**name** | **str** | User-defined name of the custom event. This is also shown in **Project Settings** > **Event Schema** in the Voucherify Dashboard. | [optional] +**var_schema** | [**ManagementProjectsCustomEventSchemasGetResponseBodySchema**](ManagementProjectsCustomEventSchemasGetResponseBodySchema.md) | | [optional] +**created_at** | **datetime** | Timestamp representing the date and time when the custom event schema was created. The value is shown in the ISO 8601 format. | [optional] +**updated_at** | **datetime** | Timestamp representing the date and time when the custom event schema was updated. The value is shown in the ISO 8601 format. | [optional] +**object** | **str** | The type of the object represented by JSON. | [optional] [default to 'custom-event-schema'] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ManagementProjectsCustomEventSchemasGetResponseBodySchema.md b/docs/ManagementProjectsCustomEventSchemasGetResponseBodySchema.md new file mode 100644 index 00000000..0fd71469 --- /dev/null +++ b/docs/ManagementProjectsCustomEventSchemasGetResponseBodySchema.md @@ -0,0 +1,13 @@ +# ManagementProjectsCustomEventSchemasGetResponseBodySchema + +Object containing custom event schema and its custom attributes (metadata). + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**properties** | **object** | Defines custom event custom attributes (metadata). | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ManagementProjectsCustomEventSchemasListResponseBody.md b/docs/ManagementProjectsCustomEventSchemasListResponseBody.md new file mode 100644 index 00000000..042e4edc --- /dev/null +++ b/docs/ManagementProjectsCustomEventSchemasListResponseBody.md @@ -0,0 +1,16 @@ +# ManagementProjectsCustomEventSchemasListResponseBody + +Object containing a list of custom event schemas. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**object** | **str** | The type of the object represented by JSON. This object stores information about the custom event schemas in a dictionary. | [optional] [default to 'list'] +**data_ref** | **str** | Identifies the name of the attribute that contains the array of custom event schema objects. | [optional] [default to 'data'] +**data** | [**List[ManagementProjectsCustomEventSchema]**](ManagementProjectsCustomEventSchema.md) | Array of custom event schema objects. | [optional] +**total** | **int** | The total number of custom event schema objects. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ManagementProjectsCustomEventSchemasUpdateRequestBody.md b/docs/ManagementProjectsCustomEventSchemasUpdateRequestBody.md new file mode 100644 index 00000000..b6eb1638 --- /dev/null +++ b/docs/ManagementProjectsCustomEventSchemasUpdateRequestBody.md @@ -0,0 +1,13 @@ +# ManagementProjectsCustomEventSchemasUpdateRequestBody + +Request body schema for **POST** `v1/management/v1/projects/{projectId}/custom-event-schema/{customEventSchemaId}`. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**var_schema** | [**ManagementProjectsCustomEventSchemasUpdateRequestBodySchema**](ManagementProjectsCustomEventSchemasUpdateRequestBodySchema.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ManagementProjectsCustomEventSchemasUpdateRequestBodySchema.md b/docs/ManagementProjectsCustomEventSchemasUpdateRequestBodySchema.md new file mode 100644 index 00000000..9686f71c --- /dev/null +++ b/docs/ManagementProjectsCustomEventSchemasUpdateRequestBodySchema.md @@ -0,0 +1,13 @@ +# ManagementProjectsCustomEventSchemasUpdateRequestBodySchema + +Object containing custom event schema and its custom attributes (metadata). + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**properties** | **object** | Defines custom event custom attributes (metadata). | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ManagementProjectsCustomEventSchemasUpdateResponseBody.md b/docs/ManagementProjectsCustomEventSchemasUpdateResponseBody.md new file mode 100644 index 00000000..27a4f939 --- /dev/null +++ b/docs/ManagementProjectsCustomEventSchemasUpdateResponseBody.md @@ -0,0 +1,18 @@ +# ManagementProjectsCustomEventSchemasUpdateResponseBody + +Response body schema for **POST** `v1/management/v1/projects/{projectId}/custom-event-schema/{customEventSchemaId}`. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **str** | Unique identifier of the custom event schema. | [optional] +**name** | **str** | User-defined name of the custom event. This is also shown in **Project Settings** > **Event Schema** in the Voucherify Dashboard. | [optional] +**var_schema** | [**ManagementProjectsCustomEventSchemasUpdateResponseBodySchema**](ManagementProjectsCustomEventSchemasUpdateResponseBodySchema.md) | | [optional] +**created_at** | **datetime** | Timestamp representing the date and time when the custom event schema was created. The value is shown in the ISO 8601 format. | [optional] +**updated_at** | **datetime** | Timestamp representing the date and time when the custom event schema was updated. The value is shown in the ISO 8601 format. | [optional] +**object** | **str** | The type of the object represented by JSON. | [optional] [default to 'custom-event-schema'] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ManagementProjectsCustomEventSchemasUpdateResponseBodySchema.md b/docs/ManagementProjectsCustomEventSchemasUpdateResponseBodySchema.md new file mode 100644 index 00000000..d4a5da7b --- /dev/null +++ b/docs/ManagementProjectsCustomEventSchemasUpdateResponseBodySchema.md @@ -0,0 +1,13 @@ +# ManagementProjectsCustomEventSchemasUpdateResponseBodySchema + +Object containing custom event schema and its custom attributes (metadata). + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**properties** | **object** | Defines custom event custom attributes (metadata). | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ManagementProjectsGetResponseBody.md b/docs/ManagementProjectsGetResponseBody.md new file mode 100644 index 00000000..0a768bfb --- /dev/null +++ b/docs/ManagementProjectsGetResponseBody.md @@ -0,0 +1,34 @@ +# ManagementProjectsGetResponseBody + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **str** | Unique identifier of the project. | [optional] +**name** | **str** | The name of the project. | [optional] +**description** | **str** | A user-defined description of the project, e.g. its purpose, scope, region. | [optional] +**timezone** | **str** | The time zone in which the project is established. It can be in the GMT format or in accordance with IANA time zone database. | [optional] +**currency** | **str** | The currency used in the project. It is equal to a 3-letter ISO 4217 code. | [optional] +**dial_code** | **str** | The country dial code for the project. It is equal to an ITU country code. | [optional] +**webhook_version** | **str** | The webhook version used in the project. | [optional] [default to 'v2024-01-01'] +**client_trusted_domains** | **List[str]** | An array of URL addresses that allow client requests. | [optional] +**client_redeem_enabled** | **bool** | Enables client-side redemption. | [optional] +**client_publish_enabled** | **bool** | Enables client-side publication. | [optional] +**client_list_vouchers_enabled** | **bool** | Enables client-side listing of vouchers. | [optional] +**client_create_customer_enabled** | **bool** | Enables client-side creation of customers. | [optional] +**client_loyalty_events_enabled** | **bool** | Enables client-side events for loyalty and referral programs. | [optional] +**client_set_voucher_expiration_date_enabled** | **bool** | Enables client-side setting of voucher expiration date. | [optional] +**api_usage_notifications** | [**ManagementProjectsGetResponseBodyApiUsageNotifications**](ManagementProjectsGetResponseBodyApiUsageNotifications.md) | | [optional] +**webhooks_callout_notifications** | [**ManagementProjectsGetResponseBodyWebhooksCalloutNotifications**](ManagementProjectsGetResponseBodyWebhooksCalloutNotifications.md) | | [optional] +**cluster_id** | **str** | The identifier of the cluster where the project will be created. | [optional] +**case_sensitive_codes** | **bool** | Determines if the vouchers in the project will be: - case sensitive - if `true`, `C0dE-cfV` is **not** equal to `c0de-cfv`), - case insensitive - if `false`, `C0dE-cfV` is equal to `c0de-cfv`. | [optional] +**api_version** | **str** | The API version used in the project. Currently, the default and only value is `v2018-08-01`. | [optional] [default to 'v2018-08-01'] +**is_sandbox** | **bool** | Determines if the project is a sandbox project. | [optional] +**webhook_token** | **str** | Webhook token used for authentication. | [optional] +**default_code_config** | [**ManagementProjectsGetResponseBodyDefaultCodeConfig**](ManagementProjectsGetResponseBodyDefaultCodeConfig.md) | | [optional] +**limits** | [**ManagementProjectsGetResponseBodyLimits**](ManagementProjectsGetResponseBodyLimits.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ManagementProjectsGetResponseBodyApiUsageNotifications.md b/docs/ManagementProjectsGetResponseBodyApiUsageNotifications.md new file mode 100644 index 00000000..eb05cc99 --- /dev/null +++ b/docs/ManagementProjectsGetResponseBodyApiUsageNotifications.md @@ -0,0 +1,18 @@ +# ManagementProjectsGetResponseBodyApiUsageNotifications + +Determines the notification settings. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**redemptions** | [**UsageNotifications**](UsageNotifications.md) | | [optional] +**messages** | [**UsageNotifications**](UsageNotifications.md) | | [optional] +**api_calls** | [**UsageNotifications**](UsageNotifications.md) | | [optional] +**bulk_api_calls** | [**UsageNotifications**](UsageNotifications.md) | | [optional] +**webhook_calls** | [**UsageNotifications**](UsageNotifications.md) | | [optional] +**cycle_calls** | [**UsageNotifications**](UsageNotifications.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ManagementProjectsGetResponseBodyDefaultCodeConfig.md b/docs/ManagementProjectsGetResponseBodyDefaultCodeConfig.md new file mode 100644 index 00000000..0dc5e1bc --- /dev/null +++ b/docs/ManagementProjectsGetResponseBodyDefaultCodeConfig.md @@ -0,0 +1,13 @@ +# ManagementProjectsGetResponseBodyDefaultCodeConfig + +Determines the character set that is used as default for vouchers. It is affected by the `\"case_sensitive_codes\"` setting. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**charset** | **str** | Lists all characters that are used as default for vouchers | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ManagementProjectsGetResponseBodyLimits.md b/docs/ManagementProjectsGetResponseBodyLimits.md new file mode 100644 index 00000000..76b2bc58 --- /dev/null +++ b/docs/ManagementProjectsGetResponseBodyLimits.md @@ -0,0 +1,14 @@ +# ManagementProjectsGetResponseBodyLimits + +Determines additional limits set on a given project, e.g. the Sandbox project. If no limits are returned, the limits set for the whole organization apply. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**api_calls** | [**List[ManagementProjectsGetResponseBodyLimitsApiCallsItem]**](ManagementProjectsGetResponseBodyLimitsApiCallsItem.md) | | [optional] +**bulk_api_calls** | [**List[ManagementProjectsGetResponseBodyLimitsBulkApiCallsItem]**](ManagementProjectsGetResponseBodyLimitsBulkApiCallsItem.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ManagementProjectsGetResponseBodyLimitsApiCallsItem.md b/docs/ManagementProjectsGetResponseBodyLimitsApiCallsItem.md new file mode 100644 index 00000000..62cfc183 --- /dev/null +++ b/docs/ManagementProjectsGetResponseBodyLimitsApiCallsItem.md @@ -0,0 +1,14 @@ +# ManagementProjectsGetResponseBodyLimitsApiCallsItem + +Determines the limit of API calls per given unit time. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**value** | **int** | Determines the maximum number of API calls per time set in `\"duration\"`. | [optional] +**duration** | **str** | Determines the amount of time during which the calls up to the number specified in the `value` can be made. The duration is presented in the ISO 8601 format, e.g. `PT1H` means one hour. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ManagementProjectsGetResponseBodyLimitsBulkApiCallsItem.md b/docs/ManagementProjectsGetResponseBodyLimitsBulkApiCallsItem.md new file mode 100644 index 00000000..595d65a3 --- /dev/null +++ b/docs/ManagementProjectsGetResponseBodyLimitsBulkApiCallsItem.md @@ -0,0 +1,14 @@ +# ManagementProjectsGetResponseBodyLimitsBulkApiCallsItem + + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**value** | **int** | Determines the maximum number of API calls per time set in `\"duration\"`. | [optional] +**duration** | **str** | Determines the amount of time during which the calls up to the number specified in the `value` can be made. The duration is presented in the ISO 8601 format, e.g. `PT1H` means one hour. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ManagementProjectsGetResponseBodyWebhooksCalloutNotifications.md b/docs/ManagementProjectsGetResponseBodyWebhooksCalloutNotifications.md new file mode 100644 index 00000000..8508694f --- /dev/null +++ b/docs/ManagementProjectsGetResponseBodyWebhooksCalloutNotifications.md @@ -0,0 +1,14 @@ +# ManagementProjectsGetResponseBodyWebhooksCalloutNotifications + +Determines the notification settings for webhook callouts configured in Distributions and Project settings. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**distributions** | [**ManagementProjectsGetResponseBodyWebhooksCalloutNotificationsDistributions**](ManagementProjectsGetResponseBodyWebhooksCalloutNotificationsDistributions.md) | | [optional] +**webhooks** | [**ManagementProjectsGetResponseBodyWebhooksCalloutNotificationsWebhooks**](ManagementProjectsGetResponseBodyWebhooksCalloutNotificationsWebhooks.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ManagementProjectsGetResponseBodyWebhooksCalloutNotificationsDistributions.md b/docs/ManagementProjectsGetResponseBodyWebhooksCalloutNotificationsDistributions.md new file mode 100644 index 00000000..c5105387 --- /dev/null +++ b/docs/ManagementProjectsGetResponseBodyWebhooksCalloutNotificationsDistributions.md @@ -0,0 +1,15 @@ +# ManagementProjectsGetResponseBodyWebhooksCalloutNotificationsDistributions + +Determines the notification settings for webhooks sent through Distributions. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**email** | **bool** | Enables the notification through an email. | [optional] +**in_app** | **bool** | Enables the notification through an email. | [optional] +**emails** | **List[str]** | An array of email addresses which will receive the notification. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ManagementProjectsGetResponseBodyWebhooksCalloutNotificationsWebhooks.md b/docs/ManagementProjectsGetResponseBodyWebhooksCalloutNotificationsWebhooks.md new file mode 100644 index 00000000..2fd19636 --- /dev/null +++ b/docs/ManagementProjectsGetResponseBodyWebhooksCalloutNotificationsWebhooks.md @@ -0,0 +1,15 @@ +# ManagementProjectsGetResponseBodyWebhooksCalloutNotificationsWebhooks + +Determines the notification settings for webhooks sent as set out in the Project settings. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**email** | **bool** | Enables the notification through an email. | [optional] +**in_app** | **bool** | Enables the notification through an email. | [optional] +**emails** | **List[str]** | An array of email addresses which will receive the notification. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ManagementProjectsListResponseBody.md b/docs/ManagementProjectsListResponseBody.md new file mode 100644 index 00000000..41a54f1e --- /dev/null +++ b/docs/ManagementProjectsListResponseBody.md @@ -0,0 +1,16 @@ +# ManagementProjectsListResponseBody + +Schema model for **GET** `managment/v1/projects`. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**object** | **str** | The type of the object represented by JSON. This object stores information about the projects in a dictionary. | [optional] [default to 'list'] +**data_ref** | **str** | Identifies the name of the attribute that contains the array of project objects. | [optional] [default to 'data'] +**data** | [**List[ManagementProject]**](ManagementProject.md) | Array of project objects. | [optional] +**total** | **int** | The total number of projects. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ManagementProjectsMetadataSchema.md b/docs/ManagementProjectsMetadataSchema.md new file mode 100644 index 00000000..c4eeb23c --- /dev/null +++ b/docs/ManagementProjectsMetadataSchema.md @@ -0,0 +1,19 @@ +# ManagementProjectsMetadataSchema + +Object representing a metadata schema. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **str** | Unique identifier of the metadata schema. | [optional] +**related_object** | **str** | The resource type. You can define custom metadata schemas, which have a custom `\"related_object\"` resource type. The standard metadata schemas are: `\"campaign\"`, `\"customer\"`, `\"earning_rule\"`, `\"loyalty_tier\"`, `\"order\"`, `\"order_item\"`, `\"product\"`, `\"promotion_tier\"`, `\"publication\"`, `\"redemption\"`, `\"reward\"`, `\"voucher\"`. | [optional] +**properties** | **object** | Contains metadata definitions. | [optional] +**allow_defined_only** | **bool** | Restricts the creation of metadata fields when set to `true`. It indicates whether or not you can create new metadata definitions, e.g. in the campaign or publication manager. If set to `true`, then only the defined fields are available for assigning values. | [optional] +**created_at** | **datetime** | Timestamp representing the date and time when the metadata schema was created. The value for this parameter is shown in the ISO 8601 format. | [optional] +**updated_at** | **datetime** | Timestamp representing the date and time when the metadata schema was updated. The value for this parameter is shown in the ISO 8601 format. | [optional] +**object** | **str** | The type of the object represented by the JSON. This object stores information about the metadata schema. | [optional] [default to 'metadata_schema'] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ManagementProjectsMetadataSchemasCreateRequestBody.md b/docs/ManagementProjectsMetadataSchemasCreateRequestBody.md new file mode 100644 index 00000000..ba6df427 --- /dev/null +++ b/docs/ManagementProjectsMetadataSchemasCreateRequestBody.md @@ -0,0 +1,15 @@ +# ManagementProjectsMetadataSchemasCreateRequestBody + + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**related_object** | **str** | The resource type. You can define custom metadata schemas, which have a custom `\"related_object\"` resource type, or you can use standard resource types: `\"campaign\"`, `\"customer\"`, `\"earning_rule\"`, `\"loyalty_tier\"`, `\"order\"`, `\"order_item\"`, `\"product\"`, `\"promotion_tier\"`, `\"publication\"`, `\"redemption\"`, `\"reward\"`, `\"voucher\"`. | [optional] +**allow_defined_only** | **bool** | Restricts the creation of metadata fields when set to `true`. In other words, it indicates whether or not you are allowed to create new metadata definitions; for example, in the campaign manager or publication manager. If it is set to true, then only the defined fields will be available for assigning values. | [optional] [default to False] +**properties** | **object** | Contains metadata definitions. There can be many properties within this object. Only the properties sent in the request will be created. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ManagementProjectsMetadataSchemasCreateResponseBody.md b/docs/ManagementProjectsMetadataSchemasCreateResponseBody.md new file mode 100644 index 00000000..5e88895e --- /dev/null +++ b/docs/ManagementProjectsMetadataSchemasCreateResponseBody.md @@ -0,0 +1,19 @@ +# ManagementProjectsMetadataSchemasCreateResponseBody + +Response body schema for **POST** `management/v1/projects/{projectId}/metadata-schemas`. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **str** | Unique identifier of the metadata schema. | [optional] +**related_object** | **str** | The resource type. You can define custom metadata schemas, which have a custom `\"related_object\"` resource type. The standard metadata schemas are: `\"campaign\"`, `\"customer\"`, `\"earning_rule\"`, `\"loyalty_tier\"`, `\"order\"`, `\"order_item\"`, `\"product\"`, `\"promotion_tier\"`, `\"publication\"`, `\"redemption\"`, `\"reward\"`, `\"voucher\"`. | [optional] +**properties** | **object** | Contains metadata definitions. | [optional] +**allow_defined_only** | **bool** | Restricts the creation of metadata fields when set to `true`. It indicates whether or not you can create new metadata definitions, e.g. in the campaign or publication manager. If set to `true`, then only the defined fields are available for assigning values. | [optional] +**created_at** | **datetime** | Timestamp representing the date and time when the metadata schema was created. The value for this parameter is shown in the ISO 8601 format. | [optional] +**updated_at** | **datetime** | Timestamp representing the date and time when the metadata schema was updated. The value for this parameter is shown in the ISO 8601 format. | [optional] +**object** | **str** | The type of the object represented by the JSON. This object stores information about the metadata schema. | [optional] [default to 'metadata_schema'] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ManagementProjectsMetadataSchemasGetResponseBody.md b/docs/ManagementProjectsMetadataSchemasGetResponseBody.md new file mode 100644 index 00000000..0182990a --- /dev/null +++ b/docs/ManagementProjectsMetadataSchemasGetResponseBody.md @@ -0,0 +1,19 @@ +# ManagementProjectsMetadataSchemasGetResponseBody + +Response body schema for **POST** `management/v1/projects/{projectId}/metadata-schemas/{metadataSchemaId}`. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **str** | Unique identifier of the metadata schema. | [optional] +**related_object** | **str** | The resource type. You can define custom metadata schemas, which have a custom `\"related_object\"` resource type. The standard metadata schemas are: `\"campaign\"`, `\"customer\"`, `\"earning_rule\"`, `\"loyalty_tier\"`, `\"order\"`, `\"order_item\"`, `\"product\"`, `\"promotion_tier\"`, `\"publication\"`, `\"redemption\"`, `\"reward\"`, `\"voucher\"`. | [optional] +**properties** | **object** | Contains metadata definitions. | [optional] +**allow_defined_only** | **bool** | Restricts the creation of metadata fields when set to `true`. It indicates whether or not you can create new metadata definitions, e.g. in the campaign or publication manager. If set to `true`, then only the defined fields are available for assigning values. | [optional] +**created_at** | **datetime** | Timestamp representing the date and time when the metadata schema was created. The value for this parameter is shown in the ISO 8601 format. | [optional] +**updated_at** | **datetime** | Timestamp representing the date and time when the metadata schema was updated. The value for this parameter is shown in the ISO 8601 format. | [optional] +**object** | **str** | The type of the object represented by the JSON. This object stores information about the metadata schema. | [optional] [default to 'metadata_schema'] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ManagementProjectsMetadataSchemasListResponseBody.md b/docs/ManagementProjectsMetadataSchemasListResponseBody.md new file mode 100644 index 00000000..1da6cf3a --- /dev/null +++ b/docs/ManagementProjectsMetadataSchemasListResponseBody.md @@ -0,0 +1,16 @@ +# ManagementProjectsMetadataSchemasListResponseBody + +Object containing a list of metadata schemas. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**object** | **str** | The type of the object represented by JSON. This object stores information about the metadata schemas in a dictionary. | [optional] [default to 'list'] +**data_ref** | **str** | Identifies the name of the attribute that contains the array of metadata schema objects. | [optional] [default to 'data'] +**data** | [**List[ManagementProjectsMetadataSchema]**](ManagementProjectsMetadataSchema.md) | Array of metadata schema objects. The metadata schemas are listed by related object properties. | [optional] +**total** | **int** | The total number of metadata schema objects. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ManagementProjectsMetadataSchemasUpdateRequestBody.md b/docs/ManagementProjectsMetadataSchemasUpdateRequestBody.md new file mode 100644 index 00000000..8652e0d2 --- /dev/null +++ b/docs/ManagementProjectsMetadataSchemasUpdateRequestBody.md @@ -0,0 +1,14 @@ +# ManagementProjectsMetadataSchemasUpdateRequestBody + + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**allow_defined_only** | **bool** | Restricts the creation of metadata fields when set to `true`. In other words, it indicates whether or not you are allowed to create new metadata definitions; for example, in the campaign manager or publication manager. If it is set to true, then only the defined fields will be available for assigning values. | [optional] +**properties** | **object** | Contains metadata definitions. There can be many properties within this object. Only the properties sent in the request will be updated. However, if you send a property, all its key-value pairs must be provided - otherwise, they will be overwritten to new values. You cannot change the `\"type\"` property. However, it is required, so you need to add it to the request. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ManagementProjectsMetadataSchemasUpdateResponseBody.md b/docs/ManagementProjectsMetadataSchemasUpdateResponseBody.md new file mode 100644 index 00000000..fcd7dc2e --- /dev/null +++ b/docs/ManagementProjectsMetadataSchemasUpdateResponseBody.md @@ -0,0 +1,19 @@ +# ManagementProjectsMetadataSchemasUpdateResponseBody + +Response body schema for **PUT** `management/v1/projects/{projectId}/metadata-schemas/{metadataSchemaId}`. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **str** | Unique identifier of the metadata schema. | [optional] +**related_object** | **str** | The resource type. You can define custom metadata schemas, which have a custom `\"related_object\"` resource type. The standard metadata schemas are: `\"campaign\"`, `\"customer\"`, `\"earning_rule\"`, `\"loyalty_tier\"`, `\"order\"`, `\"order_item\"`, `\"product\"`, `\"promotion_tier\"`, `\"publication\"`, `\"redemption\"`, `\"reward\"`, `\"voucher\"`. | [optional] +**properties** | **object** | Contains metadata definitions. | [optional] +**allow_defined_only** | **bool** | Restricts the creation of metadata fields when set to `true`. It indicates whether or not you can create new metadata definitions, e.g. in the campaign or publication manager. If set to `true`, then only the defined fields are available for assigning values. | [optional] +**created_at** | **datetime** | Timestamp representing the date and time when the metadata schema was created. The value for this parameter is shown in the ISO 8601 format. | [optional] +**updated_at** | **datetime** | Timestamp representing the date and time when the metadata schema was updated. The value for this parameter is shown in the ISO 8601 format. | [optional] +**object** | **str** | The type of the object represented by the JSON. This object stores information about the metadata schema. | [optional] [default to 'metadata_schema'] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ManagementProjectsStackingRules.md b/docs/ManagementProjectsStackingRules.md new file mode 100644 index 00000000..9bce3644 --- /dev/null +++ b/docs/ManagementProjectsStackingRules.md @@ -0,0 +1,27 @@ +# ManagementProjectsStackingRules + +Object representing the details of the stacking rules. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **str** | The unique identifier of the stacking rules. | [optional] +**exclusive_categories** | **List[str]** | Lists the IDs of the categories that are exclusive. | [optional] +**joint_categories** | **List[str]** | Lists the IDs of the categories that are joint. | [optional] +**redeemables_limit** | **int** | Defines how many redeemables can be sent to Voucherify for validation at the same time. | [optional] +**applicable_redeemables_limit** | **int** | Defines how many redeemables can be applied at the same time. The number must be less than or equal to `\"redeemables_limit\"`. | [optional] +**applicable_redeemables_per_category_limit** | **int** | Defines how many redeemables with the same category can be applied at the same time. The number must be less than or equal to `\"applicable_redeemables_limit\"`. | [optional] +**applicable_exclusive_redeemables_limit** | **int** | Defines how many redeemables with an assigned exclusive category can be applied at the same time. | [optional] +**applicable_exclusive_redeemables_per_category_limit** | **int** | Defines how many exclusive redeemables with the same category can be applied at the same time. The number must be less than or equal to `\"applicable_exclusive_redeemables_limit\"`. | [optional] +**discount_calculation_mode** | **str** | Defines if the discounts are applied by taking into account the initial order amount or the discounted order amount. | [optional] +**initial_amount_mode_categories** | **List[str]** | Lists the IDs of the categories that apply a discount based on the initial amount. | [optional] +**discounted_amount_mode_categories** | **List[str]** | Lists the IDs of the categories that apply a discount based on the discounted amount. | [optional] +**redeemables_application_mode** | **str** | Defines the application mode for redeemables. `\"ALL\"` means that all redeemables must be validated for the redemption to be successful. `\"PARTIAL\"` means that only those redeemables that can be validated will be redeemed. The redeemables that fail validaton will be skipped. | [optional] +**redeemables_sorting_rule** | **str** | Defines the sorting rule for redeemables. `\"CATEGORY_HIERARCHY\"` means that redeemables are applied with the order established by the hierarchy of the categories. `\"REQUESTED_ORDER\"` means that redeemables are applied with the order established in the request. | [optional] +**created_at** | **datetime** | Timestamp representing the date and time when the stacking rules were created. The value for this parameter is shown in the ISO 8601 format. | [optional] +**updated_at** | **datetime** | Timestamp representing the date and time when the stacking rules were updated. The value for this parameter is shown in the ISO 8601 format. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ManagementProjectsStackingRulesCreateRequestBody.md b/docs/ManagementProjectsStackingRulesCreateRequestBody.md new file mode 100644 index 00000000..74109a2a --- /dev/null +++ b/docs/ManagementProjectsStackingRulesCreateRequestBody.md @@ -0,0 +1,24 @@ +# ManagementProjectsStackingRulesCreateRequestBody + +Request body schema for **POST** `/management/v1/projects/{projectId}/stacking-rules`. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**exclusive_categories** | **List[str]** | Lists the IDs of the categories that are exclusive. | [optional] +**joint_categories** | **List[str]** | Lists the IDs of the categories that are joint. | [optional] +**redeemables_limit** | **int** | Defines how many redeemables can be sent to Voucherify for validation at the same time. | [optional] +**applicable_redeemables_limit** | **int** | Defines how many redeemables can be applied at the same time. The number must be less than or equal to `\"redeemables_limit\"`. | [optional] +**applicable_redeemables_per_category_limit** | **int** | Defines how many redeemables with the same category can be applied at the same time. The number must be less than or equal to `\"applicable_redeemables_limit\"`. | [optional] +**applicable_exclusive_redeemables_limit** | **int** | Defines how many redeemables with an assigned exclusive category can be applied at the same time. | [optional] +**applicable_exclusive_redeemables_per_category_limit** | **int** | Defines how many exclusive redeemables with the same category can be applied at the same time. The number must be less than or equal to `\"applicable_exclusive_redeemables_limit\"`. | [optional] +**discount_calculation_mode** | **str** | Defines if the discounts are applied by taking into account the initial order amount or the discounted order amount. | [optional] +**initial_amount_mode_categories** | **List[str]** | Lists the IDs of the categories that apply a discount based on the initial amount. | [optional] +**discounted_amount_mode_categories** | **List[str]** | Lists the IDs of the categories that apply a discount based on the discounted amount. | [optional] +**redeemables_application_mode** | **str** | Defines the application mode for redeemables. `\"ALL\"` means that all redeemables must be validated for the redemption to be successful. `\"PARTIAL\"` means that only those redeemables that can be validated will be redeemed. The redeemables that fail validaton will be skipped. | [optional] +**redeemables_sorting_rule** | **str** | Defines the sorting rule for redeemables. `\"CATEGORY_HIERARCHY\"` means that redeemables are applied with the order established by the hierarchy of the categories. `\"REQUESTED_ORDER\"` means that redeemables are applied with the order established in the request. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ManagementProjectsStackingRulesCreateResponseBody.md b/docs/ManagementProjectsStackingRulesCreateResponseBody.md new file mode 100644 index 00000000..0bb936ea --- /dev/null +++ b/docs/ManagementProjectsStackingRulesCreateResponseBody.md @@ -0,0 +1,27 @@ +# ManagementProjectsStackingRulesCreateResponseBody + +Response body schema for **POST** `/management/v1/projects/{projectId}/stacking-rules`. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **str** | The unique identifier of the stacking rules. | [optional] +**exclusive_categories** | **List[str]** | Lists the IDs of the categories that are exclusive. | [optional] +**joint_categories** | **List[str]** | Lists the IDs of the categories that are joint. | [optional] +**redeemables_limit** | **int** | Defines how many redeemables can be sent to Voucherify for validation at the same time. | [optional] +**applicable_redeemables_limit** | **int** | Defines how many redeemables can be applied at the same time. The number must be less than or equal to `\"redeemables_limit\"`. | [optional] +**applicable_redeemables_per_category_limit** | **int** | Defines how many redeemables with the same category can be applied at the same time. The number must be less than or equal to `\"applicable_redeemables_limit\"`. | [optional] +**applicable_exclusive_redeemables_limit** | **int** | Defines how many redeemables with an assigned exclusive category can be applied at the same time. | [optional] +**applicable_exclusive_redeemables_per_category_limit** | **int** | Defines how many exclusive redeemables with the same category can be applied at the same time. The number must be less than or equal to `\"applicable_exclusive_redeemables_limit\"`. | [optional] +**discount_calculation_mode** | **str** | Defines if the discounts are applied by taking into account the initial order amount or the discounted order amount. | [optional] +**initial_amount_mode_categories** | **List[str]** | Lists the IDs of the categories that apply a discount based on the initial amount. | [optional] +**discounted_amount_mode_categories** | **List[str]** | Lists the IDs of the categories that apply a discount based on the discounted amount. | [optional] +**redeemables_application_mode** | **str** | Defines the application mode for redeemables. `\"ALL\"` means that all redeemables must be validated for the redemption to be successful. `\"PARTIAL\"` means that only those redeemables that can be validated will be redeemed. The redeemables that fail validaton will be skipped. | [optional] +**redeemables_sorting_rule** | **str** | Defines the sorting rule for redeemables. `\"CATEGORY_HIERARCHY\"` means that redeemables are applied with the order established by the hierarchy of the categories. `\"REQUESTED_ORDER\"` means that redeemables are applied with the order established in the request. | [optional] +**created_at** | **datetime** | Timestamp representing the date and time when the stacking rules were created. The value for this parameter is shown in the ISO 8601 format. | [optional] +**updated_at** | **datetime** | Timestamp representing the date and time when the stacking rules were updated. The value for this parameter is shown in the ISO 8601 format. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ManagementProjectsStackingRulesGetResponseBody.md b/docs/ManagementProjectsStackingRulesGetResponseBody.md new file mode 100644 index 00000000..f10d43a7 --- /dev/null +++ b/docs/ManagementProjectsStackingRulesGetResponseBody.md @@ -0,0 +1,27 @@ +# ManagementProjectsStackingRulesGetResponseBody + +Response body schema for **GET** `/management/v1/projects/{projectId}/stacking-rules/{stackingRulesId}`. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **str** | The unique identifier of the stacking rules. | [optional] +**exclusive_categories** | **List[str]** | Lists the IDs of the categories that are exclusive. | [optional] +**joint_categories** | **List[str]** | Lists the IDs of the categories that are joint. | [optional] +**redeemables_limit** | **int** | Defines how many redeemables can be sent to Voucherify for validation at the same time. | [optional] +**applicable_redeemables_limit** | **int** | Defines how many redeemables can be applied at the same time. The number must be less than or equal to `\"redeemables_limit\"`. | [optional] +**applicable_redeemables_per_category_limit** | **int** | Defines how many redeemables with the same category can be applied at the same time. The number must be less than or equal to `\"applicable_redeemables_limit\"`. | [optional] +**applicable_exclusive_redeemables_limit** | **int** | Defines how many redeemables with an assigned exclusive category can be applied at the same time. | [optional] +**applicable_exclusive_redeemables_per_category_limit** | **int** | Defines how many exclusive redeemables with the same category can be applied at the same time. The number must be less than or equal to `\"applicable_exclusive_redeemables_limit\"`. | [optional] +**discount_calculation_mode** | **str** | Defines if the discounts are applied by taking into account the initial order amount or the discounted order amount. | [optional] +**initial_amount_mode_categories** | **List[str]** | Lists the IDs of the categories that apply a discount based on the initial amount. | [optional] +**discounted_amount_mode_categories** | **List[str]** | Lists the IDs of the categories that apply a discount based on the discounted amount. | [optional] +**redeemables_application_mode** | **str** | Defines the application mode for redeemables. `\"ALL\"` means that all redeemables must be validated for the redemption to be successful. `\"PARTIAL\"` means that only those redeemables that can be validated will be redeemed. The redeemables that fail validaton will be skipped. | [optional] +**redeemables_sorting_rule** | **str** | Defines the sorting rule for redeemables. `\"CATEGORY_HIERARCHY\"` means that redeemables are applied with the order established by the hierarchy of the categories. `\"REQUESTED_ORDER\"` means that redeemables are applied with the order established in the request. | [optional] +**created_at** | **datetime** | Timestamp representing the date and time when the stacking rules were created. The value for this parameter is shown in the ISO 8601 format. | [optional] +**updated_at** | **datetime** | Timestamp representing the date and time when the stacking rules were updated. The value for this parameter is shown in the ISO 8601 format. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ManagementProjectsStackingRulesListResponseBody.md b/docs/ManagementProjectsStackingRulesListResponseBody.md new file mode 100644 index 00000000..232359e2 --- /dev/null +++ b/docs/ManagementProjectsStackingRulesListResponseBody.md @@ -0,0 +1,16 @@ +# ManagementProjectsStackingRulesListResponseBody + +Response body schema for **GET** `/management/v1/projects/{projectId}/stacking-rules`. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**object** | **str** | The type of the object represented by JSON. This object stores information about the stacking rules in a dictionary. | [optional] [default to 'list'] +**data_ref** | **str** | Identifies the name of the attribute that contains the array of stacking rule objects. | [optional] [default to 'data'] +**data** | [**List[ManagementProjectsStackingRules]**](ManagementProjectsStackingRules.md) | Array of only one stacking rule object. | [optional] +**total** | **int** | The total number of stacking rule objects. It is always 1. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ManagementProjectsStackingRulesUpdateRequestBody.md b/docs/ManagementProjectsStackingRulesUpdateRequestBody.md new file mode 100644 index 00000000..59afc643 --- /dev/null +++ b/docs/ManagementProjectsStackingRulesUpdateRequestBody.md @@ -0,0 +1,24 @@ +# ManagementProjectsStackingRulesUpdateRequestBody + +Request body schema for **PUT** `/management/v1/projects/{projectId}/stacking-rules/{stackingRulesId}`. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**exclusive_categories** | **List[str]** | Lists the IDs of the categories that are exclusive. | [optional] +**joint_categories** | **List[str]** | Lists the IDs of the categories that are joint. | [optional] +**redeemables_limit** | **int** | Defines how many redeemables can be sent to Voucherify for validation at the same time. | [optional] +**applicable_redeemables_limit** | **int** | Defines how many redeemables can be applied at the same time. The number must be less than or equal to `\"redeemables_limit\"`. | [optional] +**applicable_redeemables_per_category_limit** | **int** | Defines how many redeemables with the same category can be applied at the same time. The number must be less than or equal to `\"applicable_redeemables_limit\"`. | [optional] +**applicable_exclusive_redeemables_limit** | **int** | Defines how many redeemables with an assigned exclusive category can be applied at the same time. | [optional] +**applicable_exclusive_redeemables_per_category_limit** | **int** | Defines how many exclusive redeemables with the same category can be applied at the same time. The number must be less than or equal to `\"applicable_exclusive_redeemables_limit\"`. | [optional] +**discount_calculation_mode** | **str** | Defines if the discounts are applied by taking into account the initial order amount or the discounted order amount. | [optional] +**initial_amount_mode_categories** | **List[str]** | Lists the IDs of the categories that apply a discount based on the initial amount. | [optional] +**discounted_amount_mode_categories** | **List[str]** | Lists the IDs of the categories that apply a discount based on the discounted amount. | [optional] +**redeemables_application_mode** | **str** | Defines the application mode for redeemables. `\"ALL\"` means that all redeemables must be validated for the redemption to be successful. `\"PARTIAL\"` means that only those redeemables that can be validated will be redeemed. The redeemables that fail validaton will be skipped. | [optional] +**redeemables_sorting_rule** | **str** | Defines the sorting rule for redeemables. `\"CATEGORY_HIERARCHY\"` means that redeemables are applied with the order established by the hierarchy of the categories. `\"REQUESTED_ORDER\"` means that redeemables are applied with the order established in the request. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ManagementProjectsStackingRulesUpdateResponseBody.md b/docs/ManagementProjectsStackingRulesUpdateResponseBody.md new file mode 100644 index 00000000..fd3b099a --- /dev/null +++ b/docs/ManagementProjectsStackingRulesUpdateResponseBody.md @@ -0,0 +1,27 @@ +# ManagementProjectsStackingRulesUpdateResponseBody + +Response body schema for **PUT** `/management/v1/projects/{projectId}/stacking-rules/{stackingRulesId}`. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **str** | The unique identifier of the stacking rules. | [optional] +**exclusive_categories** | **List[str]** | Lists the IDs of the categories that are exclusive. | [optional] +**joint_categories** | **List[str]** | Lists the IDs of the categories that are joint. | [optional] +**redeemables_limit** | **int** | Defines how many redeemables can be sent to Voucherify for validation at the same time. | [optional] +**applicable_redeemables_limit** | **int** | Defines how many redeemables can be applied at the same time. The number must be less than or equal to `\"redeemables_limit\"`. | [optional] +**applicable_redeemables_per_category_limit** | **int** | Defines how many redeemables with the same category can be applied at the same time. The number must be less than or equal to `\"applicable_redeemables_limit\"`. | [optional] +**applicable_exclusive_redeemables_limit** | **int** | Defines how many redeemables with an assigned exclusive category can be applied at the same time. | [optional] +**applicable_exclusive_redeemables_per_category_limit** | **int** | Defines how many exclusive redeemables with the same category can be applied at the same time. The number must be less than or equal to `\"applicable_exclusive_redeemables_limit\"`. | [optional] +**discount_calculation_mode** | **str** | Defines if the discounts are applied by taking into account the initial order amount or the discounted order amount. | [optional] +**initial_amount_mode_categories** | **List[str]** | Lists the IDs of the categories that apply a discount based on the initial amount. | [optional] +**discounted_amount_mode_categories** | **List[str]** | Lists the IDs of the categories that apply a discount based on the discounted amount. | [optional] +**redeemables_application_mode** | **str** | Defines the application mode for redeemables. `\"ALL\"` means that all redeemables must be validated for the redemption to be successful. `\"PARTIAL\"` means that only those redeemables that can be validated will be redeemed. The redeemables that fail validaton will be skipped. | [optional] +**redeemables_sorting_rule** | **str** | Defines the sorting rule for redeemables. `\"CATEGORY_HIERARCHY\"` means that redeemables are applied with the order established by the hierarchy of the categories. `\"REQUESTED_ORDER\"` means that redeemables are applied with the order established in the request. | [optional] +**created_at** | **datetime** | Timestamp representing the date and time when the stacking rules were created. The value for this parameter is shown in the ISO 8601 format. | [optional] +**updated_at** | **datetime** | Timestamp representing the date and time when the stacking rules were updated. The value for this parameter is shown in the ISO 8601 format. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ManagementProjectsUpdateRequestBody.md b/docs/ManagementProjectsUpdateRequestBody.md new file mode 100644 index 00000000..ea1c1789 --- /dev/null +++ b/docs/ManagementProjectsUpdateRequestBody.md @@ -0,0 +1,28 @@ +# ManagementProjectsUpdateRequestBody + +Request body schema for **PUT** `v1/management/v1/projects/{projectId}`. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **str** | The name of the project. | [optional] +**description** | **str** | A user-defined description of the project, e.g. its purpose, scope, region. | [optional] +**timezone** | **str** | The time zone in which the project is established. It can be in the GMT format or in accordance with IANA time zone database. | [optional] +**currency** | **str** | The currency used in the project. It is equal to a 3-letter ISO 4217 code. | [optional] +**dial_code** | **str** | The country dial code for the project. It is equal to an ITU country code. | [optional] +**webhook_version** | **str** | The webhook version used in the project. | [optional] [default to 'v2024-01-01'] +**client_trusted_domains** | **List[str]** | An array of URL addresses that allow client requests. | [optional] +**client_redeem_enabled** | **bool** | Enables client-side redemption. | [optional] +**client_publish_enabled** | **bool** | Enables client-side publication. | [optional] +**client_list_vouchers_enabled** | **bool** | Enables client-side listing of vouchers. | [optional] +**client_create_customer_enabled** | **bool** | Enables client-side creation of customers. | [optional] +**client_loyalty_events_enabled** | **bool** | Enables client-side events for loyalty and referral programs. | [optional] +**client_set_voucher_expiration_date_enabled** | **bool** | Enables client-side setting of voucher expiration date. | [optional] +**api_usage_notifications** | [**ManagementProjectsUpdateRequestBodyApiUsageNotifications**](ManagementProjectsUpdateRequestBodyApiUsageNotifications.md) | | [optional] +**webhooks_callout_notifications** | [**ManagementProjectsUpdateRequestBodyWebhooksCalloutNotifications**](ManagementProjectsUpdateRequestBodyWebhooksCalloutNotifications.md) | | [optional] +**default_code_config** | [**ManagementProjectsUpdateRequestBodyDefaultCodeConfig**](ManagementProjectsUpdateRequestBodyDefaultCodeConfig.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ManagementProjectsUpdateRequestBodyApiUsageNotifications.md b/docs/ManagementProjectsUpdateRequestBodyApiUsageNotifications.md new file mode 100644 index 00000000..4fed9c5a --- /dev/null +++ b/docs/ManagementProjectsUpdateRequestBodyApiUsageNotifications.md @@ -0,0 +1,18 @@ +# ManagementProjectsUpdateRequestBodyApiUsageNotifications + +Determines the notification settings. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**redemptions** | [**UsageNotifications**](UsageNotifications.md) | | [optional] +**messages** | [**UsageNotifications**](UsageNotifications.md) | | [optional] +**api_calls** | [**UsageNotifications**](UsageNotifications.md) | | [optional] +**bulk_api_calls** | [**UsageNotifications**](UsageNotifications.md) | | [optional] +**webhook_calls** | [**UsageNotifications**](UsageNotifications.md) | | [optional] +**cycle_calls** | [**UsageNotifications**](UsageNotifications.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ManagementProjectsUpdateRequestBodyDefaultCodeConfig.md b/docs/ManagementProjectsUpdateRequestBodyDefaultCodeConfig.md new file mode 100644 index 00000000..cb7ea864 --- /dev/null +++ b/docs/ManagementProjectsUpdateRequestBodyDefaultCodeConfig.md @@ -0,0 +1,13 @@ +# ManagementProjectsUpdateRequestBodyDefaultCodeConfig + +Determines the character set that is used as default for vouchers. It is affected by the `\"case_sensitive_codes\"` setting. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**charset** | **str** | Lists all characters that are used as default for vouchers | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ManagementProjectsUpdateRequestBodyWebhooksCalloutNotifications.md b/docs/ManagementProjectsUpdateRequestBodyWebhooksCalloutNotifications.md new file mode 100644 index 00000000..3be795a6 --- /dev/null +++ b/docs/ManagementProjectsUpdateRequestBodyWebhooksCalloutNotifications.md @@ -0,0 +1,14 @@ +# ManagementProjectsUpdateRequestBodyWebhooksCalloutNotifications + +Determines the notification settings for webhook callouts configured in Distributions and Project settings. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**distributions** | [**ManagementProjectsUpdateRequestBodyWebhooksCalloutNotificationsDistributions**](ManagementProjectsUpdateRequestBodyWebhooksCalloutNotificationsDistributions.md) | | [optional] +**webhooks** | [**ManagementProjectsUpdateRequestBodyWebhooksCalloutNotificationsWebhooks**](ManagementProjectsUpdateRequestBodyWebhooksCalloutNotificationsWebhooks.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ManagementProjectsUpdateRequestBodyWebhooksCalloutNotificationsDistributions.md b/docs/ManagementProjectsUpdateRequestBodyWebhooksCalloutNotificationsDistributions.md new file mode 100644 index 00000000..be220799 --- /dev/null +++ b/docs/ManagementProjectsUpdateRequestBodyWebhooksCalloutNotificationsDistributions.md @@ -0,0 +1,15 @@ +# ManagementProjectsUpdateRequestBodyWebhooksCalloutNotificationsDistributions + +Determines the notification settings for webhooks sent through Distributions. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**email** | **bool** | Enables the notification through an email. | [optional] +**in_app** | **bool** | Enables the notification through an email. | [optional] +**emails** | **List[str]** | An array of email addresses which will receive the notification. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ManagementProjectsUpdateRequestBodyWebhooksCalloutNotificationsWebhooks.md b/docs/ManagementProjectsUpdateRequestBodyWebhooksCalloutNotificationsWebhooks.md new file mode 100644 index 00000000..3fec7783 --- /dev/null +++ b/docs/ManagementProjectsUpdateRequestBodyWebhooksCalloutNotificationsWebhooks.md @@ -0,0 +1,15 @@ +# ManagementProjectsUpdateRequestBodyWebhooksCalloutNotificationsWebhooks + +Determines the notification settings for webhooks sent as set out in the Project settings. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**email** | **bool** | Enables the notification through an email. | [optional] +**in_app** | **bool** | Enables the notification through an email. | [optional] +**emails** | **List[str]** | An array of email addresses which will receive the notification. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ManagementProjectsUpdateResponseBody.md b/docs/ManagementProjectsUpdateResponseBody.md new file mode 100644 index 00000000..c6c0902a --- /dev/null +++ b/docs/ManagementProjectsUpdateResponseBody.md @@ -0,0 +1,34 @@ +# ManagementProjectsUpdateResponseBody + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **str** | Unique identifier of the project. | [optional] +**name** | **str** | The name of the project. | [optional] +**description** | **str** | A user-defined description of the project, e.g. its purpose, scope, region. | [optional] +**timezone** | **str** | The time zone in which the project is established. It can be in the GMT format or in accordance with IANA time zone database. | [optional] +**currency** | **str** | The currency used in the project. It is equal to a 3-letter ISO 4217 code. | [optional] +**dial_code** | **str** | The country dial code for the project. It is equal to an ITU country code. | [optional] +**webhook_version** | **str** | The webhook version used in the project. | [optional] [default to 'v2024-01-01'] +**client_trusted_domains** | **List[str]** | An array of URL addresses that allow client requests. | [optional] +**client_redeem_enabled** | **bool** | Enables client-side redemption. | [optional] +**client_publish_enabled** | **bool** | Enables client-side publication. | [optional] +**client_list_vouchers_enabled** | **bool** | Enables client-side listing of vouchers. | [optional] +**client_create_customer_enabled** | **bool** | Enables client-side creation of customers. | [optional] +**client_loyalty_events_enabled** | **bool** | Enables client-side events for loyalty and referral programs. | [optional] +**client_set_voucher_expiration_date_enabled** | **bool** | Enables client-side setting of voucher expiration date. | [optional] +**api_usage_notifications** | [**ManagementProjectsUpdateResponseBodyApiUsageNotifications**](ManagementProjectsUpdateResponseBodyApiUsageNotifications.md) | | [optional] +**webhooks_callout_notifications** | [**ManagementProjectsUpdateResponseBodyWebhooksCalloutNotifications**](ManagementProjectsUpdateResponseBodyWebhooksCalloutNotifications.md) | | [optional] +**cluster_id** | **str** | The identifier of the cluster where the project will be created. | [optional] +**case_sensitive_codes** | **bool** | Determines if the vouchers in the project will be: - case sensitive - if `true`, `C0dE-cfV` is **not** equal to `c0de-cfv`), - case insensitive - if `false`, `C0dE-cfV` is equal to `c0de-cfv`. | [optional] +**api_version** | **str** | The API version used in the project. Currently, the default and only value is `v2018-08-01`. | [optional] [default to 'v2018-08-01'] +**is_sandbox** | **bool** | Determines if the project is a sandbox project. | [optional] +**webhook_token** | **str** | Webhook token used for authentication. | [optional] +**default_code_config** | [**ManagementProjectsUpdateResponseBodyDefaultCodeConfig**](ManagementProjectsUpdateResponseBodyDefaultCodeConfig.md) | | [optional] +**limits** | [**ManagementProjectsUpdateResponseBodyLimits**](ManagementProjectsUpdateResponseBodyLimits.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ManagementProjectsUpdateResponseBodyApiUsageNotifications.md b/docs/ManagementProjectsUpdateResponseBodyApiUsageNotifications.md new file mode 100644 index 00000000..ad7ccc6b --- /dev/null +++ b/docs/ManagementProjectsUpdateResponseBodyApiUsageNotifications.md @@ -0,0 +1,18 @@ +# ManagementProjectsUpdateResponseBodyApiUsageNotifications + +Determines the notification settings. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**redemptions** | [**UsageNotifications**](UsageNotifications.md) | | [optional] +**messages** | [**UsageNotifications**](UsageNotifications.md) | | [optional] +**api_calls** | [**UsageNotifications**](UsageNotifications.md) | | [optional] +**bulk_api_calls** | [**UsageNotifications**](UsageNotifications.md) | | [optional] +**webhook_calls** | [**UsageNotifications**](UsageNotifications.md) | | [optional] +**cycle_calls** | [**UsageNotifications**](UsageNotifications.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ManagementProjectsUpdateResponseBodyDefaultCodeConfig.md b/docs/ManagementProjectsUpdateResponseBodyDefaultCodeConfig.md new file mode 100644 index 00000000..cad795b9 --- /dev/null +++ b/docs/ManagementProjectsUpdateResponseBodyDefaultCodeConfig.md @@ -0,0 +1,13 @@ +# ManagementProjectsUpdateResponseBodyDefaultCodeConfig + +Determines the character set that is used as default for vouchers. It is affected by the `\"case_sensitive_codes\"` setting. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**charset** | **str** | Lists all characters that are used as default for vouchers | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ManagementProjectsUpdateResponseBodyLimits.md b/docs/ManagementProjectsUpdateResponseBodyLimits.md new file mode 100644 index 00000000..6a2c184c --- /dev/null +++ b/docs/ManagementProjectsUpdateResponseBodyLimits.md @@ -0,0 +1,14 @@ +# ManagementProjectsUpdateResponseBodyLimits + +Determines additional limits set on a given project, e.g. the Sandbox project. If no limits are returned, the limits set for the whole organization apply. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**api_calls** | [**List[ManagementProjectsUpdateResponseBodyLimitsApiCallsItem]**](ManagementProjectsUpdateResponseBodyLimitsApiCallsItem.md) | | [optional] +**bulk_api_calls** | [**List[ManagementProjectsUpdateResponseBodyLimitsBulkApiCallsItem]**](ManagementProjectsUpdateResponseBodyLimitsBulkApiCallsItem.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ManagementProjectsUpdateResponseBodyLimitsApiCallsItem.md b/docs/ManagementProjectsUpdateResponseBodyLimitsApiCallsItem.md new file mode 100644 index 00000000..795c417e --- /dev/null +++ b/docs/ManagementProjectsUpdateResponseBodyLimitsApiCallsItem.md @@ -0,0 +1,14 @@ +# ManagementProjectsUpdateResponseBodyLimitsApiCallsItem + +Determines the limit of API calls per given unit time. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**value** | **int** | Determines the maximum number of API calls per time set in `\"duration\"`. | [optional] +**duration** | **str** | Determines the amount of time during which the calls up to the number specified in the `value` can be made. The duration is presented in the ISO 8601 format, e.g. `PT1H` means one hour. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ManagementProjectsUpdateResponseBodyLimitsBulkApiCallsItem.md b/docs/ManagementProjectsUpdateResponseBodyLimitsBulkApiCallsItem.md new file mode 100644 index 00000000..e7ef8de8 --- /dev/null +++ b/docs/ManagementProjectsUpdateResponseBodyLimitsBulkApiCallsItem.md @@ -0,0 +1,14 @@ +# ManagementProjectsUpdateResponseBodyLimitsBulkApiCallsItem + + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**value** | **int** | Determines the maximum number of API calls per time set in `\"duration\"`. | [optional] +**duration** | **str** | Determines the amount of time during which the calls up to the number specified in the `value` can be made. The duration is presented in the ISO 8601 format, e.g. `PT1H` means one hour. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ManagementProjectsUpdateResponseBodyWebhooksCalloutNotifications.md b/docs/ManagementProjectsUpdateResponseBodyWebhooksCalloutNotifications.md new file mode 100644 index 00000000..31e17d28 --- /dev/null +++ b/docs/ManagementProjectsUpdateResponseBodyWebhooksCalloutNotifications.md @@ -0,0 +1,14 @@ +# ManagementProjectsUpdateResponseBodyWebhooksCalloutNotifications + +Determines the notification settings for webhook callouts configured in Distributions and Project settings. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**distributions** | [**ManagementProjectsUpdateResponseBodyWebhooksCalloutNotificationsDistributions**](ManagementProjectsUpdateResponseBodyWebhooksCalloutNotificationsDistributions.md) | | [optional] +**webhooks** | [**ManagementProjectsUpdateResponseBodyWebhooksCalloutNotificationsWebhooks**](ManagementProjectsUpdateResponseBodyWebhooksCalloutNotificationsWebhooks.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ManagementProjectsUpdateResponseBodyWebhooksCalloutNotificationsDistributions.md b/docs/ManagementProjectsUpdateResponseBodyWebhooksCalloutNotificationsDistributions.md new file mode 100644 index 00000000..36b1bf73 --- /dev/null +++ b/docs/ManagementProjectsUpdateResponseBodyWebhooksCalloutNotificationsDistributions.md @@ -0,0 +1,15 @@ +# ManagementProjectsUpdateResponseBodyWebhooksCalloutNotificationsDistributions + +Determines the notification settings for webhooks sent through Distributions. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**email** | **bool** | Enables the notification through an email. | [optional] +**in_app** | **bool** | Enables the notification through an email. | [optional] +**emails** | **List[str]** | An array of email addresses which will receive the notification. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ManagementProjectsUpdateResponseBodyWebhooksCalloutNotificationsWebhooks.md b/docs/ManagementProjectsUpdateResponseBodyWebhooksCalloutNotificationsWebhooks.md new file mode 100644 index 00000000..a399c3b9 --- /dev/null +++ b/docs/ManagementProjectsUpdateResponseBodyWebhooksCalloutNotificationsWebhooks.md @@ -0,0 +1,15 @@ +# ManagementProjectsUpdateResponseBodyWebhooksCalloutNotificationsWebhooks + +Determines the notification settings for webhooks sent as set out in the Project settings. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**email** | **bool** | Enables the notification through an email. | [optional] +**in_app** | **bool** | Enables the notification through an email. | [optional] +**emails** | **List[str]** | An array of email addresses which will receive the notification. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ManagementProjectsUsersAssignRequestBody.md b/docs/ManagementProjectsUsersAssignRequestBody.md new file mode 100644 index 00000000..1022480a --- /dev/null +++ b/docs/ManagementProjectsUsersAssignRequestBody.md @@ -0,0 +1,14 @@ +# ManagementProjectsUsersAssignRequestBody + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **str** | The unique identifier of the user who will be assigned to the project. It can be found in Team Settings > Team > Edit member. **Required** with the `role` string. Do **not** use with the `login` string. | [optional] +**login** | **str** | The login data of the user who will be assigned to the project. **Required** with the `role` string. Do **not** use with the `id` string. | [optional] +**role** | **str** | The role of the user to be added. It can be one of the following predefined roles: `ADMIN`, `USER`, `VIEWER`, `MERCHANT`, or an ID of a custom role. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ManagementProjectsUsersAssignResponseBody.md b/docs/ManagementProjectsUsersAssignResponseBody.md new file mode 100644 index 00000000..bedea91c --- /dev/null +++ b/docs/ManagementProjectsUsersAssignResponseBody.md @@ -0,0 +1,19 @@ +# ManagementProjectsUsersAssignResponseBody + +Details about the user assigned to the project. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **str** | The unique identifier of the user who has been assigned to the project. | [optional] +**login** | **str** | The login data of the user who has been assigned to the project. | [optional] +**email** | **str** | The email address of the user who has been assigned to the project. | [optional] +**first_name** | **str** | The first name of the user who has been assigned to the project. | [optional] +**last_name** | **str** | The last name of the user who has been assigned to the project. | [optional] +**projects** | **object** | Lists key-value pairs, where the key is the project to which the user is assigned. The value is the role assigned in a given project. The predefined Voucherify roles are: `ADMIN`, `USER`, `VIEWER`, `MERCHANT`, `USER_RESTRICTED` (for the Areas and Stores, an Enterprise feature). | [optional] +**is_owner** | **bool** | Determines if the user is the owner for the organization in Voucherify. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ManagementProjectsUsersGetUserResponseBody.md b/docs/ManagementProjectsUsersGetUserResponseBody.md new file mode 100644 index 00000000..6c616ff6 --- /dev/null +++ b/docs/ManagementProjectsUsersGetUserResponseBody.md @@ -0,0 +1,19 @@ +# ManagementProjectsUsersGetUserResponseBody + +Details about the user assigned to the project. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **str** | The unique identifier of the user who has been assigned to the project. | [optional] +**login** | **str** | The login data of the user who has been assigned to the project. | [optional] +**email** | **str** | The email address of the user who has been assigned to the project. | [optional] +**first_name** | **str** | The first name of the user who has been assigned to the project. | [optional] +**last_name** | **str** | The last name of the user who has been assigned to the project. | [optional] +**projects** | **object** | Lists key-value pairs, where the key is the project to which the user is assigned. The value is the role assigned in a given project. The predefined Voucherify roles are: `ADMIN`, `USER`, `VIEWER`, `MERCHANT`, `USER_RESTRICTED` (for the Areas and Stores, an Enterprise feature). | [optional] +**is_owner** | **bool** | Determines if the user is the owner for the organization in Voucherify. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ManagementProjectsUsersInviteCreateRequestBody.md b/docs/ManagementProjectsUsersInviteCreateRequestBody.md new file mode 100644 index 00000000..fbdb8e01 --- /dev/null +++ b/docs/ManagementProjectsUsersInviteCreateRequestBody.md @@ -0,0 +1,16 @@ +# ManagementProjectsUsersInviteCreateRequestBody + +Request body schema for **POST** `v1/management/v1/projects/users/invite`. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**email** | **str** | Email address to which the invitation will be sent. Must be a valid email address. | [optional] +**first_name** | **str** | First name of the person who will receive the invitation. The name will be used in the user profile. | [optional] +**last_name** | **str** | Last name of the person who will receive the invitation. The name will be used in the user profile. | [optional] +**projects** | **object** | In the key, provide the project ID to which the new user will be assigned. In the value, provide the role which the user will have in the project. The predefined Voucherify roles are: `ADMIN`, `USER`, `VIEWER`, `MERCHANT`, `USER_RESTRICTED` (for the Areas and Stores, an Enterprise feature). Send a custom role ID (Enterprise feature) to assign a custom role. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ManagementProjectsUsersListResponseBody.md b/docs/ManagementProjectsUsersListResponseBody.md new file mode 100644 index 00000000..2dfc7d03 --- /dev/null +++ b/docs/ManagementProjectsUsersListResponseBody.md @@ -0,0 +1,16 @@ +# ManagementProjectsUsersListResponseBody + +Object containing a list of users assigned to the project. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**object** | **str** | The type of the object represented by JSON. This object stores information about the users in a dictionary. | [optional] [default to 'list'] +**data_ref** | **str** | Identifies the name of the attribute that contains the array of user objects. | [optional] [default to 'data'] +**data** | [**List[User]**](User.md) | Array of user objects. | [optional] +**total** | **int** | The total number of users. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ManagementProjectsUsersUpdateRoleRequestBody.md b/docs/ManagementProjectsUsersUpdateRoleRequestBody.md new file mode 100644 index 00000000..77fbabb2 --- /dev/null +++ b/docs/ManagementProjectsUsersUpdateRoleRequestBody.md @@ -0,0 +1,12 @@ +# ManagementProjectsUsersUpdateRoleRequestBody + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**role** | **str** | The role of the user to be added. It can be a custom role or one of following predefined roles: `ADMIN`, `USER`, `VIEWER`, `MERCHANT` or an ID of a custom role.. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ManagementProjectsUsersUpdateRoleResponseBody.md b/docs/ManagementProjectsUsersUpdateRoleResponseBody.md new file mode 100644 index 00000000..13dbfa3c --- /dev/null +++ b/docs/ManagementProjectsUsersUpdateRoleResponseBody.md @@ -0,0 +1,19 @@ +# ManagementProjectsUsersUpdateRoleResponseBody + +Details about the user assigned to the project. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **str** | The unique identifier of the user who has been assigned to the project. | [optional] +**login** | **str** | The login data of the user who has been assigned to the project. | [optional] +**email** | **str** | The email address of the user who has been assigned to the project. | [optional] +**first_name** | **str** | The first name of the user who has been assigned to the project. | [optional] +**last_name** | **str** | The last name of the user who has been assigned to the project. | [optional] +**projects** | **object** | Lists key-value pairs, where the key is the project to which the user is assigned. The value is the role assigned in a given project. The predefined Voucherify roles are: `ADMIN`, `USER`, `VIEWER`, `MERCHANT`, `USER_RESTRICTED` (for the Areas and Stores, an Enterprise feature). | [optional] +**is_owner** | **bool** | Determines if the user is the owner for the organization in Voucherify. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ManagementProjectsWebhook.md b/docs/ManagementProjectsWebhook.md new file mode 100644 index 00000000..e23093f2 --- /dev/null +++ b/docs/ManagementProjectsWebhook.md @@ -0,0 +1,18 @@ +# ManagementProjectsWebhook + +Response body schema for webhook endpoints. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **str** | Unique identifier of the webhook. | [optional] +**object** | **str** | The type of the object represented by JSON. | [optional] [default to 'webhook'] +**created_at** | **datetime** | Timestamp representing the date and time when the webhook configuration was created. The value for this parameter is shown in the ISO 8601 format. | [optional] +**target_url** | **str** | URL address that receives webhooks. | [optional] +**events** | **List[str]** | Lists the events that trigger webhook sendout. | [optional] +**active** | **bool** | Determines if the webhook configuration is active. | [optional] [default to True] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ManagementProjectsWebhooksCreateRequestBody.md b/docs/ManagementProjectsWebhooksCreateRequestBody.md new file mode 100644 index 00000000..dd7bfe27 --- /dev/null +++ b/docs/ManagementProjectsWebhooksCreateRequestBody.md @@ -0,0 +1,15 @@ +# ManagementProjectsWebhooksCreateRequestBody + +Request body schema for **POST** `v1/management/v1/projects/{projectId}/webhooks/{webhookId}`. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**target_url** | **str** | URL address that receives webhooks. | [optional] +**events** | **List[str]** | Lists the events that trigger webhook sendout. | [optional] +**active** | **bool** | Determines if the webhook configuration is active. | [optional] [default to True] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ManagementProjectsWebhooksCreateResponseBody.md b/docs/ManagementProjectsWebhooksCreateResponseBody.md new file mode 100644 index 00000000..49105e75 --- /dev/null +++ b/docs/ManagementProjectsWebhooksCreateResponseBody.md @@ -0,0 +1,18 @@ +# ManagementProjectsWebhooksCreateResponseBody + +Response body schema for **POST** `v1/management/v1/projects/{projectId}/webhooks`. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **str** | Unique identifier of the webhook. | [optional] +**object** | **str** | The type of the object represented by JSON. | [optional] [default to 'webhook'] +**created_at** | **datetime** | Timestamp representing the date and time when the webhook configuration was created. The value for this parameter is shown in the ISO 8601 format. | [optional] +**target_url** | **str** | URL address that receives webhooks. | [optional] +**events** | **List[str]** | Lists the events that trigger webhook sendout. | [optional] +**active** | **bool** | Determines if the webhook configuration is active. | [optional] [default to True] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ManagementProjectsWebhooksGetResponseBody.md b/docs/ManagementProjectsWebhooksGetResponseBody.md new file mode 100644 index 00000000..ff6f1ca4 --- /dev/null +++ b/docs/ManagementProjectsWebhooksGetResponseBody.md @@ -0,0 +1,18 @@ +# ManagementProjectsWebhooksGetResponseBody + +Response body schema for **GET** `v1/management/v1/projects/{projectId}/webhooks/{webhookId}`. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **str** | Unique identifier of the webhook. | [optional] +**object** | **str** | The type of the object represented by JSON. | [optional] [default to 'webhook'] +**created_at** | **datetime** | Timestamp representing the date and time when the webhook configuration was created. The value for this parameter is shown in the ISO 8601 format. | [optional] +**target_url** | **str** | URL address that receives webhooks. | [optional] +**events** | **List[str]** | Lists the events that trigger webhook sendout. | [optional] +**active** | **bool** | Determines if the webhook configuration is active. | [optional] [default to True] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ManagementProjectsWebhooksListResponseBody.md b/docs/ManagementProjectsWebhooksListResponseBody.md new file mode 100644 index 00000000..31f601bf --- /dev/null +++ b/docs/ManagementProjectsWebhooksListResponseBody.md @@ -0,0 +1,16 @@ +# ManagementProjectsWebhooksListResponseBody + +Object containing a list of webhook configurations. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**object** | **str** | The type of the object represented by JSON. This object stores information about the webhook configurations in a dictionary. | [optional] [default to 'list'] +**data_ref** | **str** | Identifies the name of the attribute that contains the array of webhook objects. | [optional] [default to 'data'] +**data** | [**List[ManagementProjectsWebhook]**](ManagementProjectsWebhook.md) | Array of webhook objects. | [optional] +**total** | **int** | The total number of webhook objects. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ManagementProjectsWebhooksUpdateRequestBody.md b/docs/ManagementProjectsWebhooksUpdateRequestBody.md new file mode 100644 index 00000000..024df39a --- /dev/null +++ b/docs/ManagementProjectsWebhooksUpdateRequestBody.md @@ -0,0 +1,15 @@ +# ManagementProjectsWebhooksUpdateRequestBody + +Request body schema for **PUT** `v1/management/v1/projects/{projectId}/webhooks`. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**target_url** | **str** | URL address that receives webhooks. | [optional] +**events** | **List[str]** | Lists the events that trigger webhook sendout. | [optional] +**active** | **bool** | Determines if the webhook configuration is active. | [optional] [default to True] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ManagementProjectsWebhooksUpdateResponseBody.md b/docs/ManagementProjectsWebhooksUpdateResponseBody.md new file mode 100644 index 00000000..238ddde8 --- /dev/null +++ b/docs/ManagementProjectsWebhooksUpdateResponseBody.md @@ -0,0 +1,18 @@ +# ManagementProjectsWebhooksUpdateResponseBody + +Response body schema for **PUT** `v1/management/v1/projects/{projectId}/webhooks/{webhookId}`. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **str** | Unique identifier of the webhook. | [optional] +**object** | **str** | The type of the object represented by JSON. | [optional] [default to 'webhook'] +**created_at** | **datetime** | Timestamp representing the date and time when the webhook configuration was created. The value for this parameter is shown in the ISO 8601 format. | [optional] +**target_url** | **str** | URL address that receives webhooks. | [optional] +**events** | **List[str]** | Lists the events that trigger webhook sendout. | [optional] +**active** | **bool** | Determines if the webhook configuration is active. | [optional] [default to True] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/OrderItemProduct.md b/docs/OrderItemProduct.md index 0e9df6e7..4c2a2681 100644 --- a/docs/OrderItemProduct.md +++ b/docs/OrderItemProduct.md @@ -8,7 +8,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **str** | A unique identifier that represents the product and is assigned by Voucherify. | [optional] **source_id** | **str** | The merchant's product ID (if it is different than Voucherify's product ID). It is really useful in case of integration between multiple systems. It can be an ID from an eCommerce site, a database or a 3rd party service. | [optional] -**override** | **bool** | The override set to `true` is used to store the product information in the system. If the product does not exist, it will be created with a source_id; if it does exist, the provided values for the name, price, and metadata will replace those already stored in the system. | [optional] +**override** | **bool** | The override set to `true` is used to store the product information in the system. If the product does not exist, it will be created with a source_id; if it does exist, the provided values for the name, price, and metadata will replace those already stored in the system. Override works only for endpoints that create an order in the database. | [optional] **name** | **str** | Product name. | [optional] **metadata** | **object** | A set of custom key/value pairs that you can attach to a product. It can be useful for storing additional information about the product in a structured format. | [optional] **price** | **float** | Product price. A positive integer in the smallest currency unit (e.g. 100 cents for $1.00). | [optional] diff --git a/docs/ParameterCampaignType.md b/docs/ParameterCampaignType.md index d015eb96..41d5150e 100644 --- a/docs/ParameterCampaignType.md +++ b/docs/ParameterCampaignType.md @@ -13,8 +13,6 @@ * `LOYALTY_PROGRAM` (value: `'LOYALTY_PROGRAM'`) -* `LUCKY_DRAW` (value: `'LUCKY_DRAW'`) - [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/ParameterFiltersListBin.md b/docs/ParameterFiltersListBin.md new file mode 100644 index 00000000..d5cbd19c --- /dev/null +++ b/docs/ParameterFiltersListBin.md @@ -0,0 +1,16 @@ +# ParameterFiltersListBin + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**junction** | [**Junction**](Junction.md) | | [optional] +**id** | [**ParameterFiltersListBinId**](ParameterFiltersListBinId.md) | | [optional] +**resource_type** | [**ParameterFiltersListBinResourceType**](ParameterFiltersListBinResourceType.md) | | [optional] +**resource_name** | [**ParameterFiltersListBinResourceName**](ParameterFiltersListBinResourceName.md) | | [optional] +**resource_id** | [**ParameterFiltersListBinResourceId**](ParameterFiltersListBinResourceId.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ParameterFiltersListBinId.md b/docs/ParameterFiltersListBinId.md new file mode 100644 index 00000000..e78ef88b --- /dev/null +++ b/docs/ParameterFiltersListBinId.md @@ -0,0 +1,13 @@ +# ParameterFiltersListBinId + +Unique identifier of the bin entry. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**conditions** | [**FilterConditionsString**](FilterConditionsString.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ParameterFiltersListBinResourceId.md b/docs/ParameterFiltersListBinResourceId.md new file mode 100644 index 00000000..da656123 --- /dev/null +++ b/docs/ParameterFiltersListBinResourceId.md @@ -0,0 +1,13 @@ +# ParameterFiltersListBinResourceId + +Unique identifier of the resource moved to the bin. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**conditions** | [**FilterConditionsString**](FilterConditionsString.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ParameterFiltersListBinResourceName.md b/docs/ParameterFiltersListBinResourceName.md new file mode 100644 index 00000000..94a10a21 --- /dev/null +++ b/docs/ParameterFiltersListBinResourceName.md @@ -0,0 +1,13 @@ +# ParameterFiltersListBinResourceName + +Name of the resource moved to the bin: the name of the campaign, voucher, product, or SKU. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**conditions** | [**FilterConditionsString**](FilterConditionsString.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ParameterFiltersListBinResourceType.md b/docs/ParameterFiltersListBinResourceType.md new file mode 100644 index 00000000..cc044bff --- /dev/null +++ b/docs/ParameterFiltersListBinResourceType.md @@ -0,0 +1,13 @@ +# ParameterFiltersListBinResourceType + +Resource type of the resource moved to the bin. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**conditions** | [**ParameterFiltersListBinResourceTypeConditions**](ParameterFiltersListBinResourceTypeConditions.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ParameterFiltersListBinResourceTypeConditions.md b/docs/ParameterFiltersListBinResourceTypeConditions.md new file mode 100644 index 00000000..095fee7d --- /dev/null +++ b/docs/ParameterFiltersListBinResourceTypeConditions.md @@ -0,0 +1,19 @@ +# ParameterFiltersListBinResourceTypeConditions + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**var_in** | **List[str]** | Array of resource values that should be included in the results (multiple values). | [optional] +**not_in** | **List[str]** | Array of resource values that should be included in the results (multiple values). | [optional] +**var_is** | **str** | Value is exactly this value (single value). | [optional] +**is_not** | **str** | Results omit this value (single value). | [optional] +**has_value** | **str** | Value is NOT null. The value for this parameter is an empty string. | [optional] +**is_unknown** | **str** | Value is null. The value for this parameter is an empty string. | [optional] +**starts_with** | **str** | Value starts with the specified string. | [optional] +**ends_with** | **str** | Value ends with the specified string. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ParameterFiltersListCampaigns.md b/docs/ParameterFiltersListCampaigns.md new file mode 100644 index 00000000..7bde9456 --- /dev/null +++ b/docs/ParameterFiltersListCampaigns.md @@ -0,0 +1,18 @@ +# ParameterFiltersListCampaigns + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**campaign_status** | [**ParameterFiltersListCampaignsCampaignStatus**](ParameterFiltersListCampaignsCampaignStatus.md) | | [optional] +**is_referral_code** | [**ParameterFiltersListCampaignsIsReferralCode**](ParameterFiltersListCampaignsIsReferralCode.md) | | [optional] +**validity_timeframe** | [**ParameterFiltersListCampaignsValidityTimeframe**](ParameterFiltersListCampaignsValidityTimeframe.md) | | [optional] +**voucher_type** | [**ParameterFiltersListCampaignsVoucherType**](ParameterFiltersListCampaignsVoucherType.md) | | [optional] +**categories** | [**ParameterFiltersListCampaignsCategories**](ParameterFiltersListCampaignsCategories.md) | | [optional] +**category_ids** | [**ParameterFiltersListCampaignsCategoryIds**](ParameterFiltersListCampaignsCategoryIds.md) | | [optional] +**junction** | [**Junction**](Junction.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ParameterFiltersListCampaignsCampaignStatus.md b/docs/ParameterFiltersListCampaignsCampaignStatus.md new file mode 100644 index 00000000..8b7e6cec --- /dev/null +++ b/docs/ParameterFiltersListCampaignsCampaignStatus.md @@ -0,0 +1,13 @@ +# ParameterFiltersListCampaignsCampaignStatus + +Type of the campaign. Allowed values: `DONE`, `IN_PROGRESS`, `DRAFT`, `FAILED` `MODIFYING` + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**conditions** | [**ParameterFiltersListCampaignsCampaignStatusConditions**](ParameterFiltersListCampaignsCampaignStatusConditions.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ParameterFiltersListCampaignsCampaignStatusConditions.md b/docs/ParameterFiltersListCampaignsCampaignStatusConditions.md new file mode 100644 index 00000000..0510228e --- /dev/null +++ b/docs/ParameterFiltersListCampaignsCampaignStatusConditions.md @@ -0,0 +1,19 @@ +# ParameterFiltersListCampaignsCampaignStatusConditions + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**var_in** | **List[str]** | Array of resource values that should be included in the results (multiple values). | [optional] +**not_in** | **List[str]** | Array of resource values that should be included in the results (multiple values). | [optional] +**var_is** | **str** | Value is exactly this value (single value). | [optional] +**is_not** | **str** | Results omit this value (single value). | [optional] +**has_value** | **str** | Value is NOT null. The value for this parameter is an empty string. | [optional] +**is_unknown** | **str** | Value is null. The value for this parameter is an empty string. | [optional] +**starts_with** | **str** | Value starts with the specified string. | [optional] +**ends_with** | **str** | Value ends with the specified string. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ParameterFiltersListCampaignsCategories.md b/docs/ParameterFiltersListCampaignsCategories.md new file mode 100644 index 00000000..66ecffef --- /dev/null +++ b/docs/ParameterFiltersListCampaignsCategories.md @@ -0,0 +1,13 @@ +# ParameterFiltersListCampaignsCategories + +Filter by categories names + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**conditions** | [**FilterConditionsString**](FilterConditionsString.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ParameterFiltersListCampaignsCategoryIds.md b/docs/ParameterFiltersListCampaignsCategoryIds.md new file mode 100644 index 00000000..727d4d29 --- /dev/null +++ b/docs/ParameterFiltersListCampaignsCategoryIds.md @@ -0,0 +1,13 @@ +# ParameterFiltersListCampaignsCategoryIds + +Filter by categories ids + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**conditions** | [**FilterConditionsString**](FilterConditionsString.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ParameterFiltersListCampaignsIsReferralCode.md b/docs/ParameterFiltersListCampaignsIsReferralCode.md new file mode 100644 index 00000000..aa17986b --- /dev/null +++ b/docs/ParameterFiltersListCampaignsIsReferralCode.md @@ -0,0 +1,14 @@ +# ParameterFiltersListCampaignsIsReferralCode + + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**var_is** | **str** | Value is exactly this value (single value). | [optional] +**is_not** | **str** | Results omit this value (single value). | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ParameterFiltersListCampaignsValidityTimeframe.md b/docs/ParameterFiltersListCampaignsValidityTimeframe.md new file mode 100644 index 00000000..d8176a02 --- /dev/null +++ b/docs/ParameterFiltersListCampaignsValidityTimeframe.md @@ -0,0 +1,13 @@ +# ParameterFiltersListCampaignsValidityTimeframe + +Filter by validity timeframe + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**conditions** | [**FilterConditionsDateTime**](FilterConditionsDateTime.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ParameterFiltersListCampaignsVoucherType.md b/docs/ParameterFiltersListCampaignsVoucherType.md new file mode 100644 index 00000000..078ea5a1 --- /dev/null +++ b/docs/ParameterFiltersListCampaignsVoucherType.md @@ -0,0 +1,13 @@ +# ParameterFiltersListCampaignsVoucherType + +Filter by voucher type + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**conditions** | [**FilterConditionsString**](FilterConditionsString.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ParameterFiltersListCustomerRedeemables.md b/docs/ParameterFiltersListCustomerRedeemables.md index 98e6bf23..e759fd69 100644 --- a/docs/ParameterFiltersListCustomerRedeemables.md +++ b/docs/ParameterFiltersListCustomerRedeemables.md @@ -13,6 +13,7 @@ Name | Type | Description | Notes **campaign_id** | [**ParameterFiltersListCustomerRedeemablesCampaignId**](ParameterFiltersListCustomerRedeemablesCampaignId.md) | | [optional] **campaign_type** | [**ParameterFiltersListCustomerRedeemablesCampaignType**](ParameterFiltersListCustomerRedeemablesCampaignType.md) | | [optional] **voucher_type** | [**ParameterFiltersListCustomerRedeemablesVoucherType**](ParameterFiltersListCustomerRedeemablesVoucherType.md) | | [optional] +**junction** | [**Junction**](Junction.md) | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/ParameterFiltersListCustomerRedeemablesCampaignId.md b/docs/ParameterFiltersListCustomerRedeemablesCampaignId.md index afdc296a..0e76eeb6 100644 --- a/docs/ParameterFiltersListCustomerRedeemablesCampaignId.md +++ b/docs/ParameterFiltersListCustomerRedeemablesCampaignId.md @@ -7,7 +7,6 @@ Unique campaign identifer, e.g. `camp_bfrwAVsP6Q1EM1ZjgHwheKYr`. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **conditions** | [**FilterConditionsString**](FilterConditionsString.md) | | [optional] -**junction** | [**Junction**](Junction.md) | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/ParameterFiltersListCustomerRedeemablesCampaignType.md b/docs/ParameterFiltersListCustomerRedeemablesCampaignType.md index 9f3201f4..1fd5dfb4 100644 --- a/docs/ParameterFiltersListCustomerRedeemablesCampaignType.md +++ b/docs/ParameterFiltersListCustomerRedeemablesCampaignType.md @@ -7,7 +7,6 @@ Type of the campaign. Allowed values: `DISCOUNT_COUPONS`, `REFERRAL_PROGRAM`, `G Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **conditions** | [**ParameterFiltersListCustomerRedeemablesCampaignTypeConditions**](ParameterFiltersListCustomerRedeemablesCampaignTypeConditions.md) | | [optional] -**junction** | [**Junction**](Junction.md) | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/ParameterFiltersListCustomerRedeemablesCreatedAt.md b/docs/ParameterFiltersListCustomerRedeemablesCreatedAt.md index b7c56e20..3c8b1d81 100644 --- a/docs/ParameterFiltersListCustomerRedeemablesCreatedAt.md +++ b/docs/ParameterFiltersListCustomerRedeemablesCreatedAt.md @@ -6,8 +6,7 @@ Timestamp representing the date and time when the customer redeemable was create Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**conditions** | [**ParameterFiltersListCustomerRedeemablesCreatedAtConditions**](ParameterFiltersListCustomerRedeemablesCreatedAtConditions.md) | | [optional] -**junction** | [**Junction**](Junction.md) | | [optional] +**conditions** | [**FilterConditionsDateTime**](FilterConditionsDateTime.md) | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/ParameterFiltersListCustomerRedeemablesHolderRole.md b/docs/ParameterFiltersListCustomerRedeemablesHolderRole.md index 6402612e..c8978606 100644 --- a/docs/ParameterFiltersListCustomerRedeemablesHolderRole.md +++ b/docs/ParameterFiltersListCustomerRedeemablesHolderRole.md @@ -7,7 +7,6 @@ Holder role of the redeemable. Allowed values: `OWNER`, `REFEREE`, `REFERRER`. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **conditions** | [**ParameterFiltersListCustomerRedeemablesHolderRoleConditions**](ParameterFiltersListCustomerRedeemablesHolderRoleConditions.md) | | [optional] -**junction** | [**Junction**](Junction.md) | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/ParameterFiltersListCustomerRedeemablesId.md b/docs/ParameterFiltersListCustomerRedeemablesId.md index 3ff69a7c..2b7437db 100644 --- a/docs/ParameterFiltersListCustomerRedeemablesId.md +++ b/docs/ParameterFiltersListCustomerRedeemablesId.md @@ -7,7 +7,6 @@ Unique redeemable holder ID, i.e. `rh_0e77502f84f0f4a6a8`. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **conditions** | [**FilterConditionsString**](FilterConditionsString.md) | | [optional] -**junction** | [**Junction**](Junction.md) | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/ParameterFiltersListCustomerRedeemablesRedeemableId.md b/docs/ParameterFiltersListCustomerRedeemablesRedeemableId.md index 77dadbe5..3882526f 100644 --- a/docs/ParameterFiltersListCustomerRedeemablesRedeemableId.md +++ b/docs/ParameterFiltersListCustomerRedeemablesRedeemableId.md @@ -7,7 +7,6 @@ Unique redeemable ID, e.g. `v_hS8JFl8S6lNcd1L69wLIoXgTio7eWEgk`. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **conditions** | [**FilterConditionsString**](FilterConditionsString.md) | | [optional] -**junction** | [**Junction**](Junction.md) | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/ParameterFiltersListCustomerRedeemablesRedeemableObject.md b/docs/ParameterFiltersListCustomerRedeemablesRedeemableObject.md index 268256f1..01bf0781 100644 --- a/docs/ParameterFiltersListCustomerRedeemablesRedeemableObject.md +++ b/docs/ParameterFiltersListCustomerRedeemablesRedeemableObject.md @@ -7,7 +7,6 @@ Unique related object, i.e. `voucher`. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **conditions** | [**ParameterFiltersListCustomerRedeemablesRedeemableObjectConditions**](ParameterFiltersListCustomerRedeemablesRedeemableObjectConditions.md) | | [optional] -**junction** | [**Junction**](Junction.md) | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/ParameterFiltersListCustomerRedeemablesVoucherType.md b/docs/ParameterFiltersListCustomerRedeemablesVoucherType.md index 2f1f218b..fbed2ad5 100644 --- a/docs/ParameterFiltersListCustomerRedeemablesVoucherType.md +++ b/docs/ParameterFiltersListCustomerRedeemablesVoucherType.md @@ -7,7 +7,6 @@ Type of the voucher. Allowed values: `DISCOUNT_VOUCHER`, `GIFT_VOUCHER`, `LOYALT Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **conditions** | [**ParameterFiltersListCustomerRedeemablesVoucherTypeConditions**](ParameterFiltersListCustomerRedeemablesVoucherTypeConditions.md) | | [optional] -**junction** | [**Junction**](Junction.md) | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/ParameterFiltersListPublications.md b/docs/ParameterFiltersListPublications.md new file mode 100644 index 00000000..65cbc36e --- /dev/null +++ b/docs/ParameterFiltersListPublications.md @@ -0,0 +1,21 @@ +# ParameterFiltersListPublications + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**junction** | [**Junction**](Junction.md) | | [optional] +**failure_code** | [**ParameterFiltersListPublicationsFailureCode**](ParameterFiltersListPublicationsFailureCode.md) | | [optional] +**result** | [**ParameterFiltersListPublicationsResult**](ParameterFiltersListPublicationsResult.md) | | [optional] +**customer_id** | [**ParameterFiltersListPublicationsCustomerId**](ParameterFiltersListPublicationsCustomerId.md) | | [optional] +**campaign_name** | [**ParameterFiltersListPublicationsCampaignName**](ParameterFiltersListPublicationsCampaignName.md) | | [optional] +**voucher_type** | [**ParameterFiltersListPublicationsVoucherType**](ParameterFiltersListPublicationsVoucherType.md) | | [optional] +**is_referral_code** | [**ParameterFiltersListPublicationsIsReferralCode**](ParameterFiltersListPublicationsIsReferralCode.md) | | [optional] +**parent_object_id** | [**ParameterFiltersListPublicationsParentObjectId**](ParameterFiltersListPublicationsParentObjectId.md) | | [optional] +**related_object_id** | [**ParameterFiltersListPublicationsRelatedObjectId**](ParameterFiltersListPublicationsRelatedObjectId.md) | | [optional] +**source_id** | [**ParameterFiltersListPublicationsSourceId**](ParameterFiltersListPublicationsSourceId.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ParameterFiltersListPublicationsCampaignName.md b/docs/ParameterFiltersListPublicationsCampaignName.md new file mode 100644 index 00000000..18b34239 --- /dev/null +++ b/docs/ParameterFiltersListPublicationsCampaignName.md @@ -0,0 +1,13 @@ +# ParameterFiltersListPublicationsCampaignName + +Filter publications by campaign names. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**conditions** | [**FilterConditionsString**](FilterConditionsString.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ParameterFiltersListPublicationsCustomerId.md b/docs/ParameterFiltersListPublicationsCustomerId.md new file mode 100644 index 00000000..f639627a --- /dev/null +++ b/docs/ParameterFiltersListPublicationsCustomerId.md @@ -0,0 +1,13 @@ +# ParameterFiltersListPublicationsCustomerId + +Filter publications by customer ids. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**conditions** | [**FilterConditionsString**](FilterConditionsString.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ParameterFiltersListPublicationsFailureCode.md b/docs/ParameterFiltersListPublicationsFailureCode.md new file mode 100644 index 00000000..c529a728 --- /dev/null +++ b/docs/ParameterFiltersListPublicationsFailureCode.md @@ -0,0 +1,13 @@ +# ParameterFiltersListPublicationsFailureCode + +Filter publications by ids. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**conditions** | [**FilterConditionsString**](FilterConditionsString.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ParameterFiltersListPublicationsIsReferralCode.md b/docs/ParameterFiltersListPublicationsIsReferralCode.md new file mode 100644 index 00000000..0e12d94a --- /dev/null +++ b/docs/ParameterFiltersListPublicationsIsReferralCode.md @@ -0,0 +1,13 @@ +# ParameterFiltersListPublicationsIsReferralCode + +Filter publications by is referall code. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**conditions** | [**FilterConditionsString**](FilterConditionsString.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ParameterFiltersListPublicationsParentObjectId.md b/docs/ParameterFiltersListPublicationsParentObjectId.md new file mode 100644 index 00000000..3f457908 --- /dev/null +++ b/docs/ParameterFiltersListPublicationsParentObjectId.md @@ -0,0 +1,13 @@ +# ParameterFiltersListPublicationsParentObjectId + +Filter publications by parent object id. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**conditions** | [**FilterConditionsString**](FilterConditionsString.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ParameterFiltersListPublicationsRelatedObjectId.md b/docs/ParameterFiltersListPublicationsRelatedObjectId.md new file mode 100644 index 00000000..cfd47fb4 --- /dev/null +++ b/docs/ParameterFiltersListPublicationsRelatedObjectId.md @@ -0,0 +1,13 @@ +# ParameterFiltersListPublicationsRelatedObjectId + +Filter publications by related object id. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**conditions** | [**FilterConditionsString**](FilterConditionsString.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ParameterFiltersListPublicationsResult.md b/docs/ParameterFiltersListPublicationsResult.md new file mode 100644 index 00000000..e031279a --- /dev/null +++ b/docs/ParameterFiltersListPublicationsResult.md @@ -0,0 +1,13 @@ +# ParameterFiltersListPublicationsResult + +Filter publications by names. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**conditions** | [**FilterConditionsString**](FilterConditionsString.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ParameterFiltersListPublicationsSourceId.md b/docs/ParameterFiltersListPublicationsSourceId.md new file mode 100644 index 00000000..2f4a9303 --- /dev/null +++ b/docs/ParameterFiltersListPublicationsSourceId.md @@ -0,0 +1,13 @@ +# ParameterFiltersListPublicationsSourceId + +Filter publications by source id. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**conditions** | [**FilterConditionsString**](FilterConditionsString.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ParameterFiltersListPublicationsVoucherType.md b/docs/ParameterFiltersListPublicationsVoucherType.md new file mode 100644 index 00000000..12c322e0 --- /dev/null +++ b/docs/ParameterFiltersListPublicationsVoucherType.md @@ -0,0 +1,13 @@ +# ParameterFiltersListPublicationsVoucherType + +Filter publications by voucher types. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**conditions** | [**FilterConditionsString**](FilterConditionsString.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ParameterFiltersListRedemptions.md b/docs/ParameterFiltersListRedemptions.md index 35ef19e3..5ac8a0f6 100644 --- a/docs/ParameterFiltersListRedemptions.md +++ b/docs/ParameterFiltersListRedemptions.md @@ -15,6 +15,7 @@ Name | Type | Description | Notes **customer_id** | [**ParameterFiltersListRedemptionsCustomerId**](ParameterFiltersListRedemptionsCustomerId.md) | | [optional] **campaign_name** | [**ParameterFiltersListRedemptionsCampaignName**](ParameterFiltersListRedemptionsCampaignName.md) | | [optional] **user_login** | [**ParameterFiltersListRedemptionsUserLogin**](ParameterFiltersListRedemptionsUserLogin.md) | | [optional] +**junction** | [**Junction**](Junction.md) | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/ParameterFiltersListRedemptionsCampaignName.md b/docs/ParameterFiltersListRedemptionsCampaignName.md index a135fc5c..22fc784c 100644 --- a/docs/ParameterFiltersListRedemptionsCampaignName.md +++ b/docs/ParameterFiltersListRedemptionsCampaignName.md @@ -7,7 +7,6 @@ Campaign name. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **conditions** | [**FilterConditionsString**](FilterConditionsString.md) | | [optional] -**junction** | [**Junction**](Junction.md) | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/ParameterFiltersListRedemptionsCustomerId.md b/docs/ParameterFiltersListRedemptionsCustomerId.md index 382d7761..1a2334ff 100644 --- a/docs/ParameterFiltersListRedemptionsCustomerId.md +++ b/docs/ParameterFiltersListRedemptionsCustomerId.md @@ -7,7 +7,6 @@ Unique customer ID, i.e. cust_sehkNIi8Uq2qQuRqSr7xn4Zi. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **conditions** | [**FilterConditionsString**](FilterConditionsString.md) | | [optional] -**junction** | [**Junction**](Junction.md) | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/ParameterFiltersListRedemptionsFailureCode.md b/docs/ParameterFiltersListRedemptionsFailureCode.md index 76eee48f..15f418bc 100644 --- a/docs/ParameterFiltersListRedemptionsFailureCode.md +++ b/docs/ParameterFiltersListRedemptionsFailureCode.md @@ -7,7 +7,6 @@ Failure code, i.e. quantity_exceeded. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **conditions** | [**FilterConditionsString**](FilterConditionsString.md) | | [optional] -**junction** | [**Junction**](Junction.md) | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/ParameterFiltersListRedemptionsObject.md b/docs/ParameterFiltersListRedemptionsObject.md index 300a54c6..1b33b0e7 100644 --- a/docs/ParameterFiltersListRedemptionsObject.md +++ b/docs/ParameterFiltersListRedemptionsObject.md @@ -7,7 +7,6 @@ Specify which type of object to return, i.e. `redemption` or `redemption_rollbac Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **conditions** | [**FilterConditionsString**](FilterConditionsString.md) | | [optional] -**junction** | [**Junction**](Junction.md) | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/ParameterFiltersListRedemptionsParentRedemptionId.md b/docs/ParameterFiltersListRedemptionsParentRedemptionId.md index 228f595d..3d2b04ae 100644 --- a/docs/ParameterFiltersListRedemptionsParentRedemptionId.md +++ b/docs/ParameterFiltersListRedemptionsParentRedemptionId.md @@ -7,7 +7,6 @@ Unique parent redemption ID, i.e. r_0c5952900bcbfd54b6. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **conditions** | [**FilterConditionsString**](FilterConditionsString.md) | | [optional] -**junction** | [**Junction**](Junction.md) | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/ParameterFiltersListRedemptionsRelatedObjectId.md b/docs/ParameterFiltersListRedemptionsRelatedObjectId.md index a4f7630c..5d8dbedf 100644 --- a/docs/ParameterFiltersListRedemptionsRelatedObjectId.md +++ b/docs/ParameterFiltersListRedemptionsRelatedObjectId.md @@ -7,7 +7,6 @@ Unique related object ID, i.e. v_hS8JFl8S6lNcd1L69wLIoXgTio7eWEgk. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **conditions** | [**FilterConditionsString**](FilterConditionsString.md) | | [optional] -**junction** | [**Junction**](Junction.md) | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/ParameterFiltersListRedemptionsRelatedObjectParentId.md b/docs/ParameterFiltersListRedemptionsRelatedObjectParentId.md index 8cdcfcb0..3f4ef223 100644 --- a/docs/ParameterFiltersListRedemptionsRelatedObjectParentId.md +++ b/docs/ParameterFiltersListRedemptionsRelatedObjectParentId.md @@ -7,7 +7,6 @@ Unique related object parent ID, i.e. camp_22noMlhTADb7Fq2UL3vWu3d1. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **conditions** | [**FilterConditionsString**](FilterConditionsString.md) | | [optional] -**junction** | [**Junction**](Junction.md) | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/ParameterFiltersListRedemptionsResult.md b/docs/ParameterFiltersListRedemptionsResult.md index 788162b0..4a0d1f9c 100644 --- a/docs/ParameterFiltersListRedemptionsResult.md +++ b/docs/ParameterFiltersListRedemptionsResult.md @@ -7,7 +7,6 @@ Result, i.e. `SUCCESS` or `FAILURE`. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **conditions** | [**FilterConditionsString**](FilterConditionsString.md) | | [optional] -**junction** | [**Junction**](Junction.md) | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/ParameterFiltersListRedemptionsUserLogin.md b/docs/ParameterFiltersListRedemptionsUserLogin.md index 3fdb5994..0bc1cf19 100644 --- a/docs/ParameterFiltersListRedemptionsUserLogin.md +++ b/docs/ParameterFiltersListRedemptionsUserLogin.md @@ -7,7 +7,6 @@ User login used to login to Voucherify, i.e. name.lastname@email.com Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **conditions** | [**FilterConditionsString**](FilterConditionsString.md) | | [optional] -**junction** | [**Junction**](Junction.md) | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/ParameterFiltersListRedemptionsVoucherCode.md b/docs/ParameterFiltersListRedemptionsVoucherCode.md index 922acdb8..aa4f1d55 100644 --- a/docs/ParameterFiltersListRedemptionsVoucherCode.md +++ b/docs/ParameterFiltersListRedemptionsVoucherCode.md @@ -7,7 +7,6 @@ Unique voucher code. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **conditions** | [**FilterConditionsString**](FilterConditionsString.md) | | [optional] -**junction** | [**Junction**](Junction.md) | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/ParameterOrderListBin.md b/docs/ParameterOrderListBin.md new file mode 100644 index 00000000..1bbc1b72 --- /dev/null +++ b/docs/ParameterOrderListBin.md @@ -0,0 +1,12 @@ +# ParameterOrderListBin + + +## Enum + +* `ID` (value: `'id'`) + +* `MINUS_ID` (value: `'-id'`) + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ParameterVoucherTypeListPublications.md b/docs/ParameterVoucherTypeListPublications.md index 47f46c4e..f4d62746 100644 --- a/docs/ParameterVoucherTypeListPublications.md +++ b/docs/ParameterVoucherTypeListPublications.md @@ -7,8 +7,6 @@ * `LOYALTY` (value: `'loyalty'`) -* `LUCKY_DRAW` (value: `'lucky_draw'`) - [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/PublicationsApi.md b/docs/PublicationsApi.md index 00830333..e97054c8 100644 --- a/docs/PublicationsApi.md +++ b/docs/PublicationsApi.md @@ -210,6 +210,7 @@ Retrieve a list of publications. To return a **particular** publication, you can ```python import voucherify +from voucherify.models.parameter_filters_list_publications import ParameterFiltersListPublications from voucherify.models.parameter_order_list_publications import ParameterOrderListPublications from voucherify.models.parameter_result_list_publications import ParameterResultListPublications from voucherify.models.parameter_voucher_type_list_publications import ParameterVoucherTypeListPublications @@ -253,7 +254,7 @@ with voucherify.ApiClient(configuration) as api_client: result = voucherify.ParameterResultListPublications() # ParameterResultListPublications | Filters by a publication result. (optional) voucher_type = voucherify.ParameterVoucherTypeListPublications() # ParameterVoucherTypeListPublications | Filters by a voucher type. (optional) is_referral_code = True # bool | This filter works only for the true option. If set to true, the query returns only publications of codes from referral campaigns. (optional) - filters = 'filters_example' # str | Allows for combining the filters mentioned in the endpoint description. (optional) + filters = voucherify.ParameterFiltersListPublications() # ParameterFiltersListPublications | Filters for listing publications. (optional) source_id = 'source_id_example' # str | Using this endpoint with a particular publication source_id, which was sent with the original request to create a publication, returns in the response, exactly the same code published initially because the code was assigned to the given publication. As a result, you can use this endpoint as a reference and return a code that was assigned in a publication by using a particular source_id. (optional) try: @@ -281,7 +282,7 @@ Name | Type | Description | Notes **result** | [**ParameterResultListPublications**](.md)| Filters by a publication result. | [optional] **voucher_type** | [**ParameterVoucherTypeListPublications**](.md)| Filters by a voucher type. | [optional] **is_referral_code** | **bool**| This filter works only for the true option. If set to true, the query returns only publications of codes from referral campaigns. | [optional] - **filters** | **str**| Allows for combining the filters mentioned in the endpoint description. | [optional] + **filters** | [**ParameterFiltersListPublications**](.md)| Filters for listing publications. | [optional] **source_id** | **str**| Using this endpoint with a particular publication source_id, which was sent with the original request to create a publication, returns in the response, exactly the same code published initially because the code was assigned to the given publication. As a result, you can use this endpoint as a reference and return a code that was assigned in a publication by using a particular source_id. | [optional] ### Return type diff --git a/docs/TrashBinItem.md b/docs/TrashBinItem.md new file mode 100644 index 00000000..58111ada --- /dev/null +++ b/docs/TrashBinItem.md @@ -0,0 +1,20 @@ +# TrashBinItem + +Resource moved to the bin, i.e. a campaign, product, SKU, or voucher. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **str** | Unique identifier of the trash bin entry. It should not be confused with the ID of the resource moved to the bin. | [optional] +**created_at** | **datetime** | Timestamp representing the date and time when the resource was moved to the bin. The value for this parameter is shown in the ISO 8601 format. | [optional] +**deleted_by_user_id** | **str** | Unique identifier of the user who moved the resource to the bin. It returns a user ID if the resource was moved to the bin through an action in the website. It returns a `null` if the resource was deleted through the API. | [optional] +**resource_id** | **str** | Unique identifier of the resource moved to the bin, i.e. an ID of a campaign, product, SKU, or voucher. | [optional] +**resource_type** | **str** | Type of the resource moved to the bin. | [optional] +**resource_name** | **str** | Name of the resouce moved to the bin. It is the name of the campaign, product or SKU, or the voucher code. | [optional] +**resource_parent_id** | **str** | Unique identifier of the parent resource. For a voucher, it is a campaign ID, except for standalone vouchers. For an SKU, it is the product ID. It returns `null` for campaigns and base products. | [optional] +**object** | **str** | The type of the object represented by JSON. It is equal to the `resource_type`. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/TrashBinListResponseBody.md b/docs/TrashBinListResponseBody.md new file mode 100644 index 00000000..ebad51dc --- /dev/null +++ b/docs/TrashBinListResponseBody.md @@ -0,0 +1,18 @@ +# TrashBinListResponseBody + +Retrieves a list of the resources moved the bin. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**object** | **str** | The type of the object represented by JSON. This object stores information about the bin entries in a dictionary. | [optional] [default to 'list'] +**data_ref** | **str** | Identifies the name of the attribute that contains the array of bin entry objects. | [optional] [default to 'data'] +**data** | [**List[TrashBinItem]**](TrashBinItem.md) | Array of bin entry objects. | [optional] +**total** | **int** | The total number of bin entries. This is the number of the entries returned in the array, not the number of all matching results or all resources currently moved to the bin. | [optional] +**has_more** | **bool** | As query results are always limited (by the limit parameter), the `has_more` flag indicates if there are more records for given filter parameters. This lets you know if you can run another request with a `starting_after_id` query or a different limit to get more records returned in the results. | [optional] +**more_starting_after** | **str** | If `has_more` is `true`, it returns an ID that can be used to return another page of results. Use the ID in the `starting_after_id` query parameter to display another page of the results occuring after the field with that ID. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/UsageNotifications.md b/docs/UsageNotifications.md new file mode 100644 index 00000000..7ac101b6 --- /dev/null +++ b/docs/UsageNotifications.md @@ -0,0 +1,15 @@ +# UsageNotifications + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**enabled** | **bool** | Enables the notification. | [optional] +**value** | **int** | The percent value of the limit which, when reached, triggers the notification. | [optional] +**in_app** | **bool** | Enables the notification in the application. | [optional] +**emails** | **List[str]** | An array of email addresses which will receive the notification. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/User.md b/docs/User.md new file mode 100644 index 00000000..234282bd --- /dev/null +++ b/docs/User.md @@ -0,0 +1,19 @@ +# User + +Details about the user. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **str** | The unique identifier of the user who has been assigned to the project. | [optional] +**login** | **str** | The login data of the user who has been assigned to the project. | [optional] +**email** | **str** | The email address of the user who has been assigned to the project. | [optional] +**first_name** | **str** | The first name of the user who has been assigned to the project. | [optional] +**last_name** | **str** | The last name of the user who has been assigned to the project. | [optional] +**projects** | **object** | Lists key-value pairs, where the key is the project to which the user is assigned. The value is the role assigned in a given project. The predefined Voucherify roles are: `ADMIN`, `USER`, `VIEWER`, `MERCHANT`, `USER_RESTRICTED` (for the Areas and Stores, an Enterprise feature). | [optional] +**is_owner** | **bool** | Determines if the user is the owner for the organization in Voucherify. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ValidationRule.md b/docs/ValidationRule.md index d2e9fac4..5bede5c4 100644 --- a/docs/ValidationRule.md +++ b/docs/ValidationRule.md @@ -10,7 +10,7 @@ Name | Type | Description | Notes **error** | [**ValidationRuleError**](ValidationRuleError.md) | | [optional] **applicable_to** | [**ValidationRuleApplicableTo**](ValidationRuleApplicableTo.md) | | [optional] **type** | **str** | Type of validation rule. | [optional] [default to 'expression'] -**context_type** | **str** | Validation rule context type. | **Context Type** | **Definition** | |:---|:---| | earning_rule.order.paid | | | earning_rule.custom_event | | | earning_rule.customer.segment.entered | | | campaign.discount_coupons | | | campaign.discount_coupons.discount.apply_to_order | | | campaign.discount_coupons.discount.apply_to_items | | | campaign.discount_coupons.discount.apply_to_items_proportionally | | | campaign.discount_coupons.discount.apply_to_items_proportionally_by_quantity | | | campaign.discount_coupons.discount.fixed.apply_to_items | | | campaign.gift_vouchers | | | campaign.gift_vouchers.gift.apply_to_order | | | campaign.gift_vouchers.gift.apply_to_items | | | campaign.referral_program | | | campaign.referral_program.discount.apply_to_order | | | campaign.referral_program.discount.apply_to_items | | | campaign.referral_program.discount.apply_to_items_proportionally | | | campaign.referral_program.discount.apply_to_items_proportionally_by_quantity | | | campaign.referral_program.discount.fixed.apply_to_items | | | campaign.promotion | | | campaign.promotion.discount.apply_to_order | | | campaign.promotion.discount.apply_to_items | | | campaign.promotion.discount.apply_to_items_proportionally | | | campaign.promotion.discount.apply_to_items_proportionally_by_quantity | | | campaign.promotion.discount.fixed.apply_to_items | | | campaign.loyalty_program | | | campaign.lucky_draw | | | voucher.discount_voucher | | | voucher.discount_voucher.discount.apply_to_order | | | voucher.discount_voucher.discount.apply_to_items | | | voucher.discount_voucher.discount.apply_to_items_proportionally | | | voucher.discount_voucher.discount.apply_to_items_proportionally_by_quantity | | | voucher.discount_voucher.discount.fixed.apply_to_items | | | voucher.gift_voucher | | | voucher.gift_voucher.gift.apply_to_order | | | voucher.gift_voucher.gift.apply_to_items | | | voucher.loyalty_card | | | voucher.lucky_draw_code | | | distribution.custom_event | | | reward_assignment.pay_with_points | | | global | | | [optional] [default to 'global'] +**context_type** | **str** | Validation rule context type. | **Context Type** | **Definition** | |:---|:---| | earning_rule.order.paid | | | earning_rule.custom_event | | | earning_rule.customer.segment.entered | | | campaign.discount_coupons | | | campaign.discount_coupons.discount.apply_to_order | | | campaign.discount_coupons.discount.apply_to_items | | | campaign.discount_coupons.discount.apply_to_items_proportionally | | | campaign.discount_coupons.discount.apply_to_items_proportionally_by_quantity | | | campaign.discount_coupons.discount.fixed.apply_to_items | | | campaign.gift_vouchers | | | campaign.gift_vouchers.gift.apply_to_order | | | campaign.gift_vouchers.gift.apply_to_items | | | campaign.referral_program | | | campaign.referral_program.discount.apply_to_order | | | campaign.referral_program.discount.apply_to_items | | | campaign.referral_program.discount.apply_to_items_proportionally | | | campaign.referral_program.discount.apply_to_items_proportionally_by_quantity | | | campaign.referral_program.discount.fixed.apply_to_items | | | campaign.promotion | | | campaign.promotion.discount.apply_to_order | | | campaign.promotion.discount.apply_to_items | | | campaign.promotion.discount.apply_to_items_proportionally | | | campaign.promotion.discount.apply_to_items_proportionally_by_quantity | | | campaign.promotion.discount.fixed.apply_to_items | | | campaign.loyalty_program | | | voucher.discount_voucher | | | voucher.discount_voucher.discount.apply_to_order | | | voucher.discount_voucher.discount.apply_to_items | | | voucher.discount_voucher.discount.apply_to_items_proportionally | | | voucher.discount_voucher.discount.apply_to_items_proportionally_by_quantity | | | voucher.discount_voucher.discount.fixed.apply_to_items | | | voucher.gift_voucher | | | voucher.gift_voucher.gift.apply_to_order | | | voucher.gift_voucher.gift.apply_to_items | | | voucher.loyalty_card | | | distribution.custom_event | | | reward_assignment.pay_with_points | | | global | | | [optional] [default to 'global'] **id** | **str** | Unique validation rule ID. | [optional] **created_at** | **datetime** | Timestamp representing the date and time when the validation rule was created. The value is shown in the ISO 8601 format. | [optional] **updated_at** | **datetime** | Timestamp representing the date and time when the validation rule was updated. The value is shown in the ISO 8601 format. | [optional] diff --git a/docs/ValidationRulesCreateRequestBody.md b/docs/ValidationRulesCreateRequestBody.md index 4f6d6712..a44b6bdd 100644 --- a/docs/ValidationRulesCreateRequestBody.md +++ b/docs/ValidationRulesCreateRequestBody.md @@ -11,7 +11,7 @@ Name | Type | Description | Notes **error** | [**ValidationRulesCreateRequestBodyError**](ValidationRulesCreateRequestBodyError.md) | | [optional] **applicable_to** | [**ValidationRulesCreateRequestBodyApplicableTo**](ValidationRulesCreateRequestBodyApplicableTo.md) | | [optional] **type** | **str** | Type of validation rule. | [optional] [default to 'expression'] -**context_type** | **str** | Validation rule context type. | **Context Type** | **Definition** | |:---|:---| | earning_rule.order.paid | | | earning_rule.custom_event | | | earning_rule.customer.segment.entered | | | campaign.discount_coupons | | | campaign.discount_coupons.discount.apply_to_order | | | campaign.discount_coupons.discount.apply_to_items | | | campaign.discount_coupons.discount.apply_to_items_proportionally | | | campaign.discount_coupons.discount.apply_to_items_proportionally_by_quantity | | | campaign.discount_coupons.discount.fixed.apply_to_items | | | campaign.gift_vouchers | | | campaign.gift_vouchers.gift.apply_to_order | | | campaign.gift_vouchers.gift.apply_to_items | | | campaign.referral_program | | | campaign.referral_program.discount.apply_to_order | | | campaign.referral_program.discount.apply_to_items | | | campaign.referral_program.discount.apply_to_items_proportionally | | | campaign.referral_program.discount.apply_to_items_proportionally_by_quantity | | | campaign.referral_program.discount.fixed.apply_to_items | | | campaign.promotion | | | campaign.promotion.discount.apply_to_order | | | campaign.promotion.discount.apply_to_items | | | campaign.promotion.discount.apply_to_items_proportionally | | | campaign.promotion.discount.apply_to_items_proportionally_by_quantity | | | campaign.promotion.discount.fixed.apply_to_items | | | campaign.loyalty_program | | | campaign.lucky_draw | | | voucher.discount_voucher | | | voucher.discount_voucher.discount.apply_to_order | | | voucher.discount_voucher.discount.apply_to_items | | | voucher.discount_voucher.discount.apply_to_items_proportionally | | | voucher.discount_voucher.discount.apply_to_items_proportionally_by_quantity | | | voucher.discount_voucher.discount.fixed.apply_to_items | | | voucher.gift_voucher | | | voucher.gift_voucher.gift.apply_to_order | | | voucher.gift_voucher.gift.apply_to_items | | | voucher.loyalty_card | | | voucher.lucky_draw_code | | | distribution.custom_event | | | reward_assignment.pay_with_points | | | global | | | [optional] [default to 'global'] +**context_type** | **str** | Validation rule context type. | **Context Type** | **Definition** | |:---|:---| | earning_rule.order.paid | | | earning_rule.custom_event | | | earning_rule.customer.segment.entered | | | campaign.discount_coupons | | | campaign.discount_coupons.discount.apply_to_order | | | campaign.discount_coupons.discount.apply_to_items | | | campaign.discount_coupons.discount.apply_to_items_proportionally | | | campaign.discount_coupons.discount.apply_to_items_proportionally_by_quantity | | | campaign.discount_coupons.discount.fixed.apply_to_items | | | campaign.gift_vouchers | | | campaign.gift_vouchers.gift.apply_to_order | | | campaign.gift_vouchers.gift.apply_to_items | | | campaign.referral_program | | | campaign.referral_program.discount.apply_to_order | | | campaign.referral_program.discount.apply_to_items | | | campaign.referral_program.discount.apply_to_items_proportionally | | | campaign.referral_program.discount.apply_to_items_proportionally_by_quantity | | | campaign.referral_program.discount.fixed.apply_to_items | | | campaign.promotion | | | campaign.promotion.discount.apply_to_order | | | campaign.promotion.discount.apply_to_items | | | campaign.promotion.discount.apply_to_items_proportionally | | | campaign.promotion.discount.apply_to_items_proportionally_by_quantity | | | campaign.promotion.discount.fixed.apply_to_items | | | campaign.loyalty_program | | | voucher.discount_voucher | | | voucher.discount_voucher.discount.apply_to_order | | | voucher.discount_voucher.discount.apply_to_items | | | voucher.discount_voucher.discount.apply_to_items_proportionally | | | voucher.discount_voucher.discount.apply_to_items_proportionally_by_quantity | | | voucher.discount_voucher.discount.fixed.apply_to_items | | | voucher.gift_voucher | | | voucher.gift_voucher.gift.apply_to_order | | | voucher.gift_voucher.gift.apply_to_items | | | voucher.loyalty_card | | | distribution.custom_event | | | reward_assignment.pay_with_points | | | global | | | [optional] [default to 'global'] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/ValidationRulesCreateResponseBody.md b/docs/ValidationRulesCreateResponseBody.md index 1509fdd8..55266ac6 100644 --- a/docs/ValidationRulesCreateResponseBody.md +++ b/docs/ValidationRulesCreateResponseBody.md @@ -11,7 +11,7 @@ Name | Type | Description | Notes **error** | [**ValidationRulesCreateResponseBodyError**](ValidationRulesCreateResponseBodyError.md) | | [optional] **applicable_to** | [**ValidationRulesCreateResponseBodyApplicableTo**](ValidationRulesCreateResponseBodyApplicableTo.md) | | [optional] **type** | **str** | Type of validation rule. | [optional] [default to 'expression'] -**context_type** | **str** | Validation rule context type. | **Context Type** | **Definition** | |:---|:---| | earning_rule.order.paid | | | earning_rule.custom_event | | | earning_rule.customer.segment.entered | | | campaign.discount_coupons | | | campaign.discount_coupons.discount.apply_to_order | | | campaign.discount_coupons.discount.apply_to_items | | | campaign.discount_coupons.discount.apply_to_items_proportionally | | | campaign.discount_coupons.discount.apply_to_items_proportionally_by_quantity | | | campaign.discount_coupons.discount.fixed.apply_to_items | | | campaign.gift_vouchers | | | campaign.gift_vouchers.gift.apply_to_order | | | campaign.gift_vouchers.gift.apply_to_items | | | campaign.referral_program | | | campaign.referral_program.discount.apply_to_order | | | campaign.referral_program.discount.apply_to_items | | | campaign.referral_program.discount.apply_to_items_proportionally | | | campaign.referral_program.discount.apply_to_items_proportionally_by_quantity | | | campaign.referral_program.discount.fixed.apply_to_items | | | campaign.promotion | | | campaign.promotion.discount.apply_to_order | | | campaign.promotion.discount.apply_to_items | | | campaign.promotion.discount.apply_to_items_proportionally | | | campaign.promotion.discount.apply_to_items_proportionally_by_quantity | | | campaign.promotion.discount.fixed.apply_to_items | | | campaign.loyalty_program | | | campaign.lucky_draw | | | voucher.discount_voucher | | | voucher.discount_voucher.discount.apply_to_order | | | voucher.discount_voucher.discount.apply_to_items | | | voucher.discount_voucher.discount.apply_to_items_proportionally | | | voucher.discount_voucher.discount.apply_to_items_proportionally_by_quantity | | | voucher.discount_voucher.discount.fixed.apply_to_items | | | voucher.gift_voucher | | | voucher.gift_voucher.gift.apply_to_order | | | voucher.gift_voucher.gift.apply_to_items | | | voucher.loyalty_card | | | voucher.lucky_draw_code | | | distribution.custom_event | | | reward_assignment.pay_with_points | | | global | | | [optional] [default to 'global'] +**context_type** | **str** | Validation rule context type. | **Context Type** | **Definition** | |:---|:---| | earning_rule.order.paid | | | earning_rule.custom_event | | | earning_rule.customer.segment.entered | | | campaign.discount_coupons | | | campaign.discount_coupons.discount.apply_to_order | | | campaign.discount_coupons.discount.apply_to_items | | | campaign.discount_coupons.discount.apply_to_items_proportionally | | | campaign.discount_coupons.discount.apply_to_items_proportionally_by_quantity | | | campaign.discount_coupons.discount.fixed.apply_to_items | | | campaign.gift_vouchers | | | campaign.gift_vouchers.gift.apply_to_order | | | campaign.gift_vouchers.gift.apply_to_items | | | campaign.referral_program | | | campaign.referral_program.discount.apply_to_order | | | campaign.referral_program.discount.apply_to_items | | | campaign.referral_program.discount.apply_to_items_proportionally | | | campaign.referral_program.discount.apply_to_items_proportionally_by_quantity | | | campaign.referral_program.discount.fixed.apply_to_items | | | campaign.promotion | | | campaign.promotion.discount.apply_to_order | | | campaign.promotion.discount.apply_to_items | | | campaign.promotion.discount.apply_to_items_proportionally | | | campaign.promotion.discount.apply_to_items_proportionally_by_quantity | | | campaign.promotion.discount.fixed.apply_to_items | | | campaign.loyalty_program | | | voucher.discount_voucher | | | voucher.discount_voucher.discount.apply_to_order | | | voucher.discount_voucher.discount.apply_to_items | | | voucher.discount_voucher.discount.apply_to_items_proportionally | | | voucher.discount_voucher.discount.apply_to_items_proportionally_by_quantity | | | voucher.discount_voucher.discount.fixed.apply_to_items | | | voucher.gift_voucher | | | voucher.gift_voucher.gift.apply_to_order | | | voucher.gift_voucher.gift.apply_to_items | | | voucher.loyalty_card | | | distribution.custom_event | | | reward_assignment.pay_with_points | | | global | | | [optional] [default to 'global'] **id** | **str** | Unique validation rule ID. | [optional] **created_at** | **datetime** | Timestamp representing the date and time when the validation rule was created. The value is shown in the ISO 8601 format. | [optional] **updated_at** | **datetime** | Timestamp representing the date and time when the validation rule was updated. The value is shown in the ISO 8601 format. | [optional] diff --git a/docs/ValidationRulesGetResponseBody.md b/docs/ValidationRulesGetResponseBody.md index 1aa68068..6c74a578 100644 --- a/docs/ValidationRulesGetResponseBody.md +++ b/docs/ValidationRulesGetResponseBody.md @@ -11,7 +11,7 @@ Name | Type | Description | Notes **error** | [**ValidationRulesGetResponseBodyError**](ValidationRulesGetResponseBodyError.md) | | [optional] **applicable_to** | [**ValidationRulesGetResponseBodyApplicableTo**](ValidationRulesGetResponseBodyApplicableTo.md) | | [optional] **type** | **str** | Type of validation rule. | [optional] [default to 'expression'] -**context_type** | **str** | Validation rule context type. | **Context Type** | **Definition** | |:---|:---| | earning_rule.order.paid | | | earning_rule.custom_event | | | earning_rule.customer.segment.entered | | | campaign.discount_coupons | | | campaign.discount_coupons.discount.apply_to_order | | | campaign.discount_coupons.discount.apply_to_items | | | campaign.discount_coupons.discount.apply_to_items_proportionally | | | campaign.discount_coupons.discount.apply_to_items_proportionally_by_quantity | | | campaign.discount_coupons.discount.fixed.apply_to_items | | | campaign.gift_vouchers | | | campaign.gift_vouchers.gift.apply_to_order | | | campaign.gift_vouchers.gift.apply_to_items | | | campaign.referral_program | | | campaign.referral_program.discount.apply_to_order | | | campaign.referral_program.discount.apply_to_items | | | campaign.referral_program.discount.apply_to_items_proportionally | | | campaign.referral_program.discount.apply_to_items_proportionally_by_quantity | | | campaign.referral_program.discount.fixed.apply_to_items | | | campaign.promotion | | | campaign.promotion.discount.apply_to_order | | | campaign.promotion.discount.apply_to_items | | | campaign.promotion.discount.apply_to_items_proportionally | | | campaign.promotion.discount.apply_to_items_proportionally_by_quantity | | | campaign.promotion.discount.fixed.apply_to_items | | | campaign.loyalty_program | | | campaign.lucky_draw | | | voucher.discount_voucher | | | voucher.discount_voucher.discount.apply_to_order | | | voucher.discount_voucher.discount.apply_to_items | | | voucher.discount_voucher.discount.apply_to_items_proportionally | | | voucher.discount_voucher.discount.apply_to_items_proportionally_by_quantity | | | voucher.discount_voucher.discount.fixed.apply_to_items | | | voucher.gift_voucher | | | voucher.gift_voucher.gift.apply_to_order | | | voucher.gift_voucher.gift.apply_to_items | | | voucher.loyalty_card | | | voucher.lucky_draw_code | | | distribution.custom_event | | | reward_assignment.pay_with_points | | | global | | | [optional] [default to 'global'] +**context_type** | **str** | Validation rule context type. | **Context Type** | **Definition** | |:---|:---| | earning_rule.order.paid | | | earning_rule.custom_event | | | earning_rule.customer.segment.entered | | | campaign.discount_coupons | | | campaign.discount_coupons.discount.apply_to_order | | | campaign.discount_coupons.discount.apply_to_items | | | campaign.discount_coupons.discount.apply_to_items_proportionally | | | campaign.discount_coupons.discount.apply_to_items_proportionally_by_quantity | | | campaign.discount_coupons.discount.fixed.apply_to_items | | | campaign.gift_vouchers | | | campaign.gift_vouchers.gift.apply_to_order | | | campaign.gift_vouchers.gift.apply_to_items | | | campaign.referral_program | | | campaign.referral_program.discount.apply_to_order | | | campaign.referral_program.discount.apply_to_items | | | campaign.referral_program.discount.apply_to_items_proportionally | | | campaign.referral_program.discount.apply_to_items_proportionally_by_quantity | | | campaign.referral_program.discount.fixed.apply_to_items | | | campaign.promotion | | | campaign.promotion.discount.apply_to_order | | | campaign.promotion.discount.apply_to_items | | | campaign.promotion.discount.apply_to_items_proportionally | | | campaign.promotion.discount.apply_to_items_proportionally_by_quantity | | | campaign.promotion.discount.fixed.apply_to_items | | | campaign.loyalty_program | | | voucher.discount_voucher | | | voucher.discount_voucher.discount.apply_to_order | | | voucher.discount_voucher.discount.apply_to_items | | | voucher.discount_voucher.discount.apply_to_items_proportionally | | | voucher.discount_voucher.discount.apply_to_items_proportionally_by_quantity | | | voucher.discount_voucher.discount.fixed.apply_to_items | | | voucher.gift_voucher | | | voucher.gift_voucher.gift.apply_to_order | | | voucher.gift_voucher.gift.apply_to_items | | | voucher.loyalty_card | | | distribution.custom_event | | | reward_assignment.pay_with_points | | | global | | | [optional] [default to 'global'] **id** | **str** | Unique validation rule ID. | [optional] **created_at** | **datetime** | Timestamp representing the date and time when the validation rule was created. The value is shown in the ISO 8601 format. | [optional] **updated_at** | **datetime** | Timestamp representing the date and time when the validation rule was updated. The value is shown in the ISO 8601 format. | [optional] diff --git a/docs/ValidationRulesUpdateRequestBody.md b/docs/ValidationRulesUpdateRequestBody.md index 284b4fe9..57328db4 100644 --- a/docs/ValidationRulesUpdateRequestBody.md +++ b/docs/ValidationRulesUpdateRequestBody.md @@ -11,7 +11,7 @@ Name | Type | Description | Notes **error** | [**ValidationRulesUpdateRequestBodyError**](ValidationRulesUpdateRequestBodyError.md) | | [optional] **applicable_to** | [**ValidationRulesUpdateRequestBodyApplicableTo**](ValidationRulesUpdateRequestBodyApplicableTo.md) | | [optional] **type** | **str** | Type of validation rule. | [optional] [default to 'expression'] -**context_type** | **str** | Validation rule context type. | **Context Type** | **Definition** | |:---|:---| | earning_rule.order.paid | | | earning_rule.custom_event | | | earning_rule.customer.segment.entered | | | campaign.discount_coupons | | | campaign.discount_coupons.discount.apply_to_order | | | campaign.discount_coupons.discount.apply_to_items | | | campaign.discount_coupons.discount.apply_to_items_proportionally | | | campaign.discount_coupons.discount.apply_to_items_proportionally_by_quantity | | | campaign.discount_coupons.discount.fixed.apply_to_items | | | campaign.gift_vouchers | | | campaign.gift_vouchers.gift.apply_to_order | | | campaign.gift_vouchers.gift.apply_to_items | | | campaign.referral_program | | | campaign.referral_program.discount.apply_to_order | | | campaign.referral_program.discount.apply_to_items | | | campaign.referral_program.discount.apply_to_items_proportionally | | | campaign.referral_program.discount.apply_to_items_proportionally_by_quantity | | | campaign.referral_program.discount.fixed.apply_to_items | | | campaign.promotion | | | campaign.promotion.discount.apply_to_order | | | campaign.promotion.discount.apply_to_items | | | campaign.promotion.discount.apply_to_items_proportionally | | | campaign.promotion.discount.apply_to_items_proportionally_by_quantity | | | campaign.promotion.discount.fixed.apply_to_items | | | campaign.loyalty_program | | | campaign.lucky_draw | | | voucher.discount_voucher | | | voucher.discount_voucher.discount.apply_to_order | | | voucher.discount_voucher.discount.apply_to_items | | | voucher.discount_voucher.discount.apply_to_items_proportionally | | | voucher.discount_voucher.discount.apply_to_items_proportionally_by_quantity | | | voucher.discount_voucher.discount.fixed.apply_to_items | | | voucher.gift_voucher | | | voucher.gift_voucher.gift.apply_to_order | | | voucher.gift_voucher.gift.apply_to_items | | | voucher.loyalty_card | | | voucher.lucky_draw_code | | | distribution.custom_event | | | reward_assignment.pay_with_points | | | global | | | [optional] [default to 'global'] +**context_type** | **str** | Validation rule context type. | **Context Type** | **Definition** | |:---|:---| | earning_rule.order.paid | | | earning_rule.custom_event | | | earning_rule.customer.segment.entered | | | campaign.discount_coupons | | | campaign.discount_coupons.discount.apply_to_order | | | campaign.discount_coupons.discount.apply_to_items | | | campaign.discount_coupons.discount.apply_to_items_proportionally | | | campaign.discount_coupons.discount.apply_to_items_proportionally_by_quantity | | | campaign.discount_coupons.discount.fixed.apply_to_items | | | campaign.gift_vouchers | | | campaign.gift_vouchers.gift.apply_to_order | | | campaign.gift_vouchers.gift.apply_to_items | | | campaign.referral_program | | | campaign.referral_program.discount.apply_to_order | | | campaign.referral_program.discount.apply_to_items | | | campaign.referral_program.discount.apply_to_items_proportionally | | | campaign.referral_program.discount.apply_to_items_proportionally_by_quantity | | | campaign.referral_program.discount.fixed.apply_to_items | | | campaign.promotion | | | campaign.promotion.discount.apply_to_order | | | campaign.promotion.discount.apply_to_items | | | campaign.promotion.discount.apply_to_items_proportionally | | | campaign.promotion.discount.apply_to_items_proportionally_by_quantity | | | campaign.promotion.discount.fixed.apply_to_items | | | campaign.loyalty_program | | | voucher.discount_voucher | | | voucher.discount_voucher.discount.apply_to_order | | | voucher.discount_voucher.discount.apply_to_items | | | voucher.discount_voucher.discount.apply_to_items_proportionally | | | voucher.discount_voucher.discount.apply_to_items_proportionally_by_quantity | | | voucher.discount_voucher.discount.fixed.apply_to_items | | | voucher.gift_voucher | | | voucher.gift_voucher.gift.apply_to_order | | | voucher.gift_voucher.gift.apply_to_items | | | voucher.loyalty_card | | | distribution.custom_event | | | reward_assignment.pay_with_points | | | global | | | [optional] [default to 'global'] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/ValidationRulesUpdateResponseBody.md b/docs/ValidationRulesUpdateResponseBody.md index 380b94e2..b177db9a 100644 --- a/docs/ValidationRulesUpdateResponseBody.md +++ b/docs/ValidationRulesUpdateResponseBody.md @@ -11,7 +11,7 @@ Name | Type | Description | Notes **error** | [**ValidationRulesUpdateResponseBodyError**](ValidationRulesUpdateResponseBodyError.md) | | [optional] **applicable_to** | [**ValidationRulesUpdateResponseBodyApplicableTo**](ValidationRulesUpdateResponseBodyApplicableTo.md) | | [optional] **type** | **str** | Type of validation rule. | [optional] [default to 'expression'] -**context_type** | **str** | Validation rule context type. | **Context Type** | **Definition** | |:---|:---| | earning_rule.order.paid | | | earning_rule.custom_event | | | earning_rule.customer.segment.entered | | | campaign.discount_coupons | | | campaign.discount_coupons.discount.apply_to_order | | | campaign.discount_coupons.discount.apply_to_items | | | campaign.discount_coupons.discount.apply_to_items_proportionally | | | campaign.discount_coupons.discount.apply_to_items_proportionally_by_quantity | | | campaign.discount_coupons.discount.fixed.apply_to_items | | | campaign.gift_vouchers | | | campaign.gift_vouchers.gift.apply_to_order | | | campaign.gift_vouchers.gift.apply_to_items | | | campaign.referral_program | | | campaign.referral_program.discount.apply_to_order | | | campaign.referral_program.discount.apply_to_items | | | campaign.referral_program.discount.apply_to_items_proportionally | | | campaign.referral_program.discount.apply_to_items_proportionally_by_quantity | | | campaign.referral_program.discount.fixed.apply_to_items | | | campaign.promotion | | | campaign.promotion.discount.apply_to_order | | | campaign.promotion.discount.apply_to_items | | | campaign.promotion.discount.apply_to_items_proportionally | | | campaign.promotion.discount.apply_to_items_proportionally_by_quantity | | | campaign.promotion.discount.fixed.apply_to_items | | | campaign.loyalty_program | | | campaign.lucky_draw | | | voucher.discount_voucher | | | voucher.discount_voucher.discount.apply_to_order | | | voucher.discount_voucher.discount.apply_to_items | | | voucher.discount_voucher.discount.apply_to_items_proportionally | | | voucher.discount_voucher.discount.apply_to_items_proportionally_by_quantity | | | voucher.discount_voucher.discount.fixed.apply_to_items | | | voucher.gift_voucher | | | voucher.gift_voucher.gift.apply_to_order | | | voucher.gift_voucher.gift.apply_to_items | | | voucher.loyalty_card | | | voucher.lucky_draw_code | | | distribution.custom_event | | | reward_assignment.pay_with_points | | | global | | | [optional] [default to 'global'] +**context_type** | **str** | Validation rule context type. | **Context Type** | **Definition** | |:---|:---| | earning_rule.order.paid | | | earning_rule.custom_event | | | earning_rule.customer.segment.entered | | | campaign.discount_coupons | | | campaign.discount_coupons.discount.apply_to_order | | | campaign.discount_coupons.discount.apply_to_items | | | campaign.discount_coupons.discount.apply_to_items_proportionally | | | campaign.discount_coupons.discount.apply_to_items_proportionally_by_quantity | | | campaign.discount_coupons.discount.fixed.apply_to_items | | | campaign.gift_vouchers | | | campaign.gift_vouchers.gift.apply_to_order | | | campaign.gift_vouchers.gift.apply_to_items | | | campaign.referral_program | | | campaign.referral_program.discount.apply_to_order | | | campaign.referral_program.discount.apply_to_items | | | campaign.referral_program.discount.apply_to_items_proportionally | | | campaign.referral_program.discount.apply_to_items_proportionally_by_quantity | | | campaign.referral_program.discount.fixed.apply_to_items | | | campaign.promotion | | | campaign.promotion.discount.apply_to_order | | | campaign.promotion.discount.apply_to_items | | | campaign.promotion.discount.apply_to_items_proportionally | | | campaign.promotion.discount.apply_to_items_proportionally_by_quantity | | | campaign.promotion.discount.fixed.apply_to_items | | | campaign.loyalty_program | | | voucher.discount_voucher | | | voucher.discount_voucher.discount.apply_to_order | | | voucher.discount_voucher.discount.apply_to_items | | | voucher.discount_voucher.discount.apply_to_items_proportionally | | | voucher.discount_voucher.discount.apply_to_items_proportionally_by_quantity | | | voucher.discount_voucher.discount.fixed.apply_to_items | | | voucher.gift_voucher | | | voucher.gift_voucher.gift.apply_to_order | | | voucher.gift_voucher.gift.apply_to_items | | | voucher.loyalty_card | | | distribution.custom_event | | | reward_assignment.pay_with_points | | | global | | | [optional] [default to 'global'] **id** | **str** | Unique validation rule ID. | [optional] **created_at** | **datetime** | Timestamp representing the date and time when the validation rule was created. The value is shown in the ISO 8601 format. | [optional] **updated_at** | **datetime** | Timestamp representing the date and time when the validation rule was updated. The value is shown in the ISO 8601 format. | [optional] diff --git a/pyproject.toml b/pyproject.toml index 3a646c34..557d0339 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "voucherify" -version = "3.0.0" +version = "4.0.0" description = "Voucherify API" authors = ["Voucherify Team "] license = "MIT" diff --git a/setup.py b/setup.py index b63b35a2..81329d63 100755 --- a/setup.py +++ b/setup.py @@ -22,7 +22,7 @@ # prerequisite: setuptools # http://pypi.python.org/pypi/setuptools NAME = "voucherify" -VERSION = "3.0.0" +VERSION = "4.0.0" PYTHON_REQUIRES = ">=3.7" REQUIRES = [ "urllib3 >= 1.25.3, < 2.1.0", diff --git a/voucherify/__init__.py b/voucherify/__init__.py index fa40c63e..c5744206 100644 --- a/voucherify/__init__.py +++ b/voucherify/__init__.py @@ -15,10 +15,11 @@ """ # noqa: E501 -__version__ = "3.0.0" +__version__ = "4.0.0" # import apis into sdk package from voucherify.api.async_actions_api import AsyncActionsApi +from voucherify.api.bin_api import BinApi from voucherify.api.campaigns_api import CampaignsApi from voucherify.api.categories_api import CategoriesApi from voucherify.api.client_side_api import ClientSideApi @@ -26,6 +27,7 @@ from voucherify.api.events_api import EventsApi from voucherify.api.exports_api import ExportsApi from voucherify.api.loyalties_api import LoyaltiesApi +from voucherify.api.management_api import ManagementApi from voucherify.api.orders_api import OrdersApi from voucherify.api.product_collections_api import ProductCollectionsApi from voucherify.api.products_api import ProductsApi @@ -219,6 +221,7 @@ from voucherify.models.exports_get_response_body_result import ExportsGetResponseBodyResult from voucherify.models.exports_list_response_body import ExportsListResponseBody from voucherify.models.field_conditions import FieldConditions +from voucherify.models.filter_conditions_date_time import FilterConditionsDateTime from voucherify.models.filter_conditions_string import FilterConditionsString from voucherify.models.filters_condition import FiltersCondition from voucherify.models.gift import Gift @@ -484,7 +487,125 @@ from voucherify.models.loyalty_tiers_expiration_all_expiration_date import LoyaltyTiersExpirationAllExpirationDate from voucherify.models.loyalty_tiers_expiration_all_expiration_date_rounding import LoyaltyTiersExpirationAllExpirationDateRounding from voucherify.models.loyalty_tiers_expiration_all_start_date import LoyaltyTiersExpirationAllStartDate -from voucherify.models.lucky_draw import LuckyDraw +from voucherify.models.management_project import ManagementProject +from voucherify.models.management_project_api_usage_notifications import ManagementProjectApiUsageNotifications +from voucherify.models.management_project_default_code_config import ManagementProjectDefaultCodeConfig +from voucherify.models.management_project_limits import ManagementProjectLimits +from voucherify.models.management_project_limits_api_calls_item import ManagementProjectLimitsApiCallsItem +from voucherify.models.management_project_limits_bulk_api_calls_item import ManagementProjectLimitsBulkApiCallsItem +from voucherify.models.management_project_webhooks_callout_notifications import ManagementProjectWebhooksCalloutNotifications +from voucherify.models.management_project_webhooks_callout_notifications_distributions import ManagementProjectWebhooksCalloutNotificationsDistributions +from voucherify.models.management_project_webhooks_callout_notifications_webhooks import ManagementProjectWebhooksCalloutNotificationsWebhooks +from voucherify.models.management_projects_branding import ManagementProjectsBranding +from voucherify.models.management_projects_branding_address import ManagementProjectsBrandingAddress +from voucherify.models.management_projects_branding_brand import ManagementProjectsBrandingBrand +from voucherify.models.management_projects_branding_cockpits import ManagementProjectsBrandingCockpits +from voucherify.models.management_projects_branding_contact import ManagementProjectsBrandingContact +from voucherify.models.management_projects_branding_create_request_body import ManagementProjectsBrandingCreateRequestBody +from voucherify.models.management_projects_branding_create_request_body_address import ManagementProjectsBrandingCreateRequestBodyAddress +from voucherify.models.management_projects_branding_create_request_body_brand import ManagementProjectsBrandingCreateRequestBodyBrand +from voucherify.models.management_projects_branding_create_request_body_cockpits import ManagementProjectsBrandingCreateRequestBodyCockpits +from voucherify.models.management_projects_branding_create_request_body_contact import ManagementProjectsBrandingCreateRequestBodyContact +from voucherify.models.management_projects_branding_create_response_body import ManagementProjectsBrandingCreateResponseBody +from voucherify.models.management_projects_branding_create_response_body_address import ManagementProjectsBrandingCreateResponseBodyAddress +from voucherify.models.management_projects_branding_create_response_body_brand import ManagementProjectsBrandingCreateResponseBodyBrand +from voucherify.models.management_projects_branding_create_response_body_cockpits import ManagementProjectsBrandingCreateResponseBodyCockpits +from voucherify.models.management_projects_branding_create_response_body_contact import ManagementProjectsBrandingCreateResponseBodyContact +from voucherify.models.management_projects_branding_get_response_body import ManagementProjectsBrandingGetResponseBody +from voucherify.models.management_projects_branding_get_response_body_address import ManagementProjectsBrandingGetResponseBodyAddress +from voucherify.models.management_projects_branding_get_response_body_brand import ManagementProjectsBrandingGetResponseBodyBrand +from voucherify.models.management_projects_branding_get_response_body_cockpits import ManagementProjectsBrandingGetResponseBodyCockpits +from voucherify.models.management_projects_branding_get_response_body_contact import ManagementProjectsBrandingGetResponseBodyContact +from voucherify.models.management_projects_branding_list_response_body import ManagementProjectsBrandingListResponseBody +from voucherify.models.management_projects_branding_update_request_body import ManagementProjectsBrandingUpdateRequestBody +from voucherify.models.management_projects_branding_update_request_body_address import ManagementProjectsBrandingUpdateRequestBodyAddress +from voucherify.models.management_projects_branding_update_request_body_brand import ManagementProjectsBrandingUpdateRequestBodyBrand +from voucherify.models.management_projects_branding_update_request_body_cockpits import ManagementProjectsBrandingUpdateRequestBodyCockpits +from voucherify.models.management_projects_branding_update_request_body_contact import ManagementProjectsBrandingUpdateRequestBodyContact +from voucherify.models.management_projects_branding_update_response_body import ManagementProjectsBrandingUpdateResponseBody +from voucherify.models.management_projects_branding_update_response_body_address import ManagementProjectsBrandingUpdateResponseBodyAddress +from voucherify.models.management_projects_branding_update_response_body_brand import ManagementProjectsBrandingUpdateResponseBodyBrand +from voucherify.models.management_projects_branding_update_response_body_cockpits import ManagementProjectsBrandingUpdateResponseBodyCockpits +from voucherify.models.management_projects_branding_update_response_body_contact import ManagementProjectsBrandingUpdateResponseBodyContact +from voucherify.models.management_projects_create_request_body import ManagementProjectsCreateRequestBody +from voucherify.models.management_projects_create_request_body_api_usage_notifications import ManagementProjectsCreateRequestBodyApiUsageNotifications +from voucherify.models.management_projects_create_request_body_users_item import ManagementProjectsCreateRequestBodyUsersItem +from voucherify.models.management_projects_create_request_body_webhooks_callout_notifications import ManagementProjectsCreateRequestBodyWebhooksCalloutNotifications +from voucherify.models.management_projects_create_request_body_webhooks_callout_notifications_distributions import ManagementProjectsCreateRequestBodyWebhooksCalloutNotificationsDistributions +from voucherify.models.management_projects_create_request_body_webhooks_callout_notifications_webhooks import ManagementProjectsCreateRequestBodyWebhooksCalloutNotificationsWebhooks +from voucherify.models.management_projects_create_response_body import ManagementProjectsCreateResponseBody +from voucherify.models.management_projects_create_response_body_api_usage_notifications import ManagementProjectsCreateResponseBodyApiUsageNotifications +from voucherify.models.management_projects_create_response_body_client_side_key import ManagementProjectsCreateResponseBodyClientSideKey +from voucherify.models.management_projects_create_response_body_server_side_key import ManagementProjectsCreateResponseBodyServerSideKey +from voucherify.models.management_projects_create_response_body_webhooks_callout_notifications import ManagementProjectsCreateResponseBodyWebhooksCalloutNotifications +from voucherify.models.management_projects_create_response_body_webhooks_callout_notifications_distributions import ManagementProjectsCreateResponseBodyWebhooksCalloutNotificationsDistributions +from voucherify.models.management_projects_create_response_body_webhooks_callout_notifications_webhooks import ManagementProjectsCreateResponseBodyWebhooksCalloutNotificationsWebhooks +from voucherify.models.management_projects_custom_event_schema import ManagementProjectsCustomEventSchema +from voucherify.models.management_projects_custom_event_schema_schema import ManagementProjectsCustomEventSchemaSchema +from voucherify.models.management_projects_custom_event_schemas_create_request_body import ManagementProjectsCustomEventSchemasCreateRequestBody +from voucherify.models.management_projects_custom_event_schemas_create_request_body_schema import ManagementProjectsCustomEventSchemasCreateRequestBodySchema +from voucherify.models.management_projects_custom_event_schemas_create_response_body import ManagementProjectsCustomEventSchemasCreateResponseBody +from voucherify.models.management_projects_custom_event_schemas_create_response_body_schema import ManagementProjectsCustomEventSchemasCreateResponseBodySchema +from voucherify.models.management_projects_custom_event_schemas_get_response_body import ManagementProjectsCustomEventSchemasGetResponseBody +from voucherify.models.management_projects_custom_event_schemas_get_response_body_schema import ManagementProjectsCustomEventSchemasGetResponseBodySchema +from voucherify.models.management_projects_custom_event_schemas_list_response_body import ManagementProjectsCustomEventSchemasListResponseBody +from voucherify.models.management_projects_custom_event_schemas_update_request_body import ManagementProjectsCustomEventSchemasUpdateRequestBody +from voucherify.models.management_projects_custom_event_schemas_update_request_body_schema import ManagementProjectsCustomEventSchemasUpdateRequestBodySchema +from voucherify.models.management_projects_custom_event_schemas_update_response_body import ManagementProjectsCustomEventSchemasUpdateResponseBody +from voucherify.models.management_projects_custom_event_schemas_update_response_body_schema import ManagementProjectsCustomEventSchemasUpdateResponseBodySchema +from voucherify.models.management_projects_get_response_body import ManagementProjectsGetResponseBody +from voucherify.models.management_projects_get_response_body_api_usage_notifications import ManagementProjectsGetResponseBodyApiUsageNotifications +from voucherify.models.management_projects_get_response_body_default_code_config import ManagementProjectsGetResponseBodyDefaultCodeConfig +from voucherify.models.management_projects_get_response_body_limits import ManagementProjectsGetResponseBodyLimits +from voucherify.models.management_projects_get_response_body_limits_api_calls_item import ManagementProjectsGetResponseBodyLimitsApiCallsItem +from voucherify.models.management_projects_get_response_body_limits_bulk_api_calls_item import ManagementProjectsGetResponseBodyLimitsBulkApiCallsItem +from voucherify.models.management_projects_get_response_body_webhooks_callout_notifications import ManagementProjectsGetResponseBodyWebhooksCalloutNotifications +from voucherify.models.management_projects_get_response_body_webhooks_callout_notifications_distributions import ManagementProjectsGetResponseBodyWebhooksCalloutNotificationsDistributions +from voucherify.models.management_projects_get_response_body_webhooks_callout_notifications_webhooks import ManagementProjectsGetResponseBodyWebhooksCalloutNotificationsWebhooks +from voucherify.models.management_projects_list_response_body import ManagementProjectsListResponseBody +from voucherify.models.management_projects_metadata_schema import ManagementProjectsMetadataSchema +from voucherify.models.management_projects_metadata_schemas_create_request_body import ManagementProjectsMetadataSchemasCreateRequestBody +from voucherify.models.management_projects_metadata_schemas_create_response_body import ManagementProjectsMetadataSchemasCreateResponseBody +from voucherify.models.management_projects_metadata_schemas_get_response_body import ManagementProjectsMetadataSchemasGetResponseBody +from voucherify.models.management_projects_metadata_schemas_list_response_body import ManagementProjectsMetadataSchemasListResponseBody +from voucherify.models.management_projects_metadata_schemas_update_request_body import ManagementProjectsMetadataSchemasUpdateRequestBody +from voucherify.models.management_projects_metadata_schemas_update_response_body import ManagementProjectsMetadataSchemasUpdateResponseBody +from voucherify.models.management_projects_stacking_rules import ManagementProjectsStackingRules +from voucherify.models.management_projects_stacking_rules_create_request_body import ManagementProjectsStackingRulesCreateRequestBody +from voucherify.models.management_projects_stacking_rules_create_response_body import ManagementProjectsStackingRulesCreateResponseBody +from voucherify.models.management_projects_stacking_rules_get_response_body import ManagementProjectsStackingRulesGetResponseBody +from voucherify.models.management_projects_stacking_rules_list_response_body import ManagementProjectsStackingRulesListResponseBody +from voucherify.models.management_projects_stacking_rules_update_request_body import ManagementProjectsStackingRulesUpdateRequestBody +from voucherify.models.management_projects_stacking_rules_update_response_body import ManagementProjectsStackingRulesUpdateResponseBody +from voucherify.models.management_projects_update_request_body import ManagementProjectsUpdateRequestBody +from voucherify.models.management_projects_update_request_body_api_usage_notifications import ManagementProjectsUpdateRequestBodyApiUsageNotifications +from voucherify.models.management_projects_update_request_body_default_code_config import ManagementProjectsUpdateRequestBodyDefaultCodeConfig +from voucherify.models.management_projects_update_request_body_webhooks_callout_notifications import ManagementProjectsUpdateRequestBodyWebhooksCalloutNotifications +from voucherify.models.management_projects_update_request_body_webhooks_callout_notifications_distributions import ManagementProjectsUpdateRequestBodyWebhooksCalloutNotificationsDistributions +from voucherify.models.management_projects_update_request_body_webhooks_callout_notifications_webhooks import ManagementProjectsUpdateRequestBodyWebhooksCalloutNotificationsWebhooks +from voucherify.models.management_projects_update_response_body import ManagementProjectsUpdateResponseBody +from voucherify.models.management_projects_update_response_body_api_usage_notifications import ManagementProjectsUpdateResponseBodyApiUsageNotifications +from voucherify.models.management_projects_update_response_body_default_code_config import ManagementProjectsUpdateResponseBodyDefaultCodeConfig +from voucherify.models.management_projects_update_response_body_limits import ManagementProjectsUpdateResponseBodyLimits +from voucherify.models.management_projects_update_response_body_limits_api_calls_item import ManagementProjectsUpdateResponseBodyLimitsApiCallsItem +from voucherify.models.management_projects_update_response_body_limits_bulk_api_calls_item import ManagementProjectsUpdateResponseBodyLimitsBulkApiCallsItem +from voucherify.models.management_projects_update_response_body_webhooks_callout_notifications import ManagementProjectsUpdateResponseBodyWebhooksCalloutNotifications +from voucherify.models.management_projects_update_response_body_webhooks_callout_notifications_distributions import ManagementProjectsUpdateResponseBodyWebhooksCalloutNotificationsDistributions +from voucherify.models.management_projects_update_response_body_webhooks_callout_notifications_webhooks import ManagementProjectsUpdateResponseBodyWebhooksCalloutNotificationsWebhooks +from voucherify.models.management_projects_users_assign_request_body import ManagementProjectsUsersAssignRequestBody +from voucherify.models.management_projects_users_assign_response_body import ManagementProjectsUsersAssignResponseBody +from voucherify.models.management_projects_users_get_user_response_body import ManagementProjectsUsersGetUserResponseBody +from voucherify.models.management_projects_users_invite_create_request_body import ManagementProjectsUsersInviteCreateRequestBody +from voucherify.models.management_projects_users_list_response_body import ManagementProjectsUsersListResponseBody +from voucherify.models.management_projects_users_update_role_request_body import ManagementProjectsUsersUpdateRoleRequestBody +from voucherify.models.management_projects_users_update_role_response_body import ManagementProjectsUsersUpdateRoleResponseBody +from voucherify.models.management_projects_webhook import ManagementProjectsWebhook +from voucherify.models.management_projects_webhooks_create_request_body import ManagementProjectsWebhooksCreateRequestBody +from voucherify.models.management_projects_webhooks_create_response_body import ManagementProjectsWebhooksCreateResponseBody +from voucherify.models.management_projects_webhooks_get_response_body import ManagementProjectsWebhooksGetResponseBody +from voucherify.models.management_projects_webhooks_list_response_body import ManagementProjectsWebhooksListResponseBody +from voucherify.models.management_projects_webhooks_update_request_body import ManagementProjectsWebhooksUpdateRequestBody +from voucherify.models.management_projects_webhooks_update_response_body import ManagementProjectsWebhooksUpdateResponseBody from voucherify.models.member_activity import MemberActivity from voucherify.models.order import Order from voucherify.models.order_calculated import OrderCalculated @@ -510,12 +631,25 @@ from voucherify.models.parameter_campaign_type import ParameterCampaignType from voucherify.models.parameter_created_before_after import ParameterCreatedBeforeAfter from voucherify.models.parameter_expand_list_campaigns import ParameterExpandListCampaigns +from voucherify.models.parameter_filters_list_bin import ParameterFiltersListBin +from voucherify.models.parameter_filters_list_bin_id import ParameterFiltersListBinId +from voucherify.models.parameter_filters_list_bin_resource_id import ParameterFiltersListBinResourceId +from voucherify.models.parameter_filters_list_bin_resource_name import ParameterFiltersListBinResourceName +from voucherify.models.parameter_filters_list_bin_resource_type import ParameterFiltersListBinResourceType +from voucherify.models.parameter_filters_list_bin_resource_type_conditions import ParameterFiltersListBinResourceTypeConditions +from voucherify.models.parameter_filters_list_campaigns import ParameterFiltersListCampaigns +from voucherify.models.parameter_filters_list_campaigns_campaign_status import ParameterFiltersListCampaignsCampaignStatus +from voucherify.models.parameter_filters_list_campaigns_campaign_status_conditions import ParameterFiltersListCampaignsCampaignStatusConditions +from voucherify.models.parameter_filters_list_campaigns_categories import ParameterFiltersListCampaignsCategories +from voucherify.models.parameter_filters_list_campaigns_category_ids import ParameterFiltersListCampaignsCategoryIds +from voucherify.models.parameter_filters_list_campaigns_is_referral_code import ParameterFiltersListCampaignsIsReferralCode +from voucherify.models.parameter_filters_list_campaigns_validity_timeframe import ParameterFiltersListCampaignsValidityTimeframe +from voucherify.models.parameter_filters_list_campaigns_voucher_type import ParameterFiltersListCampaignsVoucherType from voucherify.models.parameter_filters_list_customer_redeemables import ParameterFiltersListCustomerRedeemables from voucherify.models.parameter_filters_list_customer_redeemables_campaign_id import ParameterFiltersListCustomerRedeemablesCampaignId from voucherify.models.parameter_filters_list_customer_redeemables_campaign_type import ParameterFiltersListCustomerRedeemablesCampaignType from voucherify.models.parameter_filters_list_customer_redeemables_campaign_type_conditions import ParameterFiltersListCustomerRedeemablesCampaignTypeConditions from voucherify.models.parameter_filters_list_customer_redeemables_created_at import ParameterFiltersListCustomerRedeemablesCreatedAt -from voucherify.models.parameter_filters_list_customer_redeemables_created_at_conditions import ParameterFiltersListCustomerRedeemablesCreatedAtConditions from voucherify.models.parameter_filters_list_customer_redeemables_holder_role import ParameterFiltersListCustomerRedeemablesHolderRole from voucherify.models.parameter_filters_list_customer_redeemables_holder_role_conditions import ParameterFiltersListCustomerRedeemablesHolderRoleConditions from voucherify.models.parameter_filters_list_customer_redeemables_id import ParameterFiltersListCustomerRedeemablesId @@ -524,6 +658,16 @@ from voucherify.models.parameter_filters_list_customer_redeemables_redeemable_object_conditions import ParameterFiltersListCustomerRedeemablesRedeemableObjectConditions from voucherify.models.parameter_filters_list_customer_redeemables_voucher_type import ParameterFiltersListCustomerRedeemablesVoucherType from voucherify.models.parameter_filters_list_customer_redeemables_voucher_type_conditions import ParameterFiltersListCustomerRedeemablesVoucherTypeConditions +from voucherify.models.parameter_filters_list_publications import ParameterFiltersListPublications +from voucherify.models.parameter_filters_list_publications_campaign_name import ParameterFiltersListPublicationsCampaignName +from voucherify.models.parameter_filters_list_publications_customer_id import ParameterFiltersListPublicationsCustomerId +from voucherify.models.parameter_filters_list_publications_failure_code import ParameterFiltersListPublicationsFailureCode +from voucherify.models.parameter_filters_list_publications_is_referral_code import ParameterFiltersListPublicationsIsReferralCode +from voucherify.models.parameter_filters_list_publications_parent_object_id import ParameterFiltersListPublicationsParentObjectId +from voucherify.models.parameter_filters_list_publications_related_object_id import ParameterFiltersListPublicationsRelatedObjectId +from voucherify.models.parameter_filters_list_publications_result import ParameterFiltersListPublicationsResult +from voucherify.models.parameter_filters_list_publications_source_id import ParameterFiltersListPublicationsSourceId +from voucherify.models.parameter_filters_list_publications_voucher_type import ParameterFiltersListPublicationsVoucherType from voucherify.models.parameter_filters_list_redemptions import ParameterFiltersListRedemptions from voucherify.models.parameter_filters_list_redemptions_campaign_name import ParameterFiltersListRedemptionsCampaignName from voucherify.models.parameter_filters_list_redemptions_customer_id import ParameterFiltersListRedemptionsCustomerId @@ -538,6 +682,7 @@ from voucherify.models.parameter_order import ParameterOrder from voucherify.models.parameter_order_created_at import ParameterOrderCreatedAt from voucherify.models.parameter_order_list_all_promotion_stacks import ParameterOrderListAllPromotionStacks +from voucherify.models.parameter_order_list_bin import ParameterOrderListBin from voucherify.models.parameter_order_list_campaigns import ParameterOrderListCampaigns from voucherify.models.parameter_order_list_customers import ParameterOrderListCustomers from voucherify.models.parameter_order_list_earning_rules import ParameterOrderListEarningRules @@ -853,6 +998,10 @@ from voucherify.models.skus_import_csv_create_response_body import SkusImportCsvCreateResponseBody from voucherify.models.skus_list_for_product import SkusListForProduct from voucherify.models.stacking_rules import StackingRules +from voucherify.models.trash_bin_item import TrashBinItem +from voucherify.models.trash_bin_list_response_body import TrashBinListResponseBody +from voucherify.models.usage_notifications import UsageNotifications +from voucherify.models.user import User from voucherify.models.validation_rule import ValidationRule from voucherify.models.validation_rule_applicable_to import ValidationRuleApplicableTo from voucherify.models.validation_rule_assignment import ValidationRuleAssignment diff --git a/voucherify/api/__init__.py b/voucherify/api/__init__.py index 66ca31b2..6605b2c0 100644 --- a/voucherify/api/__init__.py +++ b/voucherify/api/__init__.py @@ -2,6 +2,7 @@ # import apis into api package from voucherify.api.async_actions_api import AsyncActionsApi +from voucherify.api.bin_api import BinApi from voucherify.api.campaigns_api import CampaignsApi from voucherify.api.categories_api import CategoriesApi from voucherify.api.client_side_api import ClientSideApi @@ -9,6 +10,7 @@ from voucherify.api.events_api import EventsApi from voucherify.api.exports_api import ExportsApi from voucherify.api.loyalties_api import LoyaltiesApi +from voucherify.api.management_api import ManagementApi from voucherify.api.orders_api import OrdersApi from voucherify.api.product_collections_api import ProductCollectionsApi from voucherify.api.products_api import ProductsApi diff --git a/voucherify/api/bin_api.py b/voucherify/api/bin_api.py new file mode 100644 index 00000000..45e3750e --- /dev/null +++ b/voucherify/api/bin_api.py @@ -0,0 +1,608 @@ +# coding: utf-8 + +""" + Voucherify API + + Voucherify promotion engine REST API. Please see https://docs.voucherify.io/docs for more details. + + The version of the OpenAPI document: v2018-08-01 + Contact: support@voucherify.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated + +from pydantic import Field, StrictStr +from typing import Optional +from typing_extensions import Annotated +from voucherify.models.parameter_filters_list_bin import ParameterFiltersListBin +from voucherify.models.parameter_order_list_bin import ParameterOrderListBin +from voucherify.models.trash_bin_list_response_body import TrashBinListResponseBody + +from voucherify.api_client import ApiClient, RequestSerialized +from voucherify.api_response import ApiResponse +from voucherify.rest import RESTResponseType + + +class BinApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + self.api_client = api_client + + + @validate_call + def delete_bin_entry( + self, + bin_entry_id: Annotated[StrictStr, Field(description="Provide the unique identifier of the bin entry.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Delete Bin Entry + + Deletes permanently a bin entry with a given ID.The following resources can be moved to the bin and permanently deleted: - campaigns - vouchers - products - SKUs To use this endpoint and delete a given resource type, you must have the following permissions: - vouchers.delete to delete a voucher, - campaigns.delete to delete a campaign, - products.delete to delete a product or SKU. + + :param bin_entry_id: Provide the unique identifier of the bin entry. (required) + :type bin_entry_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_bin_entry_serialize( + bin_entry_id=bin_entry_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '2XX': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def delete_bin_entry_with_http_info( + self, + bin_entry_id: Annotated[StrictStr, Field(description="Provide the unique identifier of the bin entry.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Delete Bin Entry + + Deletes permanently a bin entry with a given ID.The following resources can be moved to the bin and permanently deleted: - campaigns - vouchers - products - SKUs To use this endpoint and delete a given resource type, you must have the following permissions: - vouchers.delete to delete a voucher, - campaigns.delete to delete a campaign, - products.delete to delete a product or SKU. + + :param bin_entry_id: Provide the unique identifier of the bin entry. (required) + :type bin_entry_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_bin_entry_serialize( + bin_entry_id=bin_entry_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '2XX': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def delete_bin_entry_without_preload_content( + self, + bin_entry_id: Annotated[StrictStr, Field(description="Provide the unique identifier of the bin entry.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Delete Bin Entry + + Deletes permanently a bin entry with a given ID.The following resources can be moved to the bin and permanently deleted: - campaigns - vouchers - products - SKUs To use this endpoint and delete a given resource type, you must have the following permissions: - vouchers.delete to delete a voucher, - campaigns.delete to delete a campaign, - products.delete to delete a product or SKU. + + :param bin_entry_id: Provide the unique identifier of the bin entry. (required) + :type bin_entry_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_bin_entry_serialize( + bin_entry_id=bin_entry_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '2XX': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _delete_bin_entry_serialize( + self, + bin_entry_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if bin_entry_id is not None: + _path_params['binEntryId'] = bin_entry_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + + + # authentication setting + _auth_settings: List[str] = [ + 'X-App-Id', + 'X-App-Token' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/v1/trash-bin/{binEntryId}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def list_bin_entries( + self, + limit: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="Limits the number of objects to be returned. The limit can range between 1 and 100 items. If no limit is set, it returns 10 items.")] = None, + order: Annotated[Optional[ParameterOrderListBin], Field(description="Orders the bin entries according the date and time when they were moved to the bin or according to the bin entry ID. The dash - preceding a sorting option means sorting in a descending order.")] = None, + starting_after_id: Annotated[Optional[StrictStr], Field(description="A cursor for pagination. It retrieves the events starting after an event with the given ID.")] = None, + filters: Annotated[Optional[ParameterFiltersListBin], Field(description="Filters for listing bin entries.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> TrashBinListResponseBody: + """List Bin Entries + + Retrieves a list of resources moved to the bin. The following resources can be moved to the bin: - campaigns - vouchers - products - SKUs To use this endpoint, you must have the following permissions: - vouchers.read - campaigns.read - products.read + + :param limit: Limits the number of objects to be returned. The limit can range between 1 and 100 items. If no limit is set, it returns 10 items. + :type limit: int + :param order: Orders the bin entries according the date and time when they were moved to the bin or according to the bin entry ID. The dash - preceding a sorting option means sorting in a descending order. + :type order: ParameterOrderListBin + :param starting_after_id: A cursor for pagination. It retrieves the events starting after an event with the given ID. + :type starting_after_id: str + :param filters: Filters for listing bin entries. + :type filters: ParameterFiltersListBin + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_bin_entries_serialize( + limit=limit, + order=order, + starting_after_id=starting_after_id, + filters=filters, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '2XX': "TrashBinListResponseBody", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def list_bin_entries_with_http_info( + self, + limit: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="Limits the number of objects to be returned. The limit can range between 1 and 100 items. If no limit is set, it returns 10 items.")] = None, + order: Annotated[Optional[ParameterOrderListBin], Field(description="Orders the bin entries according the date and time when they were moved to the bin or according to the bin entry ID. The dash - preceding a sorting option means sorting in a descending order.")] = None, + starting_after_id: Annotated[Optional[StrictStr], Field(description="A cursor for pagination. It retrieves the events starting after an event with the given ID.")] = None, + filters: Annotated[Optional[ParameterFiltersListBin], Field(description="Filters for listing bin entries.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[TrashBinListResponseBody]: + """List Bin Entries + + Retrieves a list of resources moved to the bin. The following resources can be moved to the bin: - campaigns - vouchers - products - SKUs To use this endpoint, you must have the following permissions: - vouchers.read - campaigns.read - products.read + + :param limit: Limits the number of objects to be returned. The limit can range between 1 and 100 items. If no limit is set, it returns 10 items. + :type limit: int + :param order: Orders the bin entries according the date and time when they were moved to the bin or according to the bin entry ID. The dash - preceding a sorting option means sorting in a descending order. + :type order: ParameterOrderListBin + :param starting_after_id: A cursor for pagination. It retrieves the events starting after an event with the given ID. + :type starting_after_id: str + :param filters: Filters for listing bin entries. + :type filters: ParameterFiltersListBin + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_bin_entries_serialize( + limit=limit, + order=order, + starting_after_id=starting_after_id, + filters=filters, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '2XX': "TrashBinListResponseBody", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def list_bin_entries_without_preload_content( + self, + limit: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="Limits the number of objects to be returned. The limit can range between 1 and 100 items. If no limit is set, it returns 10 items.")] = None, + order: Annotated[Optional[ParameterOrderListBin], Field(description="Orders the bin entries according the date and time when they were moved to the bin or according to the bin entry ID. The dash - preceding a sorting option means sorting in a descending order.")] = None, + starting_after_id: Annotated[Optional[StrictStr], Field(description="A cursor for pagination. It retrieves the events starting after an event with the given ID.")] = None, + filters: Annotated[Optional[ParameterFiltersListBin], Field(description="Filters for listing bin entries.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """List Bin Entries + + Retrieves a list of resources moved to the bin. The following resources can be moved to the bin: - campaigns - vouchers - products - SKUs To use this endpoint, you must have the following permissions: - vouchers.read - campaigns.read - products.read + + :param limit: Limits the number of objects to be returned. The limit can range between 1 and 100 items. If no limit is set, it returns 10 items. + :type limit: int + :param order: Orders the bin entries according the date and time when they were moved to the bin or according to the bin entry ID. The dash - preceding a sorting option means sorting in a descending order. + :type order: ParameterOrderListBin + :param starting_after_id: A cursor for pagination. It retrieves the events starting after an event with the given ID. + :type starting_after_id: str + :param filters: Filters for listing bin entries. + :type filters: ParameterFiltersListBin + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_bin_entries_serialize( + limit=limit, + order=order, + starting_after_id=starting_after_id, + filters=filters, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '2XX': "TrashBinListResponseBody", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _list_bin_entries_serialize( + self, + limit, + order, + starting_after_id, + filters, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if limit is not None: + + _query_params.append(('limit', limit)) + + if order is not None: + + _query_params.append(('order', order.value)) + + if starting_after_id is not None: + + _query_params.append(('starting_after_id', starting_after_id)) + + if filters is not None: + + _query_params.append(('filters', filters)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'X-App-Id', + 'X-App-Token' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/v1/trash-bin', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/voucherify/api/campaigns_api.py b/voucherify/api/campaigns_api.py index 50b3f114..f199d814 100644 --- a/voucherify/api/campaigns_api.py +++ b/voucherify/api/campaigns_api.py @@ -36,6 +36,7 @@ from voucherify.models.campaigns_vouchers_create_response_body import CampaignsVouchersCreateResponseBody from voucherify.models.parameter_campaign_type import ParameterCampaignType from voucherify.models.parameter_expand_list_campaigns import ParameterExpandListCampaigns +from voucherify.models.parameter_filters_list_campaigns import ParameterFiltersListCampaigns from voucherify.models.parameter_order_list_campaigns import ParameterOrderListCampaigns from voucherify.api_client import ApiClient, RequestSerialized @@ -2579,6 +2580,7 @@ def list_campaigns( campaign_type: Annotated[Optional[ParameterCampaignType], Field(description="This attribute allows filtering by campaign type.")] = None, expand: Annotated[Optional[ParameterExpandListCampaigns], Field(description="Include an expanded categories object in the response.")] = None, order: Annotated[Optional[ParameterOrderListCampaigns], Field(description="Sorts the results using one of the filtering options, where the dash - preceding a sorting option means sorting in a descending order.")] = None, + filters: Annotated[Optional[ParameterFiltersListCampaigns], Field(description="Filters the results by campaign status or whether the campaign is a referral campaign.")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -2606,6 +2608,8 @@ def list_campaigns( :type expand: ParameterExpandListCampaigns :param order: Sorts the results using one of the filtering options, where the dash - preceding a sorting option means sorting in a descending order. :type order: ParameterOrderListCampaigns + :param filters: Filters the results by campaign status or whether the campaign is a referral campaign. + :type filters: ParameterFiltersListCampaigns :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -2634,6 +2638,7 @@ def list_campaigns( campaign_type=campaign_type, expand=expand, order=order, + filters=filters, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -2662,6 +2667,7 @@ def list_campaigns_with_http_info( campaign_type: Annotated[Optional[ParameterCampaignType], Field(description="This attribute allows filtering by campaign type.")] = None, expand: Annotated[Optional[ParameterExpandListCampaigns], Field(description="Include an expanded categories object in the response.")] = None, order: Annotated[Optional[ParameterOrderListCampaigns], Field(description="Sorts the results using one of the filtering options, where the dash - preceding a sorting option means sorting in a descending order.")] = None, + filters: Annotated[Optional[ParameterFiltersListCampaigns], Field(description="Filters the results by campaign status or whether the campaign is a referral campaign.")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -2689,6 +2695,8 @@ def list_campaigns_with_http_info( :type expand: ParameterExpandListCampaigns :param order: Sorts the results using one of the filtering options, where the dash - preceding a sorting option means sorting in a descending order. :type order: ParameterOrderListCampaigns + :param filters: Filters the results by campaign status or whether the campaign is a referral campaign. + :type filters: ParameterFiltersListCampaigns :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -2717,6 +2725,7 @@ def list_campaigns_with_http_info( campaign_type=campaign_type, expand=expand, order=order, + filters=filters, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -2745,6 +2754,7 @@ def list_campaigns_without_preload_content( campaign_type: Annotated[Optional[ParameterCampaignType], Field(description="This attribute allows filtering by campaign type.")] = None, expand: Annotated[Optional[ParameterExpandListCampaigns], Field(description="Include an expanded categories object in the response.")] = None, order: Annotated[Optional[ParameterOrderListCampaigns], Field(description="Sorts the results using one of the filtering options, where the dash - preceding a sorting option means sorting in a descending order.")] = None, + filters: Annotated[Optional[ParameterFiltersListCampaigns], Field(description="Filters the results by campaign status or whether the campaign is a referral campaign.")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -2772,6 +2782,8 @@ def list_campaigns_without_preload_content( :type expand: ParameterExpandListCampaigns :param order: Sorts the results using one of the filtering options, where the dash - preceding a sorting option means sorting in a descending order. :type order: ParameterOrderListCampaigns + :param filters: Filters the results by campaign status or whether the campaign is a referral campaign. + :type filters: ParameterFiltersListCampaigns :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -2800,6 +2812,7 @@ def list_campaigns_without_preload_content( campaign_type=campaign_type, expand=expand, order=order, + filters=filters, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -2823,6 +2836,7 @@ def _list_campaigns_serialize( campaign_type, expand, order, + filters, _request_auth, _content_type, _headers, @@ -2863,6 +2877,10 @@ def _list_campaigns_serialize( _query_params.append(('order', order.value)) + if filters is not None: + + _query_params.append(('filters', filters)) + # process the header parameters # process the form parameters # process the body parameter diff --git a/voucherify/api/management_api.py b/voucherify/api/management_api.py new file mode 100644 index 00000000..ec22c278 --- /dev/null +++ b/voucherify/api/management_api.py @@ -0,0 +1,10031 @@ +# coding: utf-8 + +""" + Voucherify API + + Voucherify promotion engine REST API. Please see https://docs.voucherify.io/docs for more details. + + The version of the OpenAPI document: v2018-08-01 + Contact: support@voucherify.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated + +from pydantic import Field, StrictStr +from typing import Optional +from typing_extensions import Annotated +from voucherify.models.management_projects_branding_create_request_body import ManagementProjectsBrandingCreateRequestBody +from voucherify.models.management_projects_branding_create_response_body import ManagementProjectsBrandingCreateResponseBody +from voucherify.models.management_projects_branding_get_response_body import ManagementProjectsBrandingGetResponseBody +from voucherify.models.management_projects_branding_list_response_body import ManagementProjectsBrandingListResponseBody +from voucherify.models.management_projects_branding_update_request_body import ManagementProjectsBrandingUpdateRequestBody +from voucherify.models.management_projects_branding_update_response_body import ManagementProjectsBrandingUpdateResponseBody +from voucherify.models.management_projects_create_request_body import ManagementProjectsCreateRequestBody +from voucherify.models.management_projects_create_response_body import ManagementProjectsCreateResponseBody +from voucherify.models.management_projects_custom_event_schemas_create_request_body import ManagementProjectsCustomEventSchemasCreateRequestBody +from voucherify.models.management_projects_custom_event_schemas_create_response_body import ManagementProjectsCustomEventSchemasCreateResponseBody +from voucherify.models.management_projects_custom_event_schemas_get_response_body import ManagementProjectsCustomEventSchemasGetResponseBody +from voucherify.models.management_projects_custom_event_schemas_list_response_body import ManagementProjectsCustomEventSchemasListResponseBody +from voucherify.models.management_projects_custom_event_schemas_update_request_body import ManagementProjectsCustomEventSchemasUpdateRequestBody +from voucherify.models.management_projects_custom_event_schemas_update_response_body import ManagementProjectsCustomEventSchemasUpdateResponseBody +from voucherify.models.management_projects_get_response_body import ManagementProjectsGetResponseBody +from voucherify.models.management_projects_list_response_body import ManagementProjectsListResponseBody +from voucherify.models.management_projects_metadata_schemas_create_request_body import ManagementProjectsMetadataSchemasCreateRequestBody +from voucherify.models.management_projects_metadata_schemas_create_response_body import ManagementProjectsMetadataSchemasCreateResponseBody +from voucherify.models.management_projects_metadata_schemas_get_response_body import ManagementProjectsMetadataSchemasGetResponseBody +from voucherify.models.management_projects_metadata_schemas_list_response_body import ManagementProjectsMetadataSchemasListResponseBody +from voucherify.models.management_projects_metadata_schemas_update_request_body import ManagementProjectsMetadataSchemasUpdateRequestBody +from voucherify.models.management_projects_metadata_schemas_update_response_body import ManagementProjectsMetadataSchemasUpdateResponseBody +from voucherify.models.management_projects_stacking_rules_create_request_body import ManagementProjectsStackingRulesCreateRequestBody +from voucherify.models.management_projects_stacking_rules_create_response_body import ManagementProjectsStackingRulesCreateResponseBody +from voucherify.models.management_projects_stacking_rules_get_response_body import ManagementProjectsStackingRulesGetResponseBody +from voucherify.models.management_projects_stacking_rules_list_response_body import ManagementProjectsStackingRulesListResponseBody +from voucherify.models.management_projects_stacking_rules_update_request_body import ManagementProjectsStackingRulesUpdateRequestBody +from voucherify.models.management_projects_stacking_rules_update_response_body import ManagementProjectsStackingRulesUpdateResponseBody +from voucherify.models.management_projects_update_request_body import ManagementProjectsUpdateRequestBody +from voucherify.models.management_projects_update_response_body import ManagementProjectsUpdateResponseBody +from voucherify.models.management_projects_users_assign_request_body import ManagementProjectsUsersAssignRequestBody +from voucherify.models.management_projects_users_assign_response_body import ManagementProjectsUsersAssignResponseBody +from voucherify.models.management_projects_users_get_user_response_body import ManagementProjectsUsersGetUserResponseBody +from voucherify.models.management_projects_users_invite_create_request_body import ManagementProjectsUsersInviteCreateRequestBody +from voucherify.models.management_projects_users_list_response_body import ManagementProjectsUsersListResponseBody +from voucherify.models.management_projects_users_update_role_request_body import ManagementProjectsUsersUpdateRoleRequestBody +from voucherify.models.management_projects_users_update_role_response_body import ManagementProjectsUsersUpdateRoleResponseBody +from voucherify.models.management_projects_webhooks_create_request_body import ManagementProjectsWebhooksCreateRequestBody +from voucherify.models.management_projects_webhooks_create_response_body import ManagementProjectsWebhooksCreateResponseBody +from voucherify.models.management_projects_webhooks_get_response_body import ManagementProjectsWebhooksGetResponseBody +from voucherify.models.management_projects_webhooks_list_response_body import ManagementProjectsWebhooksListResponseBody +from voucherify.models.management_projects_webhooks_update_request_body import ManagementProjectsWebhooksUpdateRequestBody +from voucherify.models.management_projects_webhooks_update_response_body import ManagementProjectsWebhooksUpdateResponseBody + +from voucherify.api_client import ApiClient, RequestSerialized +from voucherify.api_response import ApiResponse +from voucherify.rest import RESTResponseType + + +class ManagementApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + self.api_client = api_client + + + @validate_call + def assign_user( + self, + project_id: Annotated[StrictStr, Field(description="Provide the unique identifier of the project.")], + management_projects_users_assign_request_body: Annotated[Optional[ManagementProjectsUsersAssignRequestBody], Field(description="Defines the user details.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ManagementProjectsUsersAssignResponseBody: + """Assign User + + Assigns a user to a given project. The user must be an existing user in Voucherify. 🚧 Correct Use of Data To avoid errors, use the role key with either id or login keys. + + :param project_id: Provide the unique identifier of the project. (required) + :type project_id: str + :param management_projects_users_assign_request_body: Defines the user details. + :type management_projects_users_assign_request_body: ManagementProjectsUsersAssignRequestBody + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._assign_user_serialize( + project_id=project_id, + management_projects_users_assign_request_body=management_projects_users_assign_request_body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '2XX': "ManagementProjectsUsersAssignResponseBody", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def assign_user_with_http_info( + self, + project_id: Annotated[StrictStr, Field(description="Provide the unique identifier of the project.")], + management_projects_users_assign_request_body: Annotated[Optional[ManagementProjectsUsersAssignRequestBody], Field(description="Defines the user details.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ManagementProjectsUsersAssignResponseBody]: + """Assign User + + Assigns a user to a given project. The user must be an existing user in Voucherify. 🚧 Correct Use of Data To avoid errors, use the role key with either id or login keys. + + :param project_id: Provide the unique identifier of the project. (required) + :type project_id: str + :param management_projects_users_assign_request_body: Defines the user details. + :type management_projects_users_assign_request_body: ManagementProjectsUsersAssignRequestBody + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._assign_user_serialize( + project_id=project_id, + management_projects_users_assign_request_body=management_projects_users_assign_request_body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '2XX': "ManagementProjectsUsersAssignResponseBody", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def assign_user_without_preload_content( + self, + project_id: Annotated[StrictStr, Field(description="Provide the unique identifier of the project.")], + management_projects_users_assign_request_body: Annotated[Optional[ManagementProjectsUsersAssignRequestBody], Field(description="Defines the user details.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Assign User + + Assigns a user to a given project. The user must be an existing user in Voucherify. 🚧 Correct Use of Data To avoid errors, use the role key with either id or login keys. + + :param project_id: Provide the unique identifier of the project. (required) + :type project_id: str + :param management_projects_users_assign_request_body: Defines the user details. + :type management_projects_users_assign_request_body: ManagementProjectsUsersAssignRequestBody + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._assign_user_serialize( + project_id=project_id, + management_projects_users_assign_request_body=management_projects_users_assign_request_body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '2XX': "ManagementProjectsUsersAssignResponseBody", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _assign_user_serialize( + self, + project_id, + management_projects_users_assign_request_body, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if project_id is not None: + _path_params['projectId'] = project_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if management_projects_users_assign_request_body is not None: + _body_params = management_projects_users_assign_request_body + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'X-Management-Token', + 'X-Management-Id' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/management/v1/projects/{projectId}/users', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def create_brand( + self, + project_id: Annotated[StrictStr, Field(description="Provide the unique identifier of the project.")], + management_projects_branding_create_request_body: Annotated[Optional[ManagementProjectsBrandingCreateRequestBody], Field(description="Defines a brand configuration.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ManagementProjectsBrandingCreateResponseBody: + """Create Brand + + Creates a new brand configuration. You can have only one brand configured for a project. 📘 White Labelling The white labelling settings which can be found in Project Settings > Brand Details and which are available only for Enterprise clients as a separate service can be configured only in the user interface. + + :param project_id: Provide the unique identifier of the project. (required) + :type project_id: str + :param management_projects_branding_create_request_body: Defines a brand configuration. + :type management_projects_branding_create_request_body: ManagementProjectsBrandingCreateRequestBody + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_brand_serialize( + project_id=project_id, + management_projects_branding_create_request_body=management_projects_branding_create_request_body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '2XX': "ManagementProjectsBrandingCreateResponseBody", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def create_brand_with_http_info( + self, + project_id: Annotated[StrictStr, Field(description="Provide the unique identifier of the project.")], + management_projects_branding_create_request_body: Annotated[Optional[ManagementProjectsBrandingCreateRequestBody], Field(description="Defines a brand configuration.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ManagementProjectsBrandingCreateResponseBody]: + """Create Brand + + Creates a new brand configuration. You can have only one brand configured for a project. 📘 White Labelling The white labelling settings which can be found in Project Settings > Brand Details and which are available only for Enterprise clients as a separate service can be configured only in the user interface. + + :param project_id: Provide the unique identifier of the project. (required) + :type project_id: str + :param management_projects_branding_create_request_body: Defines a brand configuration. + :type management_projects_branding_create_request_body: ManagementProjectsBrandingCreateRequestBody + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_brand_serialize( + project_id=project_id, + management_projects_branding_create_request_body=management_projects_branding_create_request_body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '2XX': "ManagementProjectsBrandingCreateResponseBody", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def create_brand_without_preload_content( + self, + project_id: Annotated[StrictStr, Field(description="Provide the unique identifier of the project.")], + management_projects_branding_create_request_body: Annotated[Optional[ManagementProjectsBrandingCreateRequestBody], Field(description="Defines a brand configuration.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Create Brand + + Creates a new brand configuration. You can have only one brand configured for a project. 📘 White Labelling The white labelling settings which can be found in Project Settings > Brand Details and which are available only for Enterprise clients as a separate service can be configured only in the user interface. + + :param project_id: Provide the unique identifier of the project. (required) + :type project_id: str + :param management_projects_branding_create_request_body: Defines a brand configuration. + :type management_projects_branding_create_request_body: ManagementProjectsBrandingCreateRequestBody + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_brand_serialize( + project_id=project_id, + management_projects_branding_create_request_body=management_projects_branding_create_request_body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '2XX': "ManagementProjectsBrandingCreateResponseBody", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _create_brand_serialize( + self, + project_id, + management_projects_branding_create_request_body, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if project_id is not None: + _path_params['projectId'] = project_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if management_projects_branding_create_request_body is not None: + _body_params = management_projects_branding_create_request_body + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'X-Management-Token', + 'X-Management-Id' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/management/v1/projects/{projectId}/branding', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def create_custom_event_schema( + self, + project_id: Annotated[StrictStr, Field(description="Provide the unique identifier of the project.")], + management_projects_custom_event_schemas_create_request_body: Annotated[Optional[ManagementProjectsCustomEventSchemasCreateRequestBody], Field(description="Defines the custom event schema.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ManagementProjectsCustomEventSchemasCreateResponseBody: + """Create Custom Event Schema + + Creates a custom event schema. The properties object is required, but it can be empty, however. This object is for optional custom properties (metadata). 📘 Custom Event Documentation Read [Custom Events](https://support.voucherify.io/article/111-custom-events) article to learn how custom events work in Voucherify. Read also the details about the Track Custom Event endpoint and the Custom Event Object. + + :param project_id: Provide the unique identifier of the project. (required) + :type project_id: str + :param management_projects_custom_event_schemas_create_request_body: Defines the custom event schema. + :type management_projects_custom_event_schemas_create_request_body: ManagementProjectsCustomEventSchemasCreateRequestBody + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_custom_event_schema_serialize( + project_id=project_id, + management_projects_custom_event_schemas_create_request_body=management_projects_custom_event_schemas_create_request_body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '2XX': "ManagementProjectsCustomEventSchemasCreateResponseBody", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def create_custom_event_schema_with_http_info( + self, + project_id: Annotated[StrictStr, Field(description="Provide the unique identifier of the project.")], + management_projects_custom_event_schemas_create_request_body: Annotated[Optional[ManagementProjectsCustomEventSchemasCreateRequestBody], Field(description="Defines the custom event schema.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ManagementProjectsCustomEventSchemasCreateResponseBody]: + """Create Custom Event Schema + + Creates a custom event schema. The properties object is required, but it can be empty, however. This object is for optional custom properties (metadata). 📘 Custom Event Documentation Read [Custom Events](https://support.voucherify.io/article/111-custom-events) article to learn how custom events work in Voucherify. Read also the details about the Track Custom Event endpoint and the Custom Event Object. + + :param project_id: Provide the unique identifier of the project. (required) + :type project_id: str + :param management_projects_custom_event_schemas_create_request_body: Defines the custom event schema. + :type management_projects_custom_event_schemas_create_request_body: ManagementProjectsCustomEventSchemasCreateRequestBody + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_custom_event_schema_serialize( + project_id=project_id, + management_projects_custom_event_schemas_create_request_body=management_projects_custom_event_schemas_create_request_body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '2XX': "ManagementProjectsCustomEventSchemasCreateResponseBody", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def create_custom_event_schema_without_preload_content( + self, + project_id: Annotated[StrictStr, Field(description="Provide the unique identifier of the project.")], + management_projects_custom_event_schemas_create_request_body: Annotated[Optional[ManagementProjectsCustomEventSchemasCreateRequestBody], Field(description="Defines the custom event schema.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Create Custom Event Schema + + Creates a custom event schema. The properties object is required, but it can be empty, however. This object is for optional custom properties (metadata). 📘 Custom Event Documentation Read [Custom Events](https://support.voucherify.io/article/111-custom-events) article to learn how custom events work in Voucherify. Read also the details about the Track Custom Event endpoint and the Custom Event Object. + + :param project_id: Provide the unique identifier of the project. (required) + :type project_id: str + :param management_projects_custom_event_schemas_create_request_body: Defines the custom event schema. + :type management_projects_custom_event_schemas_create_request_body: ManagementProjectsCustomEventSchemasCreateRequestBody + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_custom_event_schema_serialize( + project_id=project_id, + management_projects_custom_event_schemas_create_request_body=management_projects_custom_event_schemas_create_request_body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '2XX': "ManagementProjectsCustomEventSchemasCreateResponseBody", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _create_custom_event_schema_serialize( + self, + project_id, + management_projects_custom_event_schemas_create_request_body, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if project_id is not None: + _path_params['projectId'] = project_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if management_projects_custom_event_schemas_create_request_body is not None: + _body_params = management_projects_custom_event_schemas_create_request_body + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'X-Management-Token', + 'X-Management-Id' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/management/v1/projects/{projectId}/custom-event-schemas', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def create_metadata_schema( + self, + project_id: Annotated[StrictStr, Field(description="Provide the unique identifier of the project.")], + management_projects_metadata_schemas_create_request_body: Annotated[Optional[ManagementProjectsMetadataSchemasCreateRequestBody], Field(description="Defines the metadata schema.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ManagementProjectsMetadataSchemasCreateResponseBody: + """Create Metadata Schema + + Creates a new metadata (custom attribute) schema. The schema consists of a set of key-value pairs to customize Voucherify resources. You can nest your object within a standard metadata schema, e.g. within a campaign or customer schema. However, your nested object cannot include another nested object. The standard metadata schemas are: - Campaign - Voucher - Publication - Redemption - Product - Customer - Order - Order line item - Loyalty Tier - Promotion Tier - Earning rule - Reward 📘 Metadata Documentation Read the Getting Started with Metadata articles to learn how metadata work in Voucherify. + + :param project_id: Provide the unique identifier of the project. (required) + :type project_id: str + :param management_projects_metadata_schemas_create_request_body: Defines the metadata schema. + :type management_projects_metadata_schemas_create_request_body: ManagementProjectsMetadataSchemasCreateRequestBody + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_metadata_schema_serialize( + project_id=project_id, + management_projects_metadata_schemas_create_request_body=management_projects_metadata_schemas_create_request_body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '2XX': "ManagementProjectsMetadataSchemasCreateResponseBody", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def create_metadata_schema_with_http_info( + self, + project_id: Annotated[StrictStr, Field(description="Provide the unique identifier of the project.")], + management_projects_metadata_schemas_create_request_body: Annotated[Optional[ManagementProjectsMetadataSchemasCreateRequestBody], Field(description="Defines the metadata schema.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ManagementProjectsMetadataSchemasCreateResponseBody]: + """Create Metadata Schema + + Creates a new metadata (custom attribute) schema. The schema consists of a set of key-value pairs to customize Voucherify resources. You can nest your object within a standard metadata schema, e.g. within a campaign or customer schema. However, your nested object cannot include another nested object. The standard metadata schemas are: - Campaign - Voucher - Publication - Redemption - Product - Customer - Order - Order line item - Loyalty Tier - Promotion Tier - Earning rule - Reward 📘 Metadata Documentation Read the Getting Started with Metadata articles to learn how metadata work in Voucherify. + + :param project_id: Provide the unique identifier of the project. (required) + :type project_id: str + :param management_projects_metadata_schemas_create_request_body: Defines the metadata schema. + :type management_projects_metadata_schemas_create_request_body: ManagementProjectsMetadataSchemasCreateRequestBody + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_metadata_schema_serialize( + project_id=project_id, + management_projects_metadata_schemas_create_request_body=management_projects_metadata_schemas_create_request_body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '2XX': "ManagementProjectsMetadataSchemasCreateResponseBody", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def create_metadata_schema_without_preload_content( + self, + project_id: Annotated[StrictStr, Field(description="Provide the unique identifier of the project.")], + management_projects_metadata_schemas_create_request_body: Annotated[Optional[ManagementProjectsMetadataSchemasCreateRequestBody], Field(description="Defines the metadata schema.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Create Metadata Schema + + Creates a new metadata (custom attribute) schema. The schema consists of a set of key-value pairs to customize Voucherify resources. You can nest your object within a standard metadata schema, e.g. within a campaign or customer schema. However, your nested object cannot include another nested object. The standard metadata schemas are: - Campaign - Voucher - Publication - Redemption - Product - Customer - Order - Order line item - Loyalty Tier - Promotion Tier - Earning rule - Reward 📘 Metadata Documentation Read the Getting Started with Metadata articles to learn how metadata work in Voucherify. + + :param project_id: Provide the unique identifier of the project. (required) + :type project_id: str + :param management_projects_metadata_schemas_create_request_body: Defines the metadata schema. + :type management_projects_metadata_schemas_create_request_body: ManagementProjectsMetadataSchemasCreateRequestBody + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_metadata_schema_serialize( + project_id=project_id, + management_projects_metadata_schemas_create_request_body=management_projects_metadata_schemas_create_request_body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '2XX': "ManagementProjectsMetadataSchemasCreateResponseBody", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _create_metadata_schema_serialize( + self, + project_id, + management_projects_metadata_schemas_create_request_body, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if project_id is not None: + _path_params['projectId'] = project_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if management_projects_metadata_schemas_create_request_body is not None: + _body_params = management_projects_metadata_schemas_create_request_body + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'X-Management-Token', + 'X-Management-Id' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/management/v1/projects/{projectId}/metadata-schemas', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def create_project( + self, + management_projects_create_request_body: Annotated[Optional[ManagementProjectsCreateRequestBody], Field(description="Define project details.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ManagementProjectsCreateResponseBody: + """Create Project + + Creates a new project. You can add users, specify the cluster, timezone, currency, and other details. All owners are added to the project by default. + + :param management_projects_create_request_body: Define project details. + :type management_projects_create_request_body: ManagementProjectsCreateRequestBody + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_project_serialize( + management_projects_create_request_body=management_projects_create_request_body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '2XX': "ManagementProjectsCreateResponseBody", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def create_project_with_http_info( + self, + management_projects_create_request_body: Annotated[Optional[ManagementProjectsCreateRequestBody], Field(description="Define project details.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ManagementProjectsCreateResponseBody]: + """Create Project + + Creates a new project. You can add users, specify the cluster, timezone, currency, and other details. All owners are added to the project by default. + + :param management_projects_create_request_body: Define project details. + :type management_projects_create_request_body: ManagementProjectsCreateRequestBody + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_project_serialize( + management_projects_create_request_body=management_projects_create_request_body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '2XX': "ManagementProjectsCreateResponseBody", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def create_project_without_preload_content( + self, + management_projects_create_request_body: Annotated[Optional[ManagementProjectsCreateRequestBody], Field(description="Define project details.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Create Project + + Creates a new project. You can add users, specify the cluster, timezone, currency, and other details. All owners are added to the project by default. + + :param management_projects_create_request_body: Define project details. + :type management_projects_create_request_body: ManagementProjectsCreateRequestBody + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_project_serialize( + management_projects_create_request_body=management_projects_create_request_body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '2XX': "ManagementProjectsCreateResponseBody", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _create_project_serialize( + self, + management_projects_create_request_body, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if management_projects_create_request_body is not None: + _body_params = management_projects_create_request_body + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'X-Management-Token', + 'X-Management-Id' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/management/v1/projects', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def create_stacking_rules( + self, + project_id: Annotated[StrictStr, Field(description="Provide the unique identifier of the project.")], + management_projects_stacking_rules_create_request_body: Annotated[Optional[ManagementProjectsStackingRulesCreateRequestBody], Field(description="Defines the stacking rule parameters.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ManagementProjectsStackingRulesCreateResponseBody: + """Create Stacking Rules + + Overwrites the default stacking rules. If new stacking rules have been created for the project earlier (e.g. in the user interface), it returns an error. Use Update Stacking Rules endpoint to change the rules. 📘 Stacking Rules Documentation Read [the Stacking Rules article](https://support.voucherify.io/article/604-stacking-rules) to learn how they work. + + :param project_id: Provide the unique identifier of the project. (required) + :type project_id: str + :param management_projects_stacking_rules_create_request_body: Defines the stacking rule parameters. + :type management_projects_stacking_rules_create_request_body: ManagementProjectsStackingRulesCreateRequestBody + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_stacking_rules_serialize( + project_id=project_id, + management_projects_stacking_rules_create_request_body=management_projects_stacking_rules_create_request_body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '2XX': "ManagementProjectsStackingRulesCreateResponseBody", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def create_stacking_rules_with_http_info( + self, + project_id: Annotated[StrictStr, Field(description="Provide the unique identifier of the project.")], + management_projects_stacking_rules_create_request_body: Annotated[Optional[ManagementProjectsStackingRulesCreateRequestBody], Field(description="Defines the stacking rule parameters.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ManagementProjectsStackingRulesCreateResponseBody]: + """Create Stacking Rules + + Overwrites the default stacking rules. If new stacking rules have been created for the project earlier (e.g. in the user interface), it returns an error. Use Update Stacking Rules endpoint to change the rules. 📘 Stacking Rules Documentation Read [the Stacking Rules article](https://support.voucherify.io/article/604-stacking-rules) to learn how they work. + + :param project_id: Provide the unique identifier of the project. (required) + :type project_id: str + :param management_projects_stacking_rules_create_request_body: Defines the stacking rule parameters. + :type management_projects_stacking_rules_create_request_body: ManagementProjectsStackingRulesCreateRequestBody + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_stacking_rules_serialize( + project_id=project_id, + management_projects_stacking_rules_create_request_body=management_projects_stacking_rules_create_request_body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '2XX': "ManagementProjectsStackingRulesCreateResponseBody", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def create_stacking_rules_without_preload_content( + self, + project_id: Annotated[StrictStr, Field(description="Provide the unique identifier of the project.")], + management_projects_stacking_rules_create_request_body: Annotated[Optional[ManagementProjectsStackingRulesCreateRequestBody], Field(description="Defines the stacking rule parameters.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Create Stacking Rules + + Overwrites the default stacking rules. If new stacking rules have been created for the project earlier (e.g. in the user interface), it returns an error. Use Update Stacking Rules endpoint to change the rules. 📘 Stacking Rules Documentation Read [the Stacking Rules article](https://support.voucherify.io/article/604-stacking-rules) to learn how they work. + + :param project_id: Provide the unique identifier of the project. (required) + :type project_id: str + :param management_projects_stacking_rules_create_request_body: Defines the stacking rule parameters. + :type management_projects_stacking_rules_create_request_body: ManagementProjectsStackingRulesCreateRequestBody + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_stacking_rules_serialize( + project_id=project_id, + management_projects_stacking_rules_create_request_body=management_projects_stacking_rules_create_request_body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '2XX': "ManagementProjectsStackingRulesCreateResponseBody", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _create_stacking_rules_serialize( + self, + project_id, + management_projects_stacking_rules_create_request_body, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if project_id is not None: + _path_params['projectId'] = project_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if management_projects_stacking_rules_create_request_body is not None: + _body_params = management_projects_stacking_rules_create_request_body + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'X-Management-Token', + 'X-Management-Id' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/management/v1/projects/{projectId}/stacking-rules', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def create_webhook( + self, + project_id: Annotated[StrictStr, Field(description="Provide the unique identifier of the project.")], + management_projects_webhooks_create_request_body: Annotated[Optional[ManagementProjectsWebhooksCreateRequestBody], Field(description="Defines a webhook configuration.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ManagementProjectsWebhooksCreateResponseBody: + """Create Webhook + + Creates a new webhook configuration. 📘 Webhook Documentation Read Webhooks v2024-01-01 article to learn how webhooks work in Voucherify. + + :param project_id: Provide the unique identifier of the project. (required) + :type project_id: str + :param management_projects_webhooks_create_request_body: Defines a webhook configuration. + :type management_projects_webhooks_create_request_body: ManagementProjectsWebhooksCreateRequestBody + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_webhook_serialize( + project_id=project_id, + management_projects_webhooks_create_request_body=management_projects_webhooks_create_request_body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '2XX': "ManagementProjectsWebhooksCreateResponseBody", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def create_webhook_with_http_info( + self, + project_id: Annotated[StrictStr, Field(description="Provide the unique identifier of the project.")], + management_projects_webhooks_create_request_body: Annotated[Optional[ManagementProjectsWebhooksCreateRequestBody], Field(description="Defines a webhook configuration.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ManagementProjectsWebhooksCreateResponseBody]: + """Create Webhook + + Creates a new webhook configuration. 📘 Webhook Documentation Read Webhooks v2024-01-01 article to learn how webhooks work in Voucherify. + + :param project_id: Provide the unique identifier of the project. (required) + :type project_id: str + :param management_projects_webhooks_create_request_body: Defines a webhook configuration. + :type management_projects_webhooks_create_request_body: ManagementProjectsWebhooksCreateRequestBody + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_webhook_serialize( + project_id=project_id, + management_projects_webhooks_create_request_body=management_projects_webhooks_create_request_body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '2XX': "ManagementProjectsWebhooksCreateResponseBody", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def create_webhook_without_preload_content( + self, + project_id: Annotated[StrictStr, Field(description="Provide the unique identifier of the project.")], + management_projects_webhooks_create_request_body: Annotated[Optional[ManagementProjectsWebhooksCreateRequestBody], Field(description="Defines a webhook configuration.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Create Webhook + + Creates a new webhook configuration. 📘 Webhook Documentation Read Webhooks v2024-01-01 article to learn how webhooks work in Voucherify. + + :param project_id: Provide the unique identifier of the project. (required) + :type project_id: str + :param management_projects_webhooks_create_request_body: Defines a webhook configuration. + :type management_projects_webhooks_create_request_body: ManagementProjectsWebhooksCreateRequestBody + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_webhook_serialize( + project_id=project_id, + management_projects_webhooks_create_request_body=management_projects_webhooks_create_request_body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '2XX': "ManagementProjectsWebhooksCreateResponseBody", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _create_webhook_serialize( + self, + project_id, + management_projects_webhooks_create_request_body, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if project_id is not None: + _path_params['projectId'] = project_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if management_projects_webhooks_create_request_body is not None: + _body_params = management_projects_webhooks_create_request_body + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'X-Management-Token', + 'X-Management-Id' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/management/v1/projects/{projectId}/webhooks', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def delete_brand( + self, + project_id: Annotated[StrictStr, Field(description="Provide the unique identifier of the project.")], + branding_id: Annotated[StrictStr, Field(description="Provide the unique identifier of the brand configuration.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Delete Brand + + Deletes permanently a brand configuration. + + :param project_id: Provide the unique identifier of the project. (required) + :type project_id: str + :param branding_id: Provide the unique identifier of the brand configuration. (required) + :type branding_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_brand_serialize( + project_id=project_id, + branding_id=branding_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '2XX': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def delete_brand_with_http_info( + self, + project_id: Annotated[StrictStr, Field(description="Provide the unique identifier of the project.")], + branding_id: Annotated[StrictStr, Field(description="Provide the unique identifier of the brand configuration.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Delete Brand + + Deletes permanently a brand configuration. + + :param project_id: Provide the unique identifier of the project. (required) + :type project_id: str + :param branding_id: Provide the unique identifier of the brand configuration. (required) + :type branding_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_brand_serialize( + project_id=project_id, + branding_id=branding_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '2XX': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def delete_brand_without_preload_content( + self, + project_id: Annotated[StrictStr, Field(description="Provide the unique identifier of the project.")], + branding_id: Annotated[StrictStr, Field(description="Provide the unique identifier of the brand configuration.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Delete Brand + + Deletes permanently a brand configuration. + + :param project_id: Provide the unique identifier of the project. (required) + :type project_id: str + :param branding_id: Provide the unique identifier of the brand configuration. (required) + :type branding_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_brand_serialize( + project_id=project_id, + branding_id=branding_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '2XX': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _delete_brand_serialize( + self, + project_id, + branding_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if project_id is not None: + _path_params['projectId'] = project_id + if branding_id is not None: + _path_params['brandingId'] = branding_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + + + # authentication setting + _auth_settings: List[str] = [ + 'X-Management-Token', + 'X-Management-Id' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/management/v1/projects/{projectId}/branding/{brandingId}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def delete_custom_event_schema( + self, + project_id: Annotated[StrictStr, Field(description="Provide the unique identifier of the project.")], + custom_event_schema_id: Annotated[StrictStr, Field(description="Provide the unique identifier of the custom event schema.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Delete Custom Event Schema + + Deletes permanently the custom event schema with its custom properties (metadata). 📘 Custom Event Documentation Read [Custom Events](https://support.voucherify.io/article/111-custom-events) article to learn how custom events work in Voucherify. Read also the details about the Track Custom Event endpoint and the Custom Event Object. + + :param project_id: Provide the unique identifier of the project. (required) + :type project_id: str + :param custom_event_schema_id: Provide the unique identifier of the custom event schema. (required) + :type custom_event_schema_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_custom_event_schema_serialize( + project_id=project_id, + custom_event_schema_id=custom_event_schema_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '2XX': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def delete_custom_event_schema_with_http_info( + self, + project_id: Annotated[StrictStr, Field(description="Provide the unique identifier of the project.")], + custom_event_schema_id: Annotated[StrictStr, Field(description="Provide the unique identifier of the custom event schema.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Delete Custom Event Schema + + Deletes permanently the custom event schema with its custom properties (metadata). 📘 Custom Event Documentation Read [Custom Events](https://support.voucherify.io/article/111-custom-events) article to learn how custom events work in Voucherify. Read also the details about the Track Custom Event endpoint and the Custom Event Object. + + :param project_id: Provide the unique identifier of the project. (required) + :type project_id: str + :param custom_event_schema_id: Provide the unique identifier of the custom event schema. (required) + :type custom_event_schema_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_custom_event_schema_serialize( + project_id=project_id, + custom_event_schema_id=custom_event_schema_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '2XX': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def delete_custom_event_schema_without_preload_content( + self, + project_id: Annotated[StrictStr, Field(description="Provide the unique identifier of the project.")], + custom_event_schema_id: Annotated[StrictStr, Field(description="Provide the unique identifier of the custom event schema.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Delete Custom Event Schema + + Deletes permanently the custom event schema with its custom properties (metadata). 📘 Custom Event Documentation Read [Custom Events](https://support.voucherify.io/article/111-custom-events) article to learn how custom events work in Voucherify. Read also the details about the Track Custom Event endpoint and the Custom Event Object. + + :param project_id: Provide the unique identifier of the project. (required) + :type project_id: str + :param custom_event_schema_id: Provide the unique identifier of the custom event schema. (required) + :type custom_event_schema_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_custom_event_schema_serialize( + project_id=project_id, + custom_event_schema_id=custom_event_schema_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '2XX': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _delete_custom_event_schema_serialize( + self, + project_id, + custom_event_schema_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if project_id is not None: + _path_params['projectId'] = project_id + if custom_event_schema_id is not None: + _path_params['customEventSchemaId'] = custom_event_schema_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + + + # authentication setting + _auth_settings: List[str] = [ + 'X-Management-Token', + 'X-Management-Id' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/management/v1/projects/{projectId}/custom-event-schemas/{customEventSchemaId}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def delete_metadata_schema( + self, + project_id: Annotated[StrictStr, Field(description="Provide the unique identifier of the project.")], + metadata_schema_id: Annotated[StrictStr, Field(description="Provide the unique identifier of the metadata schema.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Delete Metadata Schema + + Deletes permanently the metadata schema. In standard metadata schemas, this endpoint removes permanently all definitions. The standard metadata schemas are: - Campaign - Voucher - Publication - Redemption - Product - Customer - Order - Order line item - Loyalty Tier - Promotion Tier - Earning rule - Reward If you want to delete only one definition, use the Update Metadata Schema endpoint. In the request, provide the deleted: true pair in the definition object. This definition will be moved to Removed definitions. If you want to create a new standard metadata schema, use the Create Metadata Schema endpoint. 🚧 Metadata Purging This endpoint deletes permanently the metadata schemas only. However, it does not purge the metadata from associated entities, so the metadata added to those entities will remain. If you want to purge metadata from the entities: 1. Remove all the definitions you want to purge. You can do this either in Voucherify Project Settings > Metadata Schema tab or with the Update Metadata Schema endpoint. 2. In Voucherify Project Settings > Metadata Schema tab, go to the relevant metadata schema. 3. In Removed definitions, click the bin button next to the definitions whose metadata you want to purge from entities. Note: - This is an asynchronous action. You will be notified when it has been completed. - You cannot purge metadata for the Redemption and Publication schemas. 4. Use the Delete Metadata Schema request to delete the metadata schema from Voucherify. 📘 Metadata Documentation Read the Getting Started with Metadata articles to learn how metadata work in Voucherify. + + :param project_id: Provide the unique identifier of the project. (required) + :type project_id: str + :param metadata_schema_id: Provide the unique identifier of the metadata schema. (required) + :type metadata_schema_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_metadata_schema_serialize( + project_id=project_id, + metadata_schema_id=metadata_schema_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '2XX': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def delete_metadata_schema_with_http_info( + self, + project_id: Annotated[StrictStr, Field(description="Provide the unique identifier of the project.")], + metadata_schema_id: Annotated[StrictStr, Field(description="Provide the unique identifier of the metadata schema.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Delete Metadata Schema + + Deletes permanently the metadata schema. In standard metadata schemas, this endpoint removes permanently all definitions. The standard metadata schemas are: - Campaign - Voucher - Publication - Redemption - Product - Customer - Order - Order line item - Loyalty Tier - Promotion Tier - Earning rule - Reward If you want to delete only one definition, use the Update Metadata Schema endpoint. In the request, provide the deleted: true pair in the definition object. This definition will be moved to Removed definitions. If you want to create a new standard metadata schema, use the Create Metadata Schema endpoint. 🚧 Metadata Purging This endpoint deletes permanently the metadata schemas only. However, it does not purge the metadata from associated entities, so the metadata added to those entities will remain. If you want to purge metadata from the entities: 1. Remove all the definitions you want to purge. You can do this either in Voucherify Project Settings > Metadata Schema tab or with the Update Metadata Schema endpoint. 2. In Voucherify Project Settings > Metadata Schema tab, go to the relevant metadata schema. 3. In Removed definitions, click the bin button next to the definitions whose metadata you want to purge from entities. Note: - This is an asynchronous action. You will be notified when it has been completed. - You cannot purge metadata for the Redemption and Publication schemas. 4. Use the Delete Metadata Schema request to delete the metadata schema from Voucherify. 📘 Metadata Documentation Read the Getting Started with Metadata articles to learn how metadata work in Voucherify. + + :param project_id: Provide the unique identifier of the project. (required) + :type project_id: str + :param metadata_schema_id: Provide the unique identifier of the metadata schema. (required) + :type metadata_schema_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_metadata_schema_serialize( + project_id=project_id, + metadata_schema_id=metadata_schema_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '2XX': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def delete_metadata_schema_without_preload_content( + self, + project_id: Annotated[StrictStr, Field(description="Provide the unique identifier of the project.")], + metadata_schema_id: Annotated[StrictStr, Field(description="Provide the unique identifier of the metadata schema.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Delete Metadata Schema + + Deletes permanently the metadata schema. In standard metadata schemas, this endpoint removes permanently all definitions. The standard metadata schemas are: - Campaign - Voucher - Publication - Redemption - Product - Customer - Order - Order line item - Loyalty Tier - Promotion Tier - Earning rule - Reward If you want to delete only one definition, use the Update Metadata Schema endpoint. In the request, provide the deleted: true pair in the definition object. This definition will be moved to Removed definitions. If you want to create a new standard metadata schema, use the Create Metadata Schema endpoint. 🚧 Metadata Purging This endpoint deletes permanently the metadata schemas only. However, it does not purge the metadata from associated entities, so the metadata added to those entities will remain. If you want to purge metadata from the entities: 1. Remove all the definitions you want to purge. You can do this either in Voucherify Project Settings > Metadata Schema tab or with the Update Metadata Schema endpoint. 2. In Voucherify Project Settings > Metadata Schema tab, go to the relevant metadata schema. 3. In Removed definitions, click the bin button next to the definitions whose metadata you want to purge from entities. Note: - This is an asynchronous action. You will be notified when it has been completed. - You cannot purge metadata for the Redemption and Publication schemas. 4. Use the Delete Metadata Schema request to delete the metadata schema from Voucherify. 📘 Metadata Documentation Read the Getting Started with Metadata articles to learn how metadata work in Voucherify. + + :param project_id: Provide the unique identifier of the project. (required) + :type project_id: str + :param metadata_schema_id: Provide the unique identifier of the metadata schema. (required) + :type metadata_schema_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_metadata_schema_serialize( + project_id=project_id, + metadata_schema_id=metadata_schema_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '2XX': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _delete_metadata_schema_serialize( + self, + project_id, + metadata_schema_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if project_id is not None: + _path_params['projectId'] = project_id + if metadata_schema_id is not None: + _path_params['metadataSchemaId'] = metadata_schema_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + + + # authentication setting + _auth_settings: List[str] = [ + 'X-Management-Token', + 'X-Management-Id' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/management/v1/projects/{projectId}/metadata-schemas/{metadataSchemaId}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def delete_project( + self, + project_id: Annotated[StrictStr, Field(description="Provide the unique identifier of the project.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Delete Project + + Deletes an existing project. The users currently using the deleted project will be automatically logged out. 🚧 Sandbox Project The sandbox project cannot be deleted. + + :param project_id: Provide the unique identifier of the project. (required) + :type project_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_project_serialize( + project_id=project_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '2XX': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def delete_project_with_http_info( + self, + project_id: Annotated[StrictStr, Field(description="Provide the unique identifier of the project.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Delete Project + + Deletes an existing project. The users currently using the deleted project will be automatically logged out. 🚧 Sandbox Project The sandbox project cannot be deleted. + + :param project_id: Provide the unique identifier of the project. (required) + :type project_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_project_serialize( + project_id=project_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '2XX': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def delete_project_without_preload_content( + self, + project_id: Annotated[StrictStr, Field(description="Provide the unique identifier of the project.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Delete Project + + Deletes an existing project. The users currently using the deleted project will be automatically logged out. 🚧 Sandbox Project The sandbox project cannot be deleted. + + :param project_id: Provide the unique identifier of the project. (required) + :type project_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_project_serialize( + project_id=project_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '2XX': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _delete_project_serialize( + self, + project_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if project_id is not None: + _path_params['projectId'] = project_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + + + # authentication setting + _auth_settings: List[str] = [ + 'X-Management-Token', + 'X-Management-Id' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/management/v1/projects/{projectId}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def delete_stacking_rules( + self, + project_id: Annotated[StrictStr, Field(description="Provide the unique identifier of the project.")], + stacking_rules_id: Annotated[StrictStr, Field(description="Provide the unique identifier of the stacking rules.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Delete Stacking Rules + + Deletes permanently the current settings for the stacking rules. The stacking rules are restored to default values. 📘 Stacking Rules Documentation Read [the Stacking Rules article](https://support.voucherify.io/article/604-stacking-rules) to learn how they work. + + :param project_id: Provide the unique identifier of the project. (required) + :type project_id: str + :param stacking_rules_id: Provide the unique identifier of the stacking rules. (required) + :type stacking_rules_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_stacking_rules_serialize( + project_id=project_id, + stacking_rules_id=stacking_rules_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '2XX': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def delete_stacking_rules_with_http_info( + self, + project_id: Annotated[StrictStr, Field(description="Provide the unique identifier of the project.")], + stacking_rules_id: Annotated[StrictStr, Field(description="Provide the unique identifier of the stacking rules.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Delete Stacking Rules + + Deletes permanently the current settings for the stacking rules. The stacking rules are restored to default values. 📘 Stacking Rules Documentation Read [the Stacking Rules article](https://support.voucherify.io/article/604-stacking-rules) to learn how they work. + + :param project_id: Provide the unique identifier of the project. (required) + :type project_id: str + :param stacking_rules_id: Provide the unique identifier of the stacking rules. (required) + :type stacking_rules_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_stacking_rules_serialize( + project_id=project_id, + stacking_rules_id=stacking_rules_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '2XX': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def delete_stacking_rules_without_preload_content( + self, + project_id: Annotated[StrictStr, Field(description="Provide the unique identifier of the project.")], + stacking_rules_id: Annotated[StrictStr, Field(description="Provide the unique identifier of the stacking rules.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Delete Stacking Rules + + Deletes permanently the current settings for the stacking rules. The stacking rules are restored to default values. 📘 Stacking Rules Documentation Read [the Stacking Rules article](https://support.voucherify.io/article/604-stacking-rules) to learn how they work. + + :param project_id: Provide the unique identifier of the project. (required) + :type project_id: str + :param stacking_rules_id: Provide the unique identifier of the stacking rules. (required) + :type stacking_rules_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_stacking_rules_serialize( + project_id=project_id, + stacking_rules_id=stacking_rules_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '2XX': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _delete_stacking_rules_serialize( + self, + project_id, + stacking_rules_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if project_id is not None: + _path_params['projectId'] = project_id + if stacking_rules_id is not None: + _path_params['stackingRulesId'] = stacking_rules_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + + + # authentication setting + _auth_settings: List[str] = [ + 'X-Management-Token', + 'X-Management-Id' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/management/v1/projects/{projectId}/stacking-rules/{stackingRulesId}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def delete_webhook( + self, + project_id: Annotated[StrictStr, Field(description="Provide the unique identifier of the project.")], + webhook_id: Annotated[StrictStr, Field(description="Provide the unique identifier of the webhook configuration.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Delete Webhook + + Deletes a webhook configuration. 📘 Webhook Documentation Read Webhooks v2024-01-1 article to learn how webhooks work in Voucherify. + + :param project_id: Provide the unique identifier of the project. (required) + :type project_id: str + :param webhook_id: Provide the unique identifier of the webhook configuration. (required) + :type webhook_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_webhook_serialize( + project_id=project_id, + webhook_id=webhook_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '2XX': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def delete_webhook_with_http_info( + self, + project_id: Annotated[StrictStr, Field(description="Provide the unique identifier of the project.")], + webhook_id: Annotated[StrictStr, Field(description="Provide the unique identifier of the webhook configuration.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Delete Webhook + + Deletes a webhook configuration. 📘 Webhook Documentation Read Webhooks v2024-01-1 article to learn how webhooks work in Voucherify. + + :param project_id: Provide the unique identifier of the project. (required) + :type project_id: str + :param webhook_id: Provide the unique identifier of the webhook configuration. (required) + :type webhook_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_webhook_serialize( + project_id=project_id, + webhook_id=webhook_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '2XX': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def delete_webhook_without_preload_content( + self, + project_id: Annotated[StrictStr, Field(description="Provide the unique identifier of the project.")], + webhook_id: Annotated[StrictStr, Field(description="Provide the unique identifier of the webhook configuration.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Delete Webhook + + Deletes a webhook configuration. 📘 Webhook Documentation Read Webhooks v2024-01-1 article to learn how webhooks work in Voucherify. + + :param project_id: Provide the unique identifier of the project. (required) + :type project_id: str + :param webhook_id: Provide the unique identifier of the webhook configuration. (required) + :type webhook_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_webhook_serialize( + project_id=project_id, + webhook_id=webhook_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '2XX': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _delete_webhook_serialize( + self, + project_id, + webhook_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if project_id is not None: + _path_params['projectId'] = project_id + if webhook_id is not None: + _path_params['webhookId'] = webhook_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + + + # authentication setting + _auth_settings: List[str] = [ + 'X-Management-Token', + 'X-Management-Id' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/management/v1/projects/{projectId}/webhooks/{webhookId}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def get_brand( + self, + project_id: Annotated[StrictStr, Field(description="Provide the unique identifier of the project.")], + branding_id: Annotated[StrictStr, Field(description="Provide the unique identifier of the brand configuration.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ManagementProjectsBrandingGetResponseBody: + """Get Brand + + Retrieves a brand configuration. + + :param project_id: Provide the unique identifier of the project. (required) + :type project_id: str + :param branding_id: Provide the unique identifier of the brand configuration. (required) + :type branding_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_brand_serialize( + project_id=project_id, + branding_id=branding_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '2XX': "ManagementProjectsBrandingGetResponseBody", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_brand_with_http_info( + self, + project_id: Annotated[StrictStr, Field(description="Provide the unique identifier of the project.")], + branding_id: Annotated[StrictStr, Field(description="Provide the unique identifier of the brand configuration.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ManagementProjectsBrandingGetResponseBody]: + """Get Brand + + Retrieves a brand configuration. + + :param project_id: Provide the unique identifier of the project. (required) + :type project_id: str + :param branding_id: Provide the unique identifier of the brand configuration. (required) + :type branding_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_brand_serialize( + project_id=project_id, + branding_id=branding_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '2XX': "ManagementProjectsBrandingGetResponseBody", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def get_brand_without_preload_content( + self, + project_id: Annotated[StrictStr, Field(description="Provide the unique identifier of the project.")], + branding_id: Annotated[StrictStr, Field(description="Provide the unique identifier of the brand configuration.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get Brand + + Retrieves a brand configuration. + + :param project_id: Provide the unique identifier of the project. (required) + :type project_id: str + :param branding_id: Provide the unique identifier of the brand configuration. (required) + :type branding_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_brand_serialize( + project_id=project_id, + branding_id=branding_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '2XX': "ManagementProjectsBrandingGetResponseBody", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_brand_serialize( + self, + project_id, + branding_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if project_id is not None: + _path_params['projectId'] = project_id + if branding_id is not None: + _path_params['brandingId'] = branding_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'X-Management-Token', + 'X-Management-Id' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/management/v1/projects/{projectId}/branding/{brandingId}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def get_custom_event_schema( + self, + project_id: Annotated[StrictStr, Field(description="Provide the unique identifier of the project.")], + custom_event_schema_id: Annotated[StrictStr, Field(description="Provide the unique identifier of the custom event schema.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ManagementProjectsCustomEventSchemasGetResponseBody: + """Get Custom Event Schema + + Retrieves a custom event schema. 📘 Custom Event Documentation Read [Custom Events](https://support.voucherify.io/article/111-custom-events) article to learn how custom events work in Voucherify. Read also the details about the Track Custom Event endpoint and the Custom Event Object. + + :param project_id: Provide the unique identifier of the project. (required) + :type project_id: str + :param custom_event_schema_id: Provide the unique identifier of the custom event schema. (required) + :type custom_event_schema_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_custom_event_schema_serialize( + project_id=project_id, + custom_event_schema_id=custom_event_schema_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '2XX': "ManagementProjectsCustomEventSchemasGetResponseBody", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_custom_event_schema_with_http_info( + self, + project_id: Annotated[StrictStr, Field(description="Provide the unique identifier of the project.")], + custom_event_schema_id: Annotated[StrictStr, Field(description="Provide the unique identifier of the custom event schema.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ManagementProjectsCustomEventSchemasGetResponseBody]: + """Get Custom Event Schema + + Retrieves a custom event schema. 📘 Custom Event Documentation Read [Custom Events](https://support.voucherify.io/article/111-custom-events) article to learn how custom events work in Voucherify. Read also the details about the Track Custom Event endpoint and the Custom Event Object. + + :param project_id: Provide the unique identifier of the project. (required) + :type project_id: str + :param custom_event_schema_id: Provide the unique identifier of the custom event schema. (required) + :type custom_event_schema_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_custom_event_schema_serialize( + project_id=project_id, + custom_event_schema_id=custom_event_schema_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '2XX': "ManagementProjectsCustomEventSchemasGetResponseBody", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def get_custom_event_schema_without_preload_content( + self, + project_id: Annotated[StrictStr, Field(description="Provide the unique identifier of the project.")], + custom_event_schema_id: Annotated[StrictStr, Field(description="Provide the unique identifier of the custom event schema.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get Custom Event Schema + + Retrieves a custom event schema. 📘 Custom Event Documentation Read [Custom Events](https://support.voucherify.io/article/111-custom-events) article to learn how custom events work in Voucherify. Read also the details about the Track Custom Event endpoint and the Custom Event Object. + + :param project_id: Provide the unique identifier of the project. (required) + :type project_id: str + :param custom_event_schema_id: Provide the unique identifier of the custom event schema. (required) + :type custom_event_schema_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_custom_event_schema_serialize( + project_id=project_id, + custom_event_schema_id=custom_event_schema_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '2XX': "ManagementProjectsCustomEventSchemasGetResponseBody", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_custom_event_schema_serialize( + self, + project_id, + custom_event_schema_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if project_id is not None: + _path_params['projectId'] = project_id + if custom_event_schema_id is not None: + _path_params['customEventSchemaId'] = custom_event_schema_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'X-Management-Token', + 'X-Management-Id' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/management/v1/projects/{projectId}/custom-event-schemas/{customEventSchemaId}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def get_metadata_schema1( + self, + project_id: Annotated[StrictStr, Field(description="Provide the unique identifier of the project.")], + metadata_schema_id: Annotated[StrictStr, Field(description="Provide the unique identifier of the metadata schema.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ManagementProjectsMetadataSchemasGetResponseBody: + """Get Metadata Schema + + Retrieves a metadata schema. 📘 Metadata Documentation Read the Getting Started with Metadata articles to learn how metadata work in Voucherify. + + :param project_id: Provide the unique identifier of the project. (required) + :type project_id: str + :param metadata_schema_id: Provide the unique identifier of the metadata schema. (required) + :type metadata_schema_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_metadata_schema1_serialize( + project_id=project_id, + metadata_schema_id=metadata_schema_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '2XX': "ManagementProjectsMetadataSchemasGetResponseBody", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_metadata_schema1_with_http_info( + self, + project_id: Annotated[StrictStr, Field(description="Provide the unique identifier of the project.")], + metadata_schema_id: Annotated[StrictStr, Field(description="Provide the unique identifier of the metadata schema.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ManagementProjectsMetadataSchemasGetResponseBody]: + """Get Metadata Schema + + Retrieves a metadata schema. 📘 Metadata Documentation Read the Getting Started with Metadata articles to learn how metadata work in Voucherify. + + :param project_id: Provide the unique identifier of the project. (required) + :type project_id: str + :param metadata_schema_id: Provide the unique identifier of the metadata schema. (required) + :type metadata_schema_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_metadata_schema1_serialize( + project_id=project_id, + metadata_schema_id=metadata_schema_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '2XX': "ManagementProjectsMetadataSchemasGetResponseBody", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def get_metadata_schema1_without_preload_content( + self, + project_id: Annotated[StrictStr, Field(description="Provide the unique identifier of the project.")], + metadata_schema_id: Annotated[StrictStr, Field(description="Provide the unique identifier of the metadata schema.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get Metadata Schema + + Retrieves a metadata schema. 📘 Metadata Documentation Read the Getting Started with Metadata articles to learn how metadata work in Voucherify. + + :param project_id: Provide the unique identifier of the project. (required) + :type project_id: str + :param metadata_schema_id: Provide the unique identifier of the metadata schema. (required) + :type metadata_schema_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_metadata_schema1_serialize( + project_id=project_id, + metadata_schema_id=metadata_schema_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '2XX': "ManagementProjectsMetadataSchemasGetResponseBody", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_metadata_schema1_serialize( + self, + project_id, + metadata_schema_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if project_id is not None: + _path_params['projectId'] = project_id + if metadata_schema_id is not None: + _path_params['metadataSchemaId'] = metadata_schema_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'X-Management-Token', + 'X-Management-Id' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/management/v1/projects/{projectId}/metadata-schemas/{metadataSchemaId}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def get_project( + self, + project_id: Annotated[StrictStr, Field(description="Provide the unique identifier of the project.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ManagementProjectsGetResponseBody: + """Get Project + + Retrieves an existing project. + + :param project_id: Provide the unique identifier of the project. (required) + :type project_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_project_serialize( + project_id=project_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '2XX': "ManagementProjectsGetResponseBody", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_project_with_http_info( + self, + project_id: Annotated[StrictStr, Field(description="Provide the unique identifier of the project.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ManagementProjectsGetResponseBody]: + """Get Project + + Retrieves an existing project. + + :param project_id: Provide the unique identifier of the project. (required) + :type project_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_project_serialize( + project_id=project_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '2XX': "ManagementProjectsGetResponseBody", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def get_project_without_preload_content( + self, + project_id: Annotated[StrictStr, Field(description="Provide the unique identifier of the project.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get Project + + Retrieves an existing project. + + :param project_id: Provide the unique identifier of the project. (required) + :type project_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_project_serialize( + project_id=project_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '2XX': "ManagementProjectsGetResponseBody", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_project_serialize( + self, + project_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if project_id is not None: + _path_params['projectId'] = project_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'X-Management-Token', + 'X-Management-Id' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/management/v1/projects/{projectId}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def get_stacking_rules( + self, + project_id: Annotated[StrictStr, Field(description="Provide the unique identifier of the project.")], + stacking_rules_id: Annotated[StrictStr, Field(description="Provide the unique identifier of the stacking rules.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ManagementProjectsStackingRulesGetResponseBody: + """Get Stacking Rules + + Retrieves the stacking rules for the project. 📘 Stacking Rules Documentation Read [the Stacking Rules article](https://support.voucherify.io/article/604-stacking-rules) to learn how they work. + + :param project_id: Provide the unique identifier of the project. (required) + :type project_id: str + :param stacking_rules_id: Provide the unique identifier of the stacking rules. (required) + :type stacking_rules_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_stacking_rules_serialize( + project_id=project_id, + stacking_rules_id=stacking_rules_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '2XX': "ManagementProjectsStackingRulesGetResponseBody", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_stacking_rules_with_http_info( + self, + project_id: Annotated[StrictStr, Field(description="Provide the unique identifier of the project.")], + stacking_rules_id: Annotated[StrictStr, Field(description="Provide the unique identifier of the stacking rules.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ManagementProjectsStackingRulesGetResponseBody]: + """Get Stacking Rules + + Retrieves the stacking rules for the project. 📘 Stacking Rules Documentation Read [the Stacking Rules article](https://support.voucherify.io/article/604-stacking-rules) to learn how they work. + + :param project_id: Provide the unique identifier of the project. (required) + :type project_id: str + :param stacking_rules_id: Provide the unique identifier of the stacking rules. (required) + :type stacking_rules_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_stacking_rules_serialize( + project_id=project_id, + stacking_rules_id=stacking_rules_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '2XX': "ManagementProjectsStackingRulesGetResponseBody", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def get_stacking_rules_without_preload_content( + self, + project_id: Annotated[StrictStr, Field(description="Provide the unique identifier of the project.")], + stacking_rules_id: Annotated[StrictStr, Field(description="Provide the unique identifier of the stacking rules.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get Stacking Rules + + Retrieves the stacking rules for the project. 📘 Stacking Rules Documentation Read [the Stacking Rules article](https://support.voucherify.io/article/604-stacking-rules) to learn how they work. + + :param project_id: Provide the unique identifier of the project. (required) + :type project_id: str + :param stacking_rules_id: Provide the unique identifier of the stacking rules. (required) + :type stacking_rules_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_stacking_rules_serialize( + project_id=project_id, + stacking_rules_id=stacking_rules_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '2XX': "ManagementProjectsStackingRulesGetResponseBody", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_stacking_rules_serialize( + self, + project_id, + stacking_rules_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if project_id is not None: + _path_params['projectId'] = project_id + if stacking_rules_id is not None: + _path_params['stackingRulesId'] = stacking_rules_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'X-Management-Token', + 'X-Management-Id' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/management/v1/projects/{projectId}/stacking-rules/{stackingRulesId}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def get_user( + self, + project_id: Annotated[StrictStr, Field(description="Provide the unique identifier of the project.")], + user_id: Annotated[StrictStr, Field(description="Provide the unique identifier of the user. Alternatively, provide the users login.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ManagementProjectsUsersGetUserResponseBody: + """Get User + + Retrieves the project users details. + + :param project_id: Provide the unique identifier of the project. (required) + :type project_id: str + :param user_id: Provide the unique identifier of the user. Alternatively, provide the users login. (required) + :type user_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_user_serialize( + project_id=project_id, + user_id=user_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '2XX': "ManagementProjectsUsersGetUserResponseBody", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_user_with_http_info( + self, + project_id: Annotated[StrictStr, Field(description="Provide the unique identifier of the project.")], + user_id: Annotated[StrictStr, Field(description="Provide the unique identifier of the user. Alternatively, provide the users login.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ManagementProjectsUsersGetUserResponseBody]: + """Get User + + Retrieves the project users details. + + :param project_id: Provide the unique identifier of the project. (required) + :type project_id: str + :param user_id: Provide the unique identifier of the user. Alternatively, provide the users login. (required) + :type user_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_user_serialize( + project_id=project_id, + user_id=user_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '2XX': "ManagementProjectsUsersGetUserResponseBody", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def get_user_without_preload_content( + self, + project_id: Annotated[StrictStr, Field(description="Provide the unique identifier of the project.")], + user_id: Annotated[StrictStr, Field(description="Provide the unique identifier of the user. Alternatively, provide the users login.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get User + + Retrieves the project users details. + + :param project_id: Provide the unique identifier of the project. (required) + :type project_id: str + :param user_id: Provide the unique identifier of the user. Alternatively, provide the users login. (required) + :type user_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_user_serialize( + project_id=project_id, + user_id=user_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '2XX': "ManagementProjectsUsersGetUserResponseBody", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_user_serialize( + self, + project_id, + user_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if project_id is not None: + _path_params['projectId'] = project_id + if user_id is not None: + _path_params['userId'] = user_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'X-Management-Token', + 'X-Management-Id' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/management/v1/projects/{projectId}/users/{userId}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def get_webhook( + self, + project_id: Annotated[StrictStr, Field(description="Provide the unique identifier of the project.")], + webhook_id: Annotated[StrictStr, Field(description="Provide the unique identifier of the webhook configuration.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ManagementProjectsWebhooksGetResponseBody: + """Get Webhook + + Retrieves a webhook configuration. 📘 Webhook Documentation Read Webhooks v2024-01-1 article to learn how webhooks work in Voucherify. + + :param project_id: Provide the unique identifier of the project. (required) + :type project_id: str + :param webhook_id: Provide the unique identifier of the webhook configuration. (required) + :type webhook_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_webhook_serialize( + project_id=project_id, + webhook_id=webhook_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '2XX': "ManagementProjectsWebhooksGetResponseBody", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_webhook_with_http_info( + self, + project_id: Annotated[StrictStr, Field(description="Provide the unique identifier of the project.")], + webhook_id: Annotated[StrictStr, Field(description="Provide the unique identifier of the webhook configuration.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ManagementProjectsWebhooksGetResponseBody]: + """Get Webhook + + Retrieves a webhook configuration. 📘 Webhook Documentation Read Webhooks v2024-01-1 article to learn how webhooks work in Voucherify. + + :param project_id: Provide the unique identifier of the project. (required) + :type project_id: str + :param webhook_id: Provide the unique identifier of the webhook configuration. (required) + :type webhook_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_webhook_serialize( + project_id=project_id, + webhook_id=webhook_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '2XX': "ManagementProjectsWebhooksGetResponseBody", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def get_webhook_without_preload_content( + self, + project_id: Annotated[StrictStr, Field(description="Provide the unique identifier of the project.")], + webhook_id: Annotated[StrictStr, Field(description="Provide the unique identifier of the webhook configuration.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get Webhook + + Retrieves a webhook configuration. 📘 Webhook Documentation Read Webhooks v2024-01-1 article to learn how webhooks work in Voucherify. + + :param project_id: Provide the unique identifier of the project. (required) + :type project_id: str + :param webhook_id: Provide the unique identifier of the webhook configuration. (required) + :type webhook_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_webhook_serialize( + project_id=project_id, + webhook_id=webhook_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '2XX': "ManagementProjectsWebhooksGetResponseBody", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_webhook_serialize( + self, + project_id, + webhook_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if project_id is not None: + _path_params['projectId'] = project_id + if webhook_id is not None: + _path_params['webhookId'] = webhook_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'X-Management-Token', + 'X-Management-Id' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/management/v1/projects/{projectId}/webhooks/{webhookId}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def invite_user( + self, + management_projects_users_invite_create_request_body: Annotated[Optional[ManagementProjectsUsersInviteCreateRequestBody], Field(description="Defines the details of the invitation, the project, and roles to which the user will be assigned.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Invite a New User + + Sends an invitation to an email address that has not been used yet as a Voucherify user login. You can specify the projects to which the invited user will be assigned and define their roles. + + :param management_projects_users_invite_create_request_body: Defines the details of the invitation, the project, and roles to which the user will be assigned. + :type management_projects_users_invite_create_request_body: ManagementProjectsUsersInviteCreateRequestBody + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._invite_user_serialize( + management_projects_users_invite_create_request_body=management_projects_users_invite_create_request_body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '2XX': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def invite_user_with_http_info( + self, + management_projects_users_invite_create_request_body: Annotated[Optional[ManagementProjectsUsersInviteCreateRequestBody], Field(description="Defines the details of the invitation, the project, and roles to which the user will be assigned.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Invite a New User + + Sends an invitation to an email address that has not been used yet as a Voucherify user login. You can specify the projects to which the invited user will be assigned and define their roles. + + :param management_projects_users_invite_create_request_body: Defines the details of the invitation, the project, and roles to which the user will be assigned. + :type management_projects_users_invite_create_request_body: ManagementProjectsUsersInviteCreateRequestBody + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._invite_user_serialize( + management_projects_users_invite_create_request_body=management_projects_users_invite_create_request_body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '2XX': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def invite_user_without_preload_content( + self, + management_projects_users_invite_create_request_body: Annotated[Optional[ManagementProjectsUsersInviteCreateRequestBody], Field(description="Defines the details of the invitation, the project, and roles to which the user will be assigned.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Invite a New User + + Sends an invitation to an email address that has not been used yet as a Voucherify user login. You can specify the projects to which the invited user will be assigned and define their roles. + + :param management_projects_users_invite_create_request_body: Defines the details of the invitation, the project, and roles to which the user will be assigned. + :type management_projects_users_invite_create_request_body: ManagementProjectsUsersInviteCreateRequestBody + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._invite_user_serialize( + management_projects_users_invite_create_request_body=management_projects_users_invite_create_request_body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '2XX': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _invite_user_serialize( + self, + management_projects_users_invite_create_request_body, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if management_projects_users_invite_create_request_body is not None: + _body_params = management_projects_users_invite_create_request_body + + + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'X-Management-Token', + 'X-Management-Id' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/management/v1/projects/users/invite', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def list_brands( + self, + project_id: Annotated[StrictStr, Field(description="Provide the unique identifier of the project.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ManagementProjectsBrandingListResponseBody: + """List Brands + + Lists all brand configurations. Because a project can have only one brand, it always returns a list with one item. This endpoint can be used to retrieve the brand configuration created with the Voucherify Dashboard and the ID. + + :param project_id: Provide the unique identifier of the project. (required) + :type project_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_brands_serialize( + project_id=project_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '2XX': "ManagementProjectsBrandingListResponseBody", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def list_brands_with_http_info( + self, + project_id: Annotated[StrictStr, Field(description="Provide the unique identifier of the project.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ManagementProjectsBrandingListResponseBody]: + """List Brands + + Lists all brand configurations. Because a project can have only one brand, it always returns a list with one item. This endpoint can be used to retrieve the brand configuration created with the Voucherify Dashboard and the ID. + + :param project_id: Provide the unique identifier of the project. (required) + :type project_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_brands_serialize( + project_id=project_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '2XX': "ManagementProjectsBrandingListResponseBody", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def list_brands_without_preload_content( + self, + project_id: Annotated[StrictStr, Field(description="Provide the unique identifier of the project.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """List Brands + + Lists all brand configurations. Because a project can have only one brand, it always returns a list with one item. This endpoint can be used to retrieve the brand configuration created with the Voucherify Dashboard and the ID. + + :param project_id: Provide the unique identifier of the project. (required) + :type project_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_brands_serialize( + project_id=project_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '2XX': "ManagementProjectsBrandingListResponseBody", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _list_brands_serialize( + self, + project_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if project_id is not None: + _path_params['projectId'] = project_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'X-Management-Token', + 'X-Management-Id' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/management/v1/projects/{projectId}/branding', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def list_custom_event_schemas( + self, + project_id: Annotated[StrictStr, Field(description="Provide the unique identifier of the project.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ManagementProjectsCustomEventSchemasListResponseBody: + """List Custom Event Schemas + + Lists all custom event schemas available in the project. 📘 Custom Event Documentation Read [Custom Events](https://support.voucherify.io/article/111-custom-events) article to learn how custom events work in Voucherify. Read also the details about the Track Custom Event endpoint and the Custom Event Object. + + :param project_id: Provide the unique identifier of the project. (required) + :type project_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_custom_event_schemas_serialize( + project_id=project_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '2XX': "ManagementProjectsCustomEventSchemasListResponseBody", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def list_custom_event_schemas_with_http_info( + self, + project_id: Annotated[StrictStr, Field(description="Provide the unique identifier of the project.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ManagementProjectsCustomEventSchemasListResponseBody]: + """List Custom Event Schemas + + Lists all custom event schemas available in the project. 📘 Custom Event Documentation Read [Custom Events](https://support.voucherify.io/article/111-custom-events) article to learn how custom events work in Voucherify. Read also the details about the Track Custom Event endpoint and the Custom Event Object. + + :param project_id: Provide the unique identifier of the project. (required) + :type project_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_custom_event_schemas_serialize( + project_id=project_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '2XX': "ManagementProjectsCustomEventSchemasListResponseBody", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def list_custom_event_schemas_without_preload_content( + self, + project_id: Annotated[StrictStr, Field(description="Provide the unique identifier of the project.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """List Custom Event Schemas + + Lists all custom event schemas available in the project. 📘 Custom Event Documentation Read [Custom Events](https://support.voucherify.io/article/111-custom-events) article to learn how custom events work in Voucherify. Read also the details about the Track Custom Event endpoint and the Custom Event Object. + + :param project_id: Provide the unique identifier of the project. (required) + :type project_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_custom_event_schemas_serialize( + project_id=project_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '2XX': "ManagementProjectsCustomEventSchemasListResponseBody", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _list_custom_event_schemas_serialize( + self, + project_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if project_id is not None: + _path_params['projectId'] = project_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'X-Management-Token', + 'X-Management-Id' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/management/v1/projects/{projectId}/custom-event-schemas', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def list_metadata_schemas1( + self, + project_id: Annotated[StrictStr, Field(description="Provide the unique identifier of the project.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ManagementProjectsMetadataSchemasListResponseBody: + """List Metadata Schemas + + Lists all metadata schemas available in the project. 📘 Metadata Documentation Read the Getting Started with Metadata articles to learn how metadata work in Voucherify. + + :param project_id: Provide the unique identifier of the project. (required) + :type project_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_metadata_schemas1_serialize( + project_id=project_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '2XX': "ManagementProjectsMetadataSchemasListResponseBody", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def list_metadata_schemas1_with_http_info( + self, + project_id: Annotated[StrictStr, Field(description="Provide the unique identifier of the project.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ManagementProjectsMetadataSchemasListResponseBody]: + """List Metadata Schemas + + Lists all metadata schemas available in the project. 📘 Metadata Documentation Read the Getting Started with Metadata articles to learn how metadata work in Voucherify. + + :param project_id: Provide the unique identifier of the project. (required) + :type project_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_metadata_schemas1_serialize( + project_id=project_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '2XX': "ManagementProjectsMetadataSchemasListResponseBody", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def list_metadata_schemas1_without_preload_content( + self, + project_id: Annotated[StrictStr, Field(description="Provide the unique identifier of the project.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """List Metadata Schemas + + Lists all metadata schemas available in the project. 📘 Metadata Documentation Read the Getting Started with Metadata articles to learn how metadata work in Voucherify. + + :param project_id: Provide the unique identifier of the project. (required) + :type project_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_metadata_schemas1_serialize( + project_id=project_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '2XX': "ManagementProjectsMetadataSchemasListResponseBody", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _list_metadata_schemas1_serialize( + self, + project_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if project_id is not None: + _path_params['projectId'] = project_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'X-Management-Token', + 'X-Management-Id' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/management/v1/projects/{projectId}/metadata-schemas', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def list_projects( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ManagementProjectsListResponseBody: + """List Projects + + Lists all projects for the organization. The endpoint does not require any query parameters. + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_projects_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '2XX': "ManagementProjectsListResponseBody", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def list_projects_with_http_info( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ManagementProjectsListResponseBody]: + """List Projects + + Lists all projects for the organization. The endpoint does not require any query parameters. + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_projects_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '2XX': "ManagementProjectsListResponseBody", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def list_projects_without_preload_content( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """List Projects + + Lists all projects for the organization. The endpoint does not require any query parameters. + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_projects_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '2XX': "ManagementProjectsListResponseBody", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _list_projects_serialize( + self, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'X-Management-Token', + 'X-Management-Id' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/management/v1/projects', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def list_stacking_rules( + self, + project_id: Annotated[StrictStr, Field(description="Provide the unique identifier of the project.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ManagementProjectsStackingRulesListResponseBody: + """List Stacking Rules + + Lists all stacking rules. Returns always a list with one item. This endpoint can be used to retrieve the default stacking rules. The default stacking rules do not have an ID that could be used with the Get Stacking Rules or Update Stacking Rules endpoints. 📘 Stacking Rules Documentation Read [the Stacking Rules article](https://support.voucherify.io/article/604-stacking-rules) to learn how they work. + + :param project_id: Provide the unique identifier of the project. (required) + :type project_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_stacking_rules_serialize( + project_id=project_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '2XX': "ManagementProjectsStackingRulesListResponseBody", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def list_stacking_rules_with_http_info( + self, + project_id: Annotated[StrictStr, Field(description="Provide the unique identifier of the project.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ManagementProjectsStackingRulesListResponseBody]: + """List Stacking Rules + + Lists all stacking rules. Returns always a list with one item. This endpoint can be used to retrieve the default stacking rules. The default stacking rules do not have an ID that could be used with the Get Stacking Rules or Update Stacking Rules endpoints. 📘 Stacking Rules Documentation Read [the Stacking Rules article](https://support.voucherify.io/article/604-stacking-rules) to learn how they work. + + :param project_id: Provide the unique identifier of the project. (required) + :type project_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_stacking_rules_serialize( + project_id=project_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '2XX': "ManagementProjectsStackingRulesListResponseBody", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def list_stacking_rules_without_preload_content( + self, + project_id: Annotated[StrictStr, Field(description="Provide the unique identifier of the project.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """List Stacking Rules + + Lists all stacking rules. Returns always a list with one item. This endpoint can be used to retrieve the default stacking rules. The default stacking rules do not have an ID that could be used with the Get Stacking Rules or Update Stacking Rules endpoints. 📘 Stacking Rules Documentation Read [the Stacking Rules article](https://support.voucherify.io/article/604-stacking-rules) to learn how they work. + + :param project_id: Provide the unique identifier of the project. (required) + :type project_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_stacking_rules_serialize( + project_id=project_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '2XX': "ManagementProjectsStackingRulesListResponseBody", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _list_stacking_rules_serialize( + self, + project_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if project_id is not None: + _path_params['projectId'] = project_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'X-Management-Token', + 'X-Management-Id' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/management/v1/projects/{projectId}/stacking-rules', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def list_users( + self, + project_id: Annotated[StrictStr, Field(description="Provide the unique identifier of the project.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ManagementProjectsUsersListResponseBody: + """List Users + + Lists all users assigned to the project. + + :param project_id: Provide the unique identifier of the project. (required) + :type project_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_users_serialize( + project_id=project_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '2XX': "ManagementProjectsUsersListResponseBody", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def list_users_with_http_info( + self, + project_id: Annotated[StrictStr, Field(description="Provide the unique identifier of the project.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ManagementProjectsUsersListResponseBody]: + """List Users + + Lists all users assigned to the project. + + :param project_id: Provide the unique identifier of the project. (required) + :type project_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_users_serialize( + project_id=project_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '2XX': "ManagementProjectsUsersListResponseBody", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def list_users_without_preload_content( + self, + project_id: Annotated[StrictStr, Field(description="Provide the unique identifier of the project.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """List Users + + Lists all users assigned to the project. + + :param project_id: Provide the unique identifier of the project. (required) + :type project_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_users_serialize( + project_id=project_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '2XX': "ManagementProjectsUsersListResponseBody", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _list_users_serialize( + self, + project_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if project_id is not None: + _path_params['projectId'] = project_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'X-Management-Token', + 'X-Management-Id' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/management/v1/projects/{projectId}/users', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def list_webhooks( + self, + project_id: Annotated[StrictStr, Field(description="Provide the unique identifier of the project.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ManagementProjectsWebhooksListResponseBody: + """List Webhooks + + Lists all webhook configurations for the project. 📘 Webhook Documentation Read Webhooks v2024-01-1 article to learn how webhooks work in Voucherify. + + :param project_id: Provide the unique identifier of the project. (required) + :type project_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_webhooks_serialize( + project_id=project_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '2XX': "ManagementProjectsWebhooksListResponseBody", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def list_webhooks_with_http_info( + self, + project_id: Annotated[StrictStr, Field(description="Provide the unique identifier of the project.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ManagementProjectsWebhooksListResponseBody]: + """List Webhooks + + Lists all webhook configurations for the project. 📘 Webhook Documentation Read Webhooks v2024-01-1 article to learn how webhooks work in Voucherify. + + :param project_id: Provide the unique identifier of the project. (required) + :type project_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_webhooks_serialize( + project_id=project_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '2XX': "ManagementProjectsWebhooksListResponseBody", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def list_webhooks_without_preload_content( + self, + project_id: Annotated[StrictStr, Field(description="Provide the unique identifier of the project.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """List Webhooks + + Lists all webhook configurations for the project. 📘 Webhook Documentation Read Webhooks v2024-01-1 article to learn how webhooks work in Voucherify. + + :param project_id: Provide the unique identifier of the project. (required) + :type project_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_webhooks_serialize( + project_id=project_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '2XX': "ManagementProjectsWebhooksListResponseBody", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _list_webhooks_serialize( + self, + project_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if project_id is not None: + _path_params['projectId'] = project_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'X-Management-Token', + 'X-Management-Id' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/management/v1/projects/{projectId}/webhooks', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def unassign_user( + self, + project_id: Annotated[StrictStr, Field(description="Provide the unique identifier of the project.")], + user_id: Annotated[StrictStr, Field(description="Provide the unique identifier of the user. Alternatively, provide the users login.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Unassign User + + Unassigns the user from the project. If the user is currently logged in, they are automatically logged out. If the user is assigned to only one project, they cannot be unassigned from that project. + + :param project_id: Provide the unique identifier of the project. (required) + :type project_id: str + :param user_id: Provide the unique identifier of the user. Alternatively, provide the users login. (required) + :type user_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._unassign_user_serialize( + project_id=project_id, + user_id=user_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '2XX': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def unassign_user_with_http_info( + self, + project_id: Annotated[StrictStr, Field(description="Provide the unique identifier of the project.")], + user_id: Annotated[StrictStr, Field(description="Provide the unique identifier of the user. Alternatively, provide the users login.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Unassign User + + Unassigns the user from the project. If the user is currently logged in, they are automatically logged out. If the user is assigned to only one project, they cannot be unassigned from that project. + + :param project_id: Provide the unique identifier of the project. (required) + :type project_id: str + :param user_id: Provide the unique identifier of the user. Alternatively, provide the users login. (required) + :type user_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._unassign_user_serialize( + project_id=project_id, + user_id=user_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '2XX': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def unassign_user_without_preload_content( + self, + project_id: Annotated[StrictStr, Field(description="Provide the unique identifier of the project.")], + user_id: Annotated[StrictStr, Field(description="Provide the unique identifier of the user. Alternatively, provide the users login.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Unassign User + + Unassigns the user from the project. If the user is currently logged in, they are automatically logged out. If the user is assigned to only one project, they cannot be unassigned from that project. + + :param project_id: Provide the unique identifier of the project. (required) + :type project_id: str + :param user_id: Provide the unique identifier of the user. Alternatively, provide the users login. (required) + :type user_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._unassign_user_serialize( + project_id=project_id, + user_id=user_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '2XX': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _unassign_user_serialize( + self, + project_id, + user_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if project_id is not None: + _path_params['projectId'] = project_id + if user_id is not None: + _path_params['userId'] = user_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + + + # authentication setting + _auth_settings: List[str] = [ + 'X-Management-Token', + 'X-Management-Id' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/management/v1/projects/{projectId}/users/{userId}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def update_brand( + self, + project_id: Annotated[StrictStr, Field(description="Provide the unique identifier of the project.")], + branding_id: Annotated[StrictStr, Field(description="Provide the unique identifier of the brand configuration.")], + management_projects_branding_update_request_body: Annotated[Optional[ManagementProjectsBrandingUpdateRequestBody], Field(description="Defines the brand configuration to be updated.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ManagementProjectsBrandingUpdateResponseBody: + """Update Brand + + Updates a brand configuration. Only the fields sent in the request will be updated. The fields omitted in the request will remain unchanged. 📘 White Labelling The white labelling settings which can be found in Project Settings > Brand Details and which are available only for Enterprise clients as a separate service can be configured only in the user interface. + + :param project_id: Provide the unique identifier of the project. (required) + :type project_id: str + :param branding_id: Provide the unique identifier of the brand configuration. (required) + :type branding_id: str + :param management_projects_branding_update_request_body: Defines the brand configuration to be updated. + :type management_projects_branding_update_request_body: ManagementProjectsBrandingUpdateRequestBody + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_brand_serialize( + project_id=project_id, + branding_id=branding_id, + management_projects_branding_update_request_body=management_projects_branding_update_request_body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '2XX': "ManagementProjectsBrandingUpdateResponseBody", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def update_brand_with_http_info( + self, + project_id: Annotated[StrictStr, Field(description="Provide the unique identifier of the project.")], + branding_id: Annotated[StrictStr, Field(description="Provide the unique identifier of the brand configuration.")], + management_projects_branding_update_request_body: Annotated[Optional[ManagementProjectsBrandingUpdateRequestBody], Field(description="Defines the brand configuration to be updated.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ManagementProjectsBrandingUpdateResponseBody]: + """Update Brand + + Updates a brand configuration. Only the fields sent in the request will be updated. The fields omitted in the request will remain unchanged. 📘 White Labelling The white labelling settings which can be found in Project Settings > Brand Details and which are available only for Enterprise clients as a separate service can be configured only in the user interface. + + :param project_id: Provide the unique identifier of the project. (required) + :type project_id: str + :param branding_id: Provide the unique identifier of the brand configuration. (required) + :type branding_id: str + :param management_projects_branding_update_request_body: Defines the brand configuration to be updated. + :type management_projects_branding_update_request_body: ManagementProjectsBrandingUpdateRequestBody + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_brand_serialize( + project_id=project_id, + branding_id=branding_id, + management_projects_branding_update_request_body=management_projects_branding_update_request_body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '2XX': "ManagementProjectsBrandingUpdateResponseBody", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def update_brand_without_preload_content( + self, + project_id: Annotated[StrictStr, Field(description="Provide the unique identifier of the project.")], + branding_id: Annotated[StrictStr, Field(description="Provide the unique identifier of the brand configuration.")], + management_projects_branding_update_request_body: Annotated[Optional[ManagementProjectsBrandingUpdateRequestBody], Field(description="Defines the brand configuration to be updated.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Update Brand + + Updates a brand configuration. Only the fields sent in the request will be updated. The fields omitted in the request will remain unchanged. 📘 White Labelling The white labelling settings which can be found in Project Settings > Brand Details and which are available only for Enterprise clients as a separate service can be configured only in the user interface. + + :param project_id: Provide the unique identifier of the project. (required) + :type project_id: str + :param branding_id: Provide the unique identifier of the brand configuration. (required) + :type branding_id: str + :param management_projects_branding_update_request_body: Defines the brand configuration to be updated. + :type management_projects_branding_update_request_body: ManagementProjectsBrandingUpdateRequestBody + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_brand_serialize( + project_id=project_id, + branding_id=branding_id, + management_projects_branding_update_request_body=management_projects_branding_update_request_body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '2XX': "ManagementProjectsBrandingUpdateResponseBody", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _update_brand_serialize( + self, + project_id, + branding_id, + management_projects_branding_update_request_body, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if project_id is not None: + _path_params['projectId'] = project_id + if branding_id is not None: + _path_params['brandingId'] = branding_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if management_projects_branding_update_request_body is not None: + _body_params = management_projects_branding_update_request_body + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'X-Management-Token', + 'X-Management-Id' + ] + + return self.api_client.param_serialize( + method='PUT', + resource_path='/management/v1/projects/{projectId}/branding/{brandingId}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def update_custom_event_schema( + self, + project_id: Annotated[StrictStr, Field(description="Provide the unique identifier of the project.")], + custom_event_schema_id: Annotated[StrictStr, Field(description="Provide the unique identifier of the custom event schema.")], + management_projects_custom_event_schemas_update_request_body: Annotated[Optional[ManagementProjectsCustomEventSchemasUpdateRequestBody], Field(description="Defines the custom event schema to be updated.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ManagementProjectsCustomEventSchemasUpdateResponseBody: + """Update Custom Event Schema + + Updates a custom event schema. With this request, you can: - Add a non-existing property to a custom event schema. - Update an existing property. In the request, you can provide only those properties you want to add or update. Definitions omitted in the request remain unchanged. 👍 Additional Notes - You can change the type of an existing property, e.g. from string to number. - You can remove a custom property with this endpoint by providing deleted: true in the request. However, you cannot permanently remove an event definition or its property with this endpoint. 📘 Custom Event Documentation Read [Custom Events](https://support.voucherify.io/article/111-custom-events) article to learn how custom events work in Voucherify. Read also the details about the Track Custom Event endpoint and the Custom Event Object. + + :param project_id: Provide the unique identifier of the project. (required) + :type project_id: str + :param custom_event_schema_id: Provide the unique identifier of the custom event schema. (required) + :type custom_event_schema_id: str + :param management_projects_custom_event_schemas_update_request_body: Defines the custom event schema to be updated. + :type management_projects_custom_event_schemas_update_request_body: ManagementProjectsCustomEventSchemasUpdateRequestBody + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_custom_event_schema_serialize( + project_id=project_id, + custom_event_schema_id=custom_event_schema_id, + management_projects_custom_event_schemas_update_request_body=management_projects_custom_event_schemas_update_request_body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '2XX': "ManagementProjectsCustomEventSchemasUpdateResponseBody", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def update_custom_event_schema_with_http_info( + self, + project_id: Annotated[StrictStr, Field(description="Provide the unique identifier of the project.")], + custom_event_schema_id: Annotated[StrictStr, Field(description="Provide the unique identifier of the custom event schema.")], + management_projects_custom_event_schemas_update_request_body: Annotated[Optional[ManagementProjectsCustomEventSchemasUpdateRequestBody], Field(description="Defines the custom event schema to be updated.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ManagementProjectsCustomEventSchemasUpdateResponseBody]: + """Update Custom Event Schema + + Updates a custom event schema. With this request, you can: - Add a non-existing property to a custom event schema. - Update an existing property. In the request, you can provide only those properties you want to add or update. Definitions omitted in the request remain unchanged. 👍 Additional Notes - You can change the type of an existing property, e.g. from string to number. - You can remove a custom property with this endpoint by providing deleted: true in the request. However, you cannot permanently remove an event definition or its property with this endpoint. 📘 Custom Event Documentation Read [Custom Events](https://support.voucherify.io/article/111-custom-events) article to learn how custom events work in Voucherify. Read also the details about the Track Custom Event endpoint and the Custom Event Object. + + :param project_id: Provide the unique identifier of the project. (required) + :type project_id: str + :param custom_event_schema_id: Provide the unique identifier of the custom event schema. (required) + :type custom_event_schema_id: str + :param management_projects_custom_event_schemas_update_request_body: Defines the custom event schema to be updated. + :type management_projects_custom_event_schemas_update_request_body: ManagementProjectsCustomEventSchemasUpdateRequestBody + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_custom_event_schema_serialize( + project_id=project_id, + custom_event_schema_id=custom_event_schema_id, + management_projects_custom_event_schemas_update_request_body=management_projects_custom_event_schemas_update_request_body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '2XX': "ManagementProjectsCustomEventSchemasUpdateResponseBody", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def update_custom_event_schema_without_preload_content( + self, + project_id: Annotated[StrictStr, Field(description="Provide the unique identifier of the project.")], + custom_event_schema_id: Annotated[StrictStr, Field(description="Provide the unique identifier of the custom event schema.")], + management_projects_custom_event_schemas_update_request_body: Annotated[Optional[ManagementProjectsCustomEventSchemasUpdateRequestBody], Field(description="Defines the custom event schema to be updated.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Update Custom Event Schema + + Updates a custom event schema. With this request, you can: - Add a non-existing property to a custom event schema. - Update an existing property. In the request, you can provide only those properties you want to add or update. Definitions omitted in the request remain unchanged. 👍 Additional Notes - You can change the type of an existing property, e.g. from string to number. - You can remove a custom property with this endpoint by providing deleted: true in the request. However, you cannot permanently remove an event definition or its property with this endpoint. 📘 Custom Event Documentation Read [Custom Events](https://support.voucherify.io/article/111-custom-events) article to learn how custom events work in Voucherify. Read also the details about the Track Custom Event endpoint and the Custom Event Object. + + :param project_id: Provide the unique identifier of the project. (required) + :type project_id: str + :param custom_event_schema_id: Provide the unique identifier of the custom event schema. (required) + :type custom_event_schema_id: str + :param management_projects_custom_event_schemas_update_request_body: Defines the custom event schema to be updated. + :type management_projects_custom_event_schemas_update_request_body: ManagementProjectsCustomEventSchemasUpdateRequestBody + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_custom_event_schema_serialize( + project_id=project_id, + custom_event_schema_id=custom_event_schema_id, + management_projects_custom_event_schemas_update_request_body=management_projects_custom_event_schemas_update_request_body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '2XX': "ManagementProjectsCustomEventSchemasUpdateResponseBody", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _update_custom_event_schema_serialize( + self, + project_id, + custom_event_schema_id, + management_projects_custom_event_schemas_update_request_body, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if project_id is not None: + _path_params['projectId'] = project_id + if custom_event_schema_id is not None: + _path_params['customEventSchemaId'] = custom_event_schema_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if management_projects_custom_event_schemas_update_request_body is not None: + _body_params = management_projects_custom_event_schemas_update_request_body + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'X-Management-Token', + 'X-Management-Id' + ] + + return self.api_client.param_serialize( + method='PUT', + resource_path='/management/v1/projects/{projectId}/custom-event-schemas/{customEventSchemaId}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def update_metadata_schema( + self, + project_id: Annotated[StrictStr, Field(description="Provide the unique identifier of the project.")], + metadata_schema_id: Annotated[StrictStr, Field(description="Provide the unique identifier of the metadata schema.")], + management_projects_metadata_schemas_update_request_body: Annotated[Optional[ManagementProjectsMetadataSchemasUpdateRequestBody], Field(description="Defines the metadata schema to be updated.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ManagementProjectsMetadataSchemasUpdateResponseBody: + """Update Metadata Schema + + Updates a metadata schema. With this request, you can: - Add a non-existing attribute definition to the metadata schema. - Update an existing attribute definition by overwriting its current values. In the request, you can provide only those definitions you want to add or update. Definitions omitted in the request remain unchanged. However, if you want to update a definition, you will have to add all its current key-value pairs as well. Only the pairs sent in the request are saved for this definition. This means that the key-value pairs that are not sent in a request are restored to default values. For example, if your definition has an array with values and it is not sent in an update request, the array values will be deleted. 👍 Additional Notes - You cannot change the type of an existing schema, e.g. from string to number. - You can remove a definition with this endpoint by providing deleted: true in the request. It will be moved to the Removed definitions section in the user interface. However, you cannot permanently remove a definition with this endpoint. 📘 Metadata Documentation Read the Getting Started with Metadata articles to learn how metadata work in Voucherify. + + :param project_id: Provide the unique identifier of the project. (required) + :type project_id: str + :param metadata_schema_id: Provide the unique identifier of the metadata schema. (required) + :type metadata_schema_id: str + :param management_projects_metadata_schemas_update_request_body: Defines the metadata schema to be updated. + :type management_projects_metadata_schemas_update_request_body: ManagementProjectsMetadataSchemasUpdateRequestBody + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_metadata_schema_serialize( + project_id=project_id, + metadata_schema_id=metadata_schema_id, + management_projects_metadata_schemas_update_request_body=management_projects_metadata_schemas_update_request_body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '2XX': "ManagementProjectsMetadataSchemasUpdateResponseBody", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def update_metadata_schema_with_http_info( + self, + project_id: Annotated[StrictStr, Field(description="Provide the unique identifier of the project.")], + metadata_schema_id: Annotated[StrictStr, Field(description="Provide the unique identifier of the metadata schema.")], + management_projects_metadata_schemas_update_request_body: Annotated[Optional[ManagementProjectsMetadataSchemasUpdateRequestBody], Field(description="Defines the metadata schema to be updated.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ManagementProjectsMetadataSchemasUpdateResponseBody]: + """Update Metadata Schema + + Updates a metadata schema. With this request, you can: - Add a non-existing attribute definition to the metadata schema. - Update an existing attribute definition by overwriting its current values. In the request, you can provide only those definitions you want to add or update. Definitions omitted in the request remain unchanged. However, if you want to update a definition, you will have to add all its current key-value pairs as well. Only the pairs sent in the request are saved for this definition. This means that the key-value pairs that are not sent in a request are restored to default values. For example, if your definition has an array with values and it is not sent in an update request, the array values will be deleted. 👍 Additional Notes - You cannot change the type of an existing schema, e.g. from string to number. - You can remove a definition with this endpoint by providing deleted: true in the request. It will be moved to the Removed definitions section in the user interface. However, you cannot permanently remove a definition with this endpoint. 📘 Metadata Documentation Read the Getting Started with Metadata articles to learn how metadata work in Voucherify. + + :param project_id: Provide the unique identifier of the project. (required) + :type project_id: str + :param metadata_schema_id: Provide the unique identifier of the metadata schema. (required) + :type metadata_schema_id: str + :param management_projects_metadata_schemas_update_request_body: Defines the metadata schema to be updated. + :type management_projects_metadata_schemas_update_request_body: ManagementProjectsMetadataSchemasUpdateRequestBody + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_metadata_schema_serialize( + project_id=project_id, + metadata_schema_id=metadata_schema_id, + management_projects_metadata_schemas_update_request_body=management_projects_metadata_schemas_update_request_body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '2XX': "ManagementProjectsMetadataSchemasUpdateResponseBody", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def update_metadata_schema_without_preload_content( + self, + project_id: Annotated[StrictStr, Field(description="Provide the unique identifier of the project.")], + metadata_schema_id: Annotated[StrictStr, Field(description="Provide the unique identifier of the metadata schema.")], + management_projects_metadata_schemas_update_request_body: Annotated[Optional[ManagementProjectsMetadataSchemasUpdateRequestBody], Field(description="Defines the metadata schema to be updated.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Update Metadata Schema + + Updates a metadata schema. With this request, you can: - Add a non-existing attribute definition to the metadata schema. - Update an existing attribute definition by overwriting its current values. In the request, you can provide only those definitions you want to add or update. Definitions omitted in the request remain unchanged. However, if you want to update a definition, you will have to add all its current key-value pairs as well. Only the pairs sent in the request are saved for this definition. This means that the key-value pairs that are not sent in a request are restored to default values. For example, if your definition has an array with values and it is not sent in an update request, the array values will be deleted. 👍 Additional Notes - You cannot change the type of an existing schema, e.g. from string to number. - You can remove a definition with this endpoint by providing deleted: true in the request. It will be moved to the Removed definitions section in the user interface. However, you cannot permanently remove a definition with this endpoint. 📘 Metadata Documentation Read the Getting Started with Metadata articles to learn how metadata work in Voucherify. + + :param project_id: Provide the unique identifier of the project. (required) + :type project_id: str + :param metadata_schema_id: Provide the unique identifier of the metadata schema. (required) + :type metadata_schema_id: str + :param management_projects_metadata_schemas_update_request_body: Defines the metadata schema to be updated. + :type management_projects_metadata_schemas_update_request_body: ManagementProjectsMetadataSchemasUpdateRequestBody + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_metadata_schema_serialize( + project_id=project_id, + metadata_schema_id=metadata_schema_id, + management_projects_metadata_schemas_update_request_body=management_projects_metadata_schemas_update_request_body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '2XX': "ManagementProjectsMetadataSchemasUpdateResponseBody", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _update_metadata_schema_serialize( + self, + project_id, + metadata_schema_id, + management_projects_metadata_schemas_update_request_body, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if project_id is not None: + _path_params['projectId'] = project_id + if metadata_schema_id is not None: + _path_params['metadataSchemaId'] = metadata_schema_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if management_projects_metadata_schemas_update_request_body is not None: + _body_params = management_projects_metadata_schemas_update_request_body + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'X-Management-Token', + 'X-Management-Id' + ] + + return self.api_client.param_serialize( + method='PUT', + resource_path='/management/v1/projects/{projectId}/metadata-schemas/{metadataSchemaId}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def update_project( + self, + project_id: Annotated[StrictStr, Field(description="Provide the unique identifier of the project.")], + management_projects_update_request_body: Annotated[Optional[ManagementProjectsUpdateRequestBody], Field(description="Define the project details to be updated.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ManagementProjectsUpdateResponseBody: + """Update Project + + Updates an existing project. You can add or modify settings for timezone, currency, notifications, and other details. Only the fields sent in the request will be updated. + + :param project_id: Provide the unique identifier of the project. (required) + :type project_id: str + :param management_projects_update_request_body: Define the project details to be updated. + :type management_projects_update_request_body: ManagementProjectsUpdateRequestBody + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_project_serialize( + project_id=project_id, + management_projects_update_request_body=management_projects_update_request_body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '2XX': "ManagementProjectsUpdateResponseBody", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def update_project_with_http_info( + self, + project_id: Annotated[StrictStr, Field(description="Provide the unique identifier of the project.")], + management_projects_update_request_body: Annotated[Optional[ManagementProjectsUpdateRequestBody], Field(description="Define the project details to be updated.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ManagementProjectsUpdateResponseBody]: + """Update Project + + Updates an existing project. You can add or modify settings for timezone, currency, notifications, and other details. Only the fields sent in the request will be updated. + + :param project_id: Provide the unique identifier of the project. (required) + :type project_id: str + :param management_projects_update_request_body: Define the project details to be updated. + :type management_projects_update_request_body: ManagementProjectsUpdateRequestBody + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_project_serialize( + project_id=project_id, + management_projects_update_request_body=management_projects_update_request_body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '2XX': "ManagementProjectsUpdateResponseBody", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def update_project_without_preload_content( + self, + project_id: Annotated[StrictStr, Field(description="Provide the unique identifier of the project.")], + management_projects_update_request_body: Annotated[Optional[ManagementProjectsUpdateRequestBody], Field(description="Define the project details to be updated.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Update Project + + Updates an existing project. You can add or modify settings for timezone, currency, notifications, and other details. Only the fields sent in the request will be updated. + + :param project_id: Provide the unique identifier of the project. (required) + :type project_id: str + :param management_projects_update_request_body: Define the project details to be updated. + :type management_projects_update_request_body: ManagementProjectsUpdateRequestBody + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_project_serialize( + project_id=project_id, + management_projects_update_request_body=management_projects_update_request_body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '2XX': "ManagementProjectsUpdateResponseBody", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _update_project_serialize( + self, + project_id, + management_projects_update_request_body, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if project_id is not None: + _path_params['projectId'] = project_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if management_projects_update_request_body is not None: + _body_params = management_projects_update_request_body + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'X-Management-Token', + 'X-Management-Id' + ] + + return self.api_client.param_serialize( + method='PUT', + resource_path='/management/v1/projects/{projectId}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def update_stacking_rules( + self, + project_id: Annotated[StrictStr, Field(description="Provide the unique identifier of the project.")], + stacking_rules_id: Annotated[StrictStr, Field(description="Provide the unique identifier of the stacking rules.")], + management_projects_stacking_rules_update_request_body: Annotated[Optional[ManagementProjectsStackingRulesUpdateRequestBody], Field(description="Defines the stacking rules to be updated.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ManagementProjectsStackingRulesUpdateResponseBody: + """Update Stacking Rules + + Updates the stacking rules. Only the provided fields will be updated. However, if you update an array, the content of the array is overwritten. This means that if you want to add new values to an array and retain existing ones, you need to provide both the existing and new values in the request. 📘 Stacking Rules Documentation Read [the Stacking Rules article](https://support.voucherify.io/article/604-stacking-rules) to learn how they work. + + :param project_id: Provide the unique identifier of the project. (required) + :type project_id: str + :param stacking_rules_id: Provide the unique identifier of the stacking rules. (required) + :type stacking_rules_id: str + :param management_projects_stacking_rules_update_request_body: Defines the stacking rules to be updated. + :type management_projects_stacking_rules_update_request_body: ManagementProjectsStackingRulesUpdateRequestBody + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_stacking_rules_serialize( + project_id=project_id, + stacking_rules_id=stacking_rules_id, + management_projects_stacking_rules_update_request_body=management_projects_stacking_rules_update_request_body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '2XX': "ManagementProjectsStackingRulesUpdateResponseBody", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def update_stacking_rules_with_http_info( + self, + project_id: Annotated[StrictStr, Field(description="Provide the unique identifier of the project.")], + stacking_rules_id: Annotated[StrictStr, Field(description="Provide the unique identifier of the stacking rules.")], + management_projects_stacking_rules_update_request_body: Annotated[Optional[ManagementProjectsStackingRulesUpdateRequestBody], Field(description="Defines the stacking rules to be updated.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ManagementProjectsStackingRulesUpdateResponseBody]: + """Update Stacking Rules + + Updates the stacking rules. Only the provided fields will be updated. However, if you update an array, the content of the array is overwritten. This means that if you want to add new values to an array and retain existing ones, you need to provide both the existing and new values in the request. 📘 Stacking Rules Documentation Read [the Stacking Rules article](https://support.voucherify.io/article/604-stacking-rules) to learn how they work. + + :param project_id: Provide the unique identifier of the project. (required) + :type project_id: str + :param stacking_rules_id: Provide the unique identifier of the stacking rules. (required) + :type stacking_rules_id: str + :param management_projects_stacking_rules_update_request_body: Defines the stacking rules to be updated. + :type management_projects_stacking_rules_update_request_body: ManagementProjectsStackingRulesUpdateRequestBody + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_stacking_rules_serialize( + project_id=project_id, + stacking_rules_id=stacking_rules_id, + management_projects_stacking_rules_update_request_body=management_projects_stacking_rules_update_request_body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '2XX': "ManagementProjectsStackingRulesUpdateResponseBody", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def update_stacking_rules_without_preload_content( + self, + project_id: Annotated[StrictStr, Field(description="Provide the unique identifier of the project.")], + stacking_rules_id: Annotated[StrictStr, Field(description="Provide the unique identifier of the stacking rules.")], + management_projects_stacking_rules_update_request_body: Annotated[Optional[ManagementProjectsStackingRulesUpdateRequestBody], Field(description="Defines the stacking rules to be updated.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Update Stacking Rules + + Updates the stacking rules. Only the provided fields will be updated. However, if you update an array, the content of the array is overwritten. This means that if you want to add new values to an array and retain existing ones, you need to provide both the existing and new values in the request. 📘 Stacking Rules Documentation Read [the Stacking Rules article](https://support.voucherify.io/article/604-stacking-rules) to learn how they work. + + :param project_id: Provide the unique identifier of the project. (required) + :type project_id: str + :param stacking_rules_id: Provide the unique identifier of the stacking rules. (required) + :type stacking_rules_id: str + :param management_projects_stacking_rules_update_request_body: Defines the stacking rules to be updated. + :type management_projects_stacking_rules_update_request_body: ManagementProjectsStackingRulesUpdateRequestBody + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_stacking_rules_serialize( + project_id=project_id, + stacking_rules_id=stacking_rules_id, + management_projects_stacking_rules_update_request_body=management_projects_stacking_rules_update_request_body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '2XX': "ManagementProjectsStackingRulesUpdateResponseBody", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _update_stacking_rules_serialize( + self, + project_id, + stacking_rules_id, + management_projects_stacking_rules_update_request_body, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if project_id is not None: + _path_params['projectId'] = project_id + if stacking_rules_id is not None: + _path_params['stackingRulesId'] = stacking_rules_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if management_projects_stacking_rules_update_request_body is not None: + _body_params = management_projects_stacking_rules_update_request_body + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'X-Management-Token', + 'X-Management-Id' + ] + + return self.api_client.param_serialize( + method='PUT', + resource_path='/management/v1/projects/{projectId}/stacking-rules/{stackingRulesId}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def update_user( + self, + project_id: Annotated[StrictStr, Field(description="Provide the unique identifier of the project.")], + user_id: Annotated[StrictStr, Field(description="Provide the unique identifier of the user. Alternatively, provide the users login.")], + management_projects_users_update_role_request_body: Annotated[Optional[ManagementProjectsUsersUpdateRoleRequestBody], Field(description="Defines the users new role.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ManagementProjectsUsersUpdateRoleResponseBody: + """Update User + + Updates the users role. + + :param project_id: Provide the unique identifier of the project. (required) + :type project_id: str + :param user_id: Provide the unique identifier of the user. Alternatively, provide the users login. (required) + :type user_id: str + :param management_projects_users_update_role_request_body: Defines the users new role. + :type management_projects_users_update_role_request_body: ManagementProjectsUsersUpdateRoleRequestBody + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_user_serialize( + project_id=project_id, + user_id=user_id, + management_projects_users_update_role_request_body=management_projects_users_update_role_request_body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '2XX': "ManagementProjectsUsersUpdateRoleResponseBody", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def update_user_with_http_info( + self, + project_id: Annotated[StrictStr, Field(description="Provide the unique identifier of the project.")], + user_id: Annotated[StrictStr, Field(description="Provide the unique identifier of the user. Alternatively, provide the users login.")], + management_projects_users_update_role_request_body: Annotated[Optional[ManagementProjectsUsersUpdateRoleRequestBody], Field(description="Defines the users new role.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ManagementProjectsUsersUpdateRoleResponseBody]: + """Update User + + Updates the users role. + + :param project_id: Provide the unique identifier of the project. (required) + :type project_id: str + :param user_id: Provide the unique identifier of the user. Alternatively, provide the users login. (required) + :type user_id: str + :param management_projects_users_update_role_request_body: Defines the users new role. + :type management_projects_users_update_role_request_body: ManagementProjectsUsersUpdateRoleRequestBody + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_user_serialize( + project_id=project_id, + user_id=user_id, + management_projects_users_update_role_request_body=management_projects_users_update_role_request_body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '2XX': "ManagementProjectsUsersUpdateRoleResponseBody", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def update_user_without_preload_content( + self, + project_id: Annotated[StrictStr, Field(description="Provide the unique identifier of the project.")], + user_id: Annotated[StrictStr, Field(description="Provide the unique identifier of the user. Alternatively, provide the users login.")], + management_projects_users_update_role_request_body: Annotated[Optional[ManagementProjectsUsersUpdateRoleRequestBody], Field(description="Defines the users new role.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Update User + + Updates the users role. + + :param project_id: Provide the unique identifier of the project. (required) + :type project_id: str + :param user_id: Provide the unique identifier of the user. Alternatively, provide the users login. (required) + :type user_id: str + :param management_projects_users_update_role_request_body: Defines the users new role. + :type management_projects_users_update_role_request_body: ManagementProjectsUsersUpdateRoleRequestBody + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_user_serialize( + project_id=project_id, + user_id=user_id, + management_projects_users_update_role_request_body=management_projects_users_update_role_request_body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '2XX': "ManagementProjectsUsersUpdateRoleResponseBody", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _update_user_serialize( + self, + project_id, + user_id, + management_projects_users_update_role_request_body, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if project_id is not None: + _path_params['projectId'] = project_id + if user_id is not None: + _path_params['userId'] = user_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if management_projects_users_update_role_request_body is not None: + _body_params = management_projects_users_update_role_request_body + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'X-Management-Token', + 'X-Management-Id' + ] + + return self.api_client.param_serialize( + method='PUT', + resource_path='/management/v1/projects/{projectId}/users/{userId}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def update_webhook( + self, + project_id: Annotated[StrictStr, Field(description="Provide the unique identifier of the project.")], + webhook_id: Annotated[StrictStr, Field(description="Provide the unique identifier of the webhook configuration.")], + management_projects_webhooks_update_request_body: Annotated[Optional[ManagementProjectsWebhooksUpdateRequestBody], Field(description="Defines the webhook configuration to be updated.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ManagementProjectsWebhooksUpdateResponseBody: + """Update Webhook + + Updates a webhook configuration. The events listed in the request are overwritten. If you want to add more events, provide also the events that are already in the webhook configuration. 📘 Webhook Documentation Read Webhooks v2024-01-1 article to learn how webhooks work in Voucherify. + + :param project_id: Provide the unique identifier of the project. (required) + :type project_id: str + :param webhook_id: Provide the unique identifier of the webhook configuration. (required) + :type webhook_id: str + :param management_projects_webhooks_update_request_body: Defines the webhook configuration to be updated. + :type management_projects_webhooks_update_request_body: ManagementProjectsWebhooksUpdateRequestBody + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_webhook_serialize( + project_id=project_id, + webhook_id=webhook_id, + management_projects_webhooks_update_request_body=management_projects_webhooks_update_request_body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '2XX': "ManagementProjectsWebhooksUpdateResponseBody", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def update_webhook_with_http_info( + self, + project_id: Annotated[StrictStr, Field(description="Provide the unique identifier of the project.")], + webhook_id: Annotated[StrictStr, Field(description="Provide the unique identifier of the webhook configuration.")], + management_projects_webhooks_update_request_body: Annotated[Optional[ManagementProjectsWebhooksUpdateRequestBody], Field(description="Defines the webhook configuration to be updated.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ManagementProjectsWebhooksUpdateResponseBody]: + """Update Webhook + + Updates a webhook configuration. The events listed in the request are overwritten. If you want to add more events, provide also the events that are already in the webhook configuration. 📘 Webhook Documentation Read Webhooks v2024-01-1 article to learn how webhooks work in Voucherify. + + :param project_id: Provide the unique identifier of the project. (required) + :type project_id: str + :param webhook_id: Provide the unique identifier of the webhook configuration. (required) + :type webhook_id: str + :param management_projects_webhooks_update_request_body: Defines the webhook configuration to be updated. + :type management_projects_webhooks_update_request_body: ManagementProjectsWebhooksUpdateRequestBody + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_webhook_serialize( + project_id=project_id, + webhook_id=webhook_id, + management_projects_webhooks_update_request_body=management_projects_webhooks_update_request_body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '2XX': "ManagementProjectsWebhooksUpdateResponseBody", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def update_webhook_without_preload_content( + self, + project_id: Annotated[StrictStr, Field(description="Provide the unique identifier of the project.")], + webhook_id: Annotated[StrictStr, Field(description="Provide the unique identifier of the webhook configuration.")], + management_projects_webhooks_update_request_body: Annotated[Optional[ManagementProjectsWebhooksUpdateRequestBody], Field(description="Defines the webhook configuration to be updated.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Update Webhook + + Updates a webhook configuration. The events listed in the request are overwritten. If you want to add more events, provide also the events that are already in the webhook configuration. 📘 Webhook Documentation Read Webhooks v2024-01-1 article to learn how webhooks work in Voucherify. + + :param project_id: Provide the unique identifier of the project. (required) + :type project_id: str + :param webhook_id: Provide the unique identifier of the webhook configuration. (required) + :type webhook_id: str + :param management_projects_webhooks_update_request_body: Defines the webhook configuration to be updated. + :type management_projects_webhooks_update_request_body: ManagementProjectsWebhooksUpdateRequestBody + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_webhook_serialize( + project_id=project_id, + webhook_id=webhook_id, + management_projects_webhooks_update_request_body=management_projects_webhooks_update_request_body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '2XX': "ManagementProjectsWebhooksUpdateResponseBody", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _update_webhook_serialize( + self, + project_id, + webhook_id, + management_projects_webhooks_update_request_body, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if project_id is not None: + _path_params['projectId'] = project_id + if webhook_id is not None: + _path_params['webhookId'] = webhook_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if management_projects_webhooks_update_request_body is not None: + _body_params = management_projects_webhooks_update_request_body + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'X-Management-Token', + 'X-Management-Id' + ] + + return self.api_client.param_serialize( + method='PUT', + resource_path='/management/v1/projects/{projectId}/webhooks/{webhookId}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/voucherify/api/publications_api.py b/voucherify/api/publications_api.py index 4f807db4..41e922b8 100644 --- a/voucherify/api/publications_api.py +++ b/voucherify/api/publications_api.py @@ -22,6 +22,7 @@ from typing_extensions import Annotated from voucherify.models.create_publication_campaign import CreatePublicationCampaign from voucherify.models.customer import Customer +from voucherify.models.parameter_filters_list_publications import ParameterFiltersListPublications from voucherify.models.parameter_order_list_publications import ParameterOrderListPublications from voucherify.models.parameter_result_list_publications import ParameterResultListPublications from voucherify.models.parameter_voucher_type_list_publications import ParameterVoucherTypeListPublications @@ -696,7 +697,7 @@ def list_publications( result: Annotated[Optional[ParameterResultListPublications], Field(description="Filters by a publication result.")] = None, voucher_type: Annotated[Optional[ParameterVoucherTypeListPublications], Field(description="Filters by a voucher type.")] = None, is_referral_code: Annotated[Optional[StrictBool], Field(description="This filter works only for the true option. If set to true, the query returns only publications of codes from referral campaigns. ")] = None, - filters: Annotated[Optional[StrictStr], Field(description="Allows for combining the filters mentioned in the endpoint description.")] = None, + filters: Annotated[Optional[ParameterFiltersListPublications], Field(description="Filters for listing publications.")] = None, source_id: Annotated[Optional[StrictStr], Field(description="Using this endpoint with a particular publication source_id, which was sent with the original request to create a publication, returns in the response, exactly the same code published initially because the code was assigned to the given publication. As a result, you can use this endpoint as a reference and return a code that was assigned in a publication by using a particular source_id.")] = None, _request_timeout: Union[ None, @@ -733,8 +734,8 @@ def list_publications( :type voucher_type: ParameterVoucherTypeListPublications :param is_referral_code: This filter works only for the true option. If set to true, the query returns only publications of codes from referral campaigns. :type is_referral_code: bool - :param filters: Allows for combining the filters mentioned in the endpoint description. - :type filters: str + :param filters: Filters for listing publications. + :type filters: ParameterFiltersListPublications :param source_id: Using this endpoint with a particular publication source_id, which was sent with the original request to create a publication, returns in the response, exactly the same code published initially because the code was assigned to the given publication. As a result, you can use this endpoint as a reference and return a code that was assigned in a publication by using a particular source_id. :type source_id: str :param _request_timeout: timeout setting for this request. If one @@ -803,7 +804,7 @@ def list_publications_with_http_info( result: Annotated[Optional[ParameterResultListPublications], Field(description="Filters by a publication result.")] = None, voucher_type: Annotated[Optional[ParameterVoucherTypeListPublications], Field(description="Filters by a voucher type.")] = None, is_referral_code: Annotated[Optional[StrictBool], Field(description="This filter works only for the true option. If set to true, the query returns only publications of codes from referral campaigns. ")] = None, - filters: Annotated[Optional[StrictStr], Field(description="Allows for combining the filters mentioned in the endpoint description.")] = None, + filters: Annotated[Optional[ParameterFiltersListPublications], Field(description="Filters for listing publications.")] = None, source_id: Annotated[Optional[StrictStr], Field(description="Using this endpoint with a particular publication source_id, which was sent with the original request to create a publication, returns in the response, exactly the same code published initially because the code was assigned to the given publication. As a result, you can use this endpoint as a reference and return a code that was assigned in a publication by using a particular source_id.")] = None, _request_timeout: Union[ None, @@ -840,8 +841,8 @@ def list_publications_with_http_info( :type voucher_type: ParameterVoucherTypeListPublications :param is_referral_code: This filter works only for the true option. If set to true, the query returns only publications of codes from referral campaigns. :type is_referral_code: bool - :param filters: Allows for combining the filters mentioned in the endpoint description. - :type filters: str + :param filters: Filters for listing publications. + :type filters: ParameterFiltersListPublications :param source_id: Using this endpoint with a particular publication source_id, which was sent with the original request to create a publication, returns in the response, exactly the same code published initially because the code was assigned to the given publication. As a result, you can use this endpoint as a reference and return a code that was assigned in a publication by using a particular source_id. :type source_id: str :param _request_timeout: timeout setting for this request. If one @@ -910,7 +911,7 @@ def list_publications_without_preload_content( result: Annotated[Optional[ParameterResultListPublications], Field(description="Filters by a publication result.")] = None, voucher_type: Annotated[Optional[ParameterVoucherTypeListPublications], Field(description="Filters by a voucher type.")] = None, is_referral_code: Annotated[Optional[StrictBool], Field(description="This filter works only for the true option. If set to true, the query returns only publications of codes from referral campaigns. ")] = None, - filters: Annotated[Optional[StrictStr], Field(description="Allows for combining the filters mentioned in the endpoint description.")] = None, + filters: Annotated[Optional[ParameterFiltersListPublications], Field(description="Filters for listing publications.")] = None, source_id: Annotated[Optional[StrictStr], Field(description="Using this endpoint with a particular publication source_id, which was sent with the original request to create a publication, returns in the response, exactly the same code published initially because the code was assigned to the given publication. As a result, you can use this endpoint as a reference and return a code that was assigned in a publication by using a particular source_id.")] = None, _request_timeout: Union[ None, @@ -947,8 +948,8 @@ def list_publications_without_preload_content( :type voucher_type: ParameterVoucherTypeListPublications :param is_referral_code: This filter works only for the true option. If set to true, the query returns only publications of codes from referral campaigns. :type is_referral_code: bool - :param filters: Allows for combining the filters mentioned in the endpoint description. - :type filters: str + :param filters: Filters for listing publications. + :type filters: ParameterFiltersListPublications :param source_id: Using this endpoint with a particular publication source_id, which was sent with the original request to create a publication, returns in the response, exactly the same code published initially because the code was assigned to the given publication. As a result, you can use this endpoint as a reference and return a code that was assigned in a publication by using a particular source_id. :type source_id: str :param _request_timeout: timeout setting for this request. If one diff --git a/voucherify/api_client.py b/voucherify/api_client.py index b45a02b1..7f76e23c 100644 --- a/voucherify/api_client.py +++ b/voucherify/api_client.py @@ -88,13 +88,13 @@ def __init__( self.rest_client = rest.RESTClientObject(configuration) self.default_headers = { "X-Voucherify-Channel": "Python-SDK", - "User-Agent": "OpenAPI-Python-SDK/3.0.0" + "User-Agent": "OpenAPI-Python-SDK/4.0.0" } if header_name is not None: self.default_headers[header_name] = header_value self.cookie = cookie # Set default User-Agent. - self.user_agent = 'OpenAPI-Python-SDK/3.0.0' + self.user_agent = 'OpenAPI-Python-SDK/4.0.0' self.client_side_validation = configuration.client_side_validation def __enter__(self): @@ -501,41 +501,25 @@ def parameters_to_tuples(self, params, collection_formats): return new_params def parameters_to_url_query(self, params, collection_formats): - """Get parameters as list of tuples, formatting collections. - - :param params: Parameters as dict or list of two-tuples - :param dict collection_formats: Parameter collection formats - :return: URL query string (e.g. a=Hello%20World&b=123) - """ new_params: List[Tuple[str, str]] = [] + if collection_formats is None: collection_formats = {} - for k, v in params.items() if isinstance(params, dict) else params: - if isinstance(v, bool): - v = str(v).lower() - if isinstance(v, (int, float)): - v = str(v) - if isinstance(v, dict): - v = json.dumps(v) - if k in collection_formats: - collection_format = collection_formats[k] - if collection_format == 'multi': - new_params.extend((k, str(value)) for value in v) - else: - if collection_format == 'ssv': - delimiter = ' ' - elif collection_format == 'tsv': - delimiter = '\t' - elif collection_format == 'pipes': - delimiter = '|' - else: # csv is the default - delimiter = ',' - new_params.append( - (k, delimiter.join(quote(str(value)) for value in v)) - ) + def flatten_key_value(prefix, value): + if isinstance(value, bool): + value = str(value).lower() + if isinstance(value, (int, float)): + value = str(value) + + if isinstance(value, dict): + for k, v in value.items(): + flatten_key_value(f"{prefix}[{k}]", v) else: - new_params.append((k, quote(str(v)))) + new_params.append((prefix, quote(str(value)))) + + for k, v in params.items() if isinstance(params, dict) else params: + flatten_key_value(k, v) return "&".join(["=".join(map(str, item)) for item in new_params]) diff --git a/voucherify/configuration.py b/voucherify/configuration.py index 953a30d7..c276fb34 100644 --- a/voucherify/configuration.py +++ b/voucherify/configuration.py @@ -430,6 +430,24 @@ def auth_settings(self): 'X-Client-Application-Id', ), } + if 'X-Management-Id' in self.api_key: + auth['X-Management-Id'] = { + 'type': 'api_key', + 'in': 'header', + 'key': 'X-Management-Id', + 'value': self.get_api_key_with_prefix( + 'X-Management-Id', + ), + } + if 'X-Management-Token' in self.api_key: + auth['X-Management-Token'] = { + 'type': 'api_key', + 'in': 'header', + 'key': 'X-Management-Token', + 'value': self.get_api_key_with_prefix( + 'X-Management-Token', + ), + } return auth def to_debug_report(self): @@ -441,7 +459,7 @@ def to_debug_report(self): "OS: {env}\n"\ "Python Version: {pyversion}\n"\ "Version of the API: v2018-08-01\n"\ - "SDK Package Version: 3.0.0".\ + "SDK Package Version: 4.0.0".\ format(env=sys.platform, pyversion=sys.version) def get_host_settings(self): diff --git a/voucherify/models/__init__.py b/voucherify/models/__init__.py index 3e6f9f50..9b5d5dc6 100644 --- a/voucherify/models/__init__.py +++ b/voucherify/models/__init__.py @@ -183,6 +183,7 @@ from voucherify.models.exports_get_response_body_result import ExportsGetResponseBodyResult from voucherify.models.exports_list_response_body import ExportsListResponseBody from voucherify.models.field_conditions import FieldConditions +from voucherify.models.filter_conditions_date_time import FilterConditionsDateTime from voucherify.models.filter_conditions_string import FilterConditionsString from voucherify.models.filters_condition import FiltersCondition from voucherify.models.gift import Gift @@ -448,7 +449,125 @@ from voucherify.models.loyalty_tiers_expiration_all_expiration_date import LoyaltyTiersExpirationAllExpirationDate from voucherify.models.loyalty_tiers_expiration_all_expiration_date_rounding import LoyaltyTiersExpirationAllExpirationDateRounding from voucherify.models.loyalty_tiers_expiration_all_start_date import LoyaltyTiersExpirationAllStartDate -from voucherify.models.lucky_draw import LuckyDraw +from voucherify.models.management_project import ManagementProject +from voucherify.models.management_project_api_usage_notifications import ManagementProjectApiUsageNotifications +from voucherify.models.management_project_default_code_config import ManagementProjectDefaultCodeConfig +from voucherify.models.management_project_limits import ManagementProjectLimits +from voucherify.models.management_project_limits_api_calls_item import ManagementProjectLimitsApiCallsItem +from voucherify.models.management_project_limits_bulk_api_calls_item import ManagementProjectLimitsBulkApiCallsItem +from voucherify.models.management_project_webhooks_callout_notifications import ManagementProjectWebhooksCalloutNotifications +from voucherify.models.management_project_webhooks_callout_notifications_distributions import ManagementProjectWebhooksCalloutNotificationsDistributions +from voucherify.models.management_project_webhooks_callout_notifications_webhooks import ManagementProjectWebhooksCalloutNotificationsWebhooks +from voucherify.models.management_projects_branding import ManagementProjectsBranding +from voucherify.models.management_projects_branding_address import ManagementProjectsBrandingAddress +from voucherify.models.management_projects_branding_brand import ManagementProjectsBrandingBrand +from voucherify.models.management_projects_branding_cockpits import ManagementProjectsBrandingCockpits +from voucherify.models.management_projects_branding_contact import ManagementProjectsBrandingContact +from voucherify.models.management_projects_branding_create_request_body import ManagementProjectsBrandingCreateRequestBody +from voucherify.models.management_projects_branding_create_request_body_address import ManagementProjectsBrandingCreateRequestBodyAddress +from voucherify.models.management_projects_branding_create_request_body_brand import ManagementProjectsBrandingCreateRequestBodyBrand +from voucherify.models.management_projects_branding_create_request_body_cockpits import ManagementProjectsBrandingCreateRequestBodyCockpits +from voucherify.models.management_projects_branding_create_request_body_contact import ManagementProjectsBrandingCreateRequestBodyContact +from voucherify.models.management_projects_branding_create_response_body import ManagementProjectsBrandingCreateResponseBody +from voucherify.models.management_projects_branding_create_response_body_address import ManagementProjectsBrandingCreateResponseBodyAddress +from voucherify.models.management_projects_branding_create_response_body_brand import ManagementProjectsBrandingCreateResponseBodyBrand +from voucherify.models.management_projects_branding_create_response_body_cockpits import ManagementProjectsBrandingCreateResponseBodyCockpits +from voucherify.models.management_projects_branding_create_response_body_contact import ManagementProjectsBrandingCreateResponseBodyContact +from voucherify.models.management_projects_branding_get_response_body import ManagementProjectsBrandingGetResponseBody +from voucherify.models.management_projects_branding_get_response_body_address import ManagementProjectsBrandingGetResponseBodyAddress +from voucherify.models.management_projects_branding_get_response_body_brand import ManagementProjectsBrandingGetResponseBodyBrand +from voucherify.models.management_projects_branding_get_response_body_cockpits import ManagementProjectsBrandingGetResponseBodyCockpits +from voucherify.models.management_projects_branding_get_response_body_contact import ManagementProjectsBrandingGetResponseBodyContact +from voucherify.models.management_projects_branding_list_response_body import ManagementProjectsBrandingListResponseBody +from voucherify.models.management_projects_branding_update_request_body import ManagementProjectsBrandingUpdateRequestBody +from voucherify.models.management_projects_branding_update_request_body_address import ManagementProjectsBrandingUpdateRequestBodyAddress +from voucherify.models.management_projects_branding_update_request_body_brand import ManagementProjectsBrandingUpdateRequestBodyBrand +from voucherify.models.management_projects_branding_update_request_body_cockpits import ManagementProjectsBrandingUpdateRequestBodyCockpits +from voucherify.models.management_projects_branding_update_request_body_contact import ManagementProjectsBrandingUpdateRequestBodyContact +from voucherify.models.management_projects_branding_update_response_body import ManagementProjectsBrandingUpdateResponseBody +from voucherify.models.management_projects_branding_update_response_body_address import ManagementProjectsBrandingUpdateResponseBodyAddress +from voucherify.models.management_projects_branding_update_response_body_brand import ManagementProjectsBrandingUpdateResponseBodyBrand +from voucherify.models.management_projects_branding_update_response_body_cockpits import ManagementProjectsBrandingUpdateResponseBodyCockpits +from voucherify.models.management_projects_branding_update_response_body_contact import ManagementProjectsBrandingUpdateResponseBodyContact +from voucherify.models.management_projects_create_request_body import ManagementProjectsCreateRequestBody +from voucherify.models.management_projects_create_request_body_api_usage_notifications import ManagementProjectsCreateRequestBodyApiUsageNotifications +from voucherify.models.management_projects_create_request_body_users_item import ManagementProjectsCreateRequestBodyUsersItem +from voucherify.models.management_projects_create_request_body_webhooks_callout_notifications import ManagementProjectsCreateRequestBodyWebhooksCalloutNotifications +from voucherify.models.management_projects_create_request_body_webhooks_callout_notifications_distributions import ManagementProjectsCreateRequestBodyWebhooksCalloutNotificationsDistributions +from voucherify.models.management_projects_create_request_body_webhooks_callout_notifications_webhooks import ManagementProjectsCreateRequestBodyWebhooksCalloutNotificationsWebhooks +from voucherify.models.management_projects_create_response_body import ManagementProjectsCreateResponseBody +from voucherify.models.management_projects_create_response_body_api_usage_notifications import ManagementProjectsCreateResponseBodyApiUsageNotifications +from voucherify.models.management_projects_create_response_body_client_side_key import ManagementProjectsCreateResponseBodyClientSideKey +from voucherify.models.management_projects_create_response_body_server_side_key import ManagementProjectsCreateResponseBodyServerSideKey +from voucherify.models.management_projects_create_response_body_webhooks_callout_notifications import ManagementProjectsCreateResponseBodyWebhooksCalloutNotifications +from voucherify.models.management_projects_create_response_body_webhooks_callout_notifications_distributions import ManagementProjectsCreateResponseBodyWebhooksCalloutNotificationsDistributions +from voucherify.models.management_projects_create_response_body_webhooks_callout_notifications_webhooks import ManagementProjectsCreateResponseBodyWebhooksCalloutNotificationsWebhooks +from voucherify.models.management_projects_custom_event_schema import ManagementProjectsCustomEventSchema +from voucherify.models.management_projects_custom_event_schema_schema import ManagementProjectsCustomEventSchemaSchema +from voucherify.models.management_projects_custom_event_schemas_create_request_body import ManagementProjectsCustomEventSchemasCreateRequestBody +from voucherify.models.management_projects_custom_event_schemas_create_request_body_schema import ManagementProjectsCustomEventSchemasCreateRequestBodySchema +from voucherify.models.management_projects_custom_event_schemas_create_response_body import ManagementProjectsCustomEventSchemasCreateResponseBody +from voucherify.models.management_projects_custom_event_schemas_create_response_body_schema import ManagementProjectsCustomEventSchemasCreateResponseBodySchema +from voucherify.models.management_projects_custom_event_schemas_get_response_body import ManagementProjectsCustomEventSchemasGetResponseBody +from voucherify.models.management_projects_custom_event_schemas_get_response_body_schema import ManagementProjectsCustomEventSchemasGetResponseBodySchema +from voucherify.models.management_projects_custom_event_schemas_list_response_body import ManagementProjectsCustomEventSchemasListResponseBody +from voucherify.models.management_projects_custom_event_schemas_update_request_body import ManagementProjectsCustomEventSchemasUpdateRequestBody +from voucherify.models.management_projects_custom_event_schemas_update_request_body_schema import ManagementProjectsCustomEventSchemasUpdateRequestBodySchema +from voucherify.models.management_projects_custom_event_schemas_update_response_body import ManagementProjectsCustomEventSchemasUpdateResponseBody +from voucherify.models.management_projects_custom_event_schemas_update_response_body_schema import ManagementProjectsCustomEventSchemasUpdateResponseBodySchema +from voucherify.models.management_projects_get_response_body import ManagementProjectsGetResponseBody +from voucherify.models.management_projects_get_response_body_api_usage_notifications import ManagementProjectsGetResponseBodyApiUsageNotifications +from voucherify.models.management_projects_get_response_body_default_code_config import ManagementProjectsGetResponseBodyDefaultCodeConfig +from voucherify.models.management_projects_get_response_body_limits import ManagementProjectsGetResponseBodyLimits +from voucherify.models.management_projects_get_response_body_limits_api_calls_item import ManagementProjectsGetResponseBodyLimitsApiCallsItem +from voucherify.models.management_projects_get_response_body_limits_bulk_api_calls_item import ManagementProjectsGetResponseBodyLimitsBulkApiCallsItem +from voucherify.models.management_projects_get_response_body_webhooks_callout_notifications import ManagementProjectsGetResponseBodyWebhooksCalloutNotifications +from voucherify.models.management_projects_get_response_body_webhooks_callout_notifications_distributions import ManagementProjectsGetResponseBodyWebhooksCalloutNotificationsDistributions +from voucherify.models.management_projects_get_response_body_webhooks_callout_notifications_webhooks import ManagementProjectsGetResponseBodyWebhooksCalloutNotificationsWebhooks +from voucherify.models.management_projects_list_response_body import ManagementProjectsListResponseBody +from voucherify.models.management_projects_metadata_schema import ManagementProjectsMetadataSchema +from voucherify.models.management_projects_metadata_schemas_create_request_body import ManagementProjectsMetadataSchemasCreateRequestBody +from voucherify.models.management_projects_metadata_schemas_create_response_body import ManagementProjectsMetadataSchemasCreateResponseBody +from voucherify.models.management_projects_metadata_schemas_get_response_body import ManagementProjectsMetadataSchemasGetResponseBody +from voucherify.models.management_projects_metadata_schemas_list_response_body import ManagementProjectsMetadataSchemasListResponseBody +from voucherify.models.management_projects_metadata_schemas_update_request_body import ManagementProjectsMetadataSchemasUpdateRequestBody +from voucherify.models.management_projects_metadata_schemas_update_response_body import ManagementProjectsMetadataSchemasUpdateResponseBody +from voucherify.models.management_projects_stacking_rules import ManagementProjectsStackingRules +from voucherify.models.management_projects_stacking_rules_create_request_body import ManagementProjectsStackingRulesCreateRequestBody +from voucherify.models.management_projects_stacking_rules_create_response_body import ManagementProjectsStackingRulesCreateResponseBody +from voucherify.models.management_projects_stacking_rules_get_response_body import ManagementProjectsStackingRulesGetResponseBody +from voucherify.models.management_projects_stacking_rules_list_response_body import ManagementProjectsStackingRulesListResponseBody +from voucherify.models.management_projects_stacking_rules_update_request_body import ManagementProjectsStackingRulesUpdateRequestBody +from voucherify.models.management_projects_stacking_rules_update_response_body import ManagementProjectsStackingRulesUpdateResponseBody +from voucherify.models.management_projects_update_request_body import ManagementProjectsUpdateRequestBody +from voucherify.models.management_projects_update_request_body_api_usage_notifications import ManagementProjectsUpdateRequestBodyApiUsageNotifications +from voucherify.models.management_projects_update_request_body_default_code_config import ManagementProjectsUpdateRequestBodyDefaultCodeConfig +from voucherify.models.management_projects_update_request_body_webhooks_callout_notifications import ManagementProjectsUpdateRequestBodyWebhooksCalloutNotifications +from voucherify.models.management_projects_update_request_body_webhooks_callout_notifications_distributions import ManagementProjectsUpdateRequestBodyWebhooksCalloutNotificationsDistributions +from voucherify.models.management_projects_update_request_body_webhooks_callout_notifications_webhooks import ManagementProjectsUpdateRequestBodyWebhooksCalloutNotificationsWebhooks +from voucherify.models.management_projects_update_response_body import ManagementProjectsUpdateResponseBody +from voucherify.models.management_projects_update_response_body_api_usage_notifications import ManagementProjectsUpdateResponseBodyApiUsageNotifications +from voucherify.models.management_projects_update_response_body_default_code_config import ManagementProjectsUpdateResponseBodyDefaultCodeConfig +from voucherify.models.management_projects_update_response_body_limits import ManagementProjectsUpdateResponseBodyLimits +from voucherify.models.management_projects_update_response_body_limits_api_calls_item import ManagementProjectsUpdateResponseBodyLimitsApiCallsItem +from voucherify.models.management_projects_update_response_body_limits_bulk_api_calls_item import ManagementProjectsUpdateResponseBodyLimitsBulkApiCallsItem +from voucherify.models.management_projects_update_response_body_webhooks_callout_notifications import ManagementProjectsUpdateResponseBodyWebhooksCalloutNotifications +from voucherify.models.management_projects_update_response_body_webhooks_callout_notifications_distributions import ManagementProjectsUpdateResponseBodyWebhooksCalloutNotificationsDistributions +from voucherify.models.management_projects_update_response_body_webhooks_callout_notifications_webhooks import ManagementProjectsUpdateResponseBodyWebhooksCalloutNotificationsWebhooks +from voucherify.models.management_projects_users_assign_request_body import ManagementProjectsUsersAssignRequestBody +from voucherify.models.management_projects_users_assign_response_body import ManagementProjectsUsersAssignResponseBody +from voucherify.models.management_projects_users_get_user_response_body import ManagementProjectsUsersGetUserResponseBody +from voucherify.models.management_projects_users_invite_create_request_body import ManagementProjectsUsersInviteCreateRequestBody +from voucherify.models.management_projects_users_list_response_body import ManagementProjectsUsersListResponseBody +from voucherify.models.management_projects_users_update_role_request_body import ManagementProjectsUsersUpdateRoleRequestBody +from voucherify.models.management_projects_users_update_role_response_body import ManagementProjectsUsersUpdateRoleResponseBody +from voucherify.models.management_projects_webhook import ManagementProjectsWebhook +from voucherify.models.management_projects_webhooks_create_request_body import ManagementProjectsWebhooksCreateRequestBody +from voucherify.models.management_projects_webhooks_create_response_body import ManagementProjectsWebhooksCreateResponseBody +from voucherify.models.management_projects_webhooks_get_response_body import ManagementProjectsWebhooksGetResponseBody +from voucherify.models.management_projects_webhooks_list_response_body import ManagementProjectsWebhooksListResponseBody +from voucherify.models.management_projects_webhooks_update_request_body import ManagementProjectsWebhooksUpdateRequestBody +from voucherify.models.management_projects_webhooks_update_response_body import ManagementProjectsWebhooksUpdateResponseBody from voucherify.models.member_activity import MemberActivity from voucherify.models.order import Order from voucherify.models.order_calculated import OrderCalculated @@ -474,12 +593,25 @@ from voucherify.models.parameter_campaign_type import ParameterCampaignType from voucherify.models.parameter_created_before_after import ParameterCreatedBeforeAfter from voucherify.models.parameter_expand_list_campaigns import ParameterExpandListCampaigns +from voucherify.models.parameter_filters_list_bin import ParameterFiltersListBin +from voucherify.models.parameter_filters_list_bin_id import ParameterFiltersListBinId +from voucherify.models.parameter_filters_list_bin_resource_id import ParameterFiltersListBinResourceId +from voucherify.models.parameter_filters_list_bin_resource_name import ParameterFiltersListBinResourceName +from voucherify.models.parameter_filters_list_bin_resource_type import ParameterFiltersListBinResourceType +from voucherify.models.parameter_filters_list_bin_resource_type_conditions import ParameterFiltersListBinResourceTypeConditions +from voucherify.models.parameter_filters_list_campaigns import ParameterFiltersListCampaigns +from voucherify.models.parameter_filters_list_campaigns_campaign_status import ParameterFiltersListCampaignsCampaignStatus +from voucherify.models.parameter_filters_list_campaigns_campaign_status_conditions import ParameterFiltersListCampaignsCampaignStatusConditions +from voucherify.models.parameter_filters_list_campaigns_categories import ParameterFiltersListCampaignsCategories +from voucherify.models.parameter_filters_list_campaigns_category_ids import ParameterFiltersListCampaignsCategoryIds +from voucherify.models.parameter_filters_list_campaigns_is_referral_code import ParameterFiltersListCampaignsIsReferralCode +from voucherify.models.parameter_filters_list_campaigns_validity_timeframe import ParameterFiltersListCampaignsValidityTimeframe +from voucherify.models.parameter_filters_list_campaigns_voucher_type import ParameterFiltersListCampaignsVoucherType from voucherify.models.parameter_filters_list_customer_redeemables import ParameterFiltersListCustomerRedeemables from voucherify.models.parameter_filters_list_customer_redeemables_campaign_id import ParameterFiltersListCustomerRedeemablesCampaignId from voucherify.models.parameter_filters_list_customer_redeemables_campaign_type import ParameterFiltersListCustomerRedeemablesCampaignType from voucherify.models.parameter_filters_list_customer_redeemables_campaign_type_conditions import ParameterFiltersListCustomerRedeemablesCampaignTypeConditions from voucherify.models.parameter_filters_list_customer_redeemables_created_at import ParameterFiltersListCustomerRedeemablesCreatedAt -from voucherify.models.parameter_filters_list_customer_redeemables_created_at_conditions import ParameterFiltersListCustomerRedeemablesCreatedAtConditions from voucherify.models.parameter_filters_list_customer_redeemables_holder_role import ParameterFiltersListCustomerRedeemablesHolderRole from voucherify.models.parameter_filters_list_customer_redeemables_holder_role_conditions import ParameterFiltersListCustomerRedeemablesHolderRoleConditions from voucherify.models.parameter_filters_list_customer_redeemables_id import ParameterFiltersListCustomerRedeemablesId @@ -488,6 +620,16 @@ from voucherify.models.parameter_filters_list_customer_redeemables_redeemable_object_conditions import ParameterFiltersListCustomerRedeemablesRedeemableObjectConditions from voucherify.models.parameter_filters_list_customer_redeemables_voucher_type import ParameterFiltersListCustomerRedeemablesVoucherType from voucherify.models.parameter_filters_list_customer_redeemables_voucher_type_conditions import ParameterFiltersListCustomerRedeemablesVoucherTypeConditions +from voucherify.models.parameter_filters_list_publications import ParameterFiltersListPublications +from voucherify.models.parameter_filters_list_publications_campaign_name import ParameterFiltersListPublicationsCampaignName +from voucherify.models.parameter_filters_list_publications_customer_id import ParameterFiltersListPublicationsCustomerId +from voucherify.models.parameter_filters_list_publications_failure_code import ParameterFiltersListPublicationsFailureCode +from voucherify.models.parameter_filters_list_publications_is_referral_code import ParameterFiltersListPublicationsIsReferralCode +from voucherify.models.parameter_filters_list_publications_parent_object_id import ParameterFiltersListPublicationsParentObjectId +from voucherify.models.parameter_filters_list_publications_related_object_id import ParameterFiltersListPublicationsRelatedObjectId +from voucherify.models.parameter_filters_list_publications_result import ParameterFiltersListPublicationsResult +from voucherify.models.parameter_filters_list_publications_source_id import ParameterFiltersListPublicationsSourceId +from voucherify.models.parameter_filters_list_publications_voucher_type import ParameterFiltersListPublicationsVoucherType from voucherify.models.parameter_filters_list_redemptions import ParameterFiltersListRedemptions from voucherify.models.parameter_filters_list_redemptions_campaign_name import ParameterFiltersListRedemptionsCampaignName from voucherify.models.parameter_filters_list_redemptions_customer_id import ParameterFiltersListRedemptionsCustomerId @@ -502,6 +644,7 @@ from voucherify.models.parameter_order import ParameterOrder from voucherify.models.parameter_order_created_at import ParameterOrderCreatedAt from voucherify.models.parameter_order_list_all_promotion_stacks import ParameterOrderListAllPromotionStacks +from voucherify.models.parameter_order_list_bin import ParameterOrderListBin from voucherify.models.parameter_order_list_campaigns import ParameterOrderListCampaigns from voucherify.models.parameter_order_list_customers import ParameterOrderListCustomers from voucherify.models.parameter_order_list_earning_rules import ParameterOrderListEarningRules @@ -817,6 +960,10 @@ from voucherify.models.skus_import_csv_create_response_body import SkusImportCsvCreateResponseBody from voucherify.models.skus_list_for_product import SkusListForProduct from voucherify.models.stacking_rules import StackingRules +from voucherify.models.trash_bin_item import TrashBinItem +from voucherify.models.trash_bin_list_response_body import TrashBinListResponseBody +from voucherify.models.usage_notifications import UsageNotifications +from voucherify.models.user import User from voucherify.models.validation_rule import ValidationRule from voucherify.models.validation_rule_applicable_to import ValidationRuleApplicableTo from voucherify.models.validation_rule_assignment import ValidationRuleAssignment diff --git a/voucherify/models/campaign_base.py b/voucherify/models/campaign_base.py index 23bccc94..9a2607e3 100644 --- a/voucherify/models/campaign_base.py +++ b/voucherify/models/campaign_base.py @@ -57,13 +57,14 @@ class CampaignBase(BaseModel): category: Optional[StrictStr] = Field(default=None, description="Unique category name.") creation_status: Optional[StrictStr] = Field(default=None, description="Indicates the status of the campaign creation.") vouchers_generation_status: Optional[StrictStr] = Field(default=None, description="Indicates the status of the campaign's voucher generation.") + readonly: Optional[StrictBool] = Field(default=None, description="Indicates whether the campaign can be only read by a restricted user in the Areas and Stores enterprise feature. It is returned only to restricted users; this field is not returned for users with other roles.") protected: Optional[StrictBool] = Field(default=None, description="Indicates whether the resource can be deleted.") category_id: Optional[StrictStr] = Field(default=None, description="Unique category ID that this campaign belongs to.") categories: Optional[List[Category]] = Field(default=None, description="Contains details about the category.") object: Optional[StrictStr] = Field(default='campaign', description="The type of the object represented by JSON. This object stores information about the campaign.") referral_program: Optional[ReferralProgram] = None loyalty_tiers_expiration: Optional[LoyaltyTiersExpirationAll] = None - __properties: ClassVar[List[str]] = ["id", "name", "description", "campaign_type", "type", "voucher", "auto_join", "join_once", "use_voucher_metadata_schema", "validity_timeframe", "validity_day_of_week", "validity_hours", "activity_duration_after_publishing", "vouchers_count", "start_date", "expiration_date", "active", "metadata", "created_at", "updated_at", "category", "creation_status", "vouchers_generation_status", "protected", "category_id", "categories", "object", "referral_program", "loyalty_tiers_expiration"] + __properties: ClassVar[List[str]] = ["id", "name", "description", "campaign_type", "type", "voucher", "auto_join", "join_once", "use_voucher_metadata_schema", "validity_timeframe", "validity_day_of_week", "validity_hours", "activity_duration_after_publishing", "vouchers_count", "start_date", "expiration_date", "active", "metadata", "created_at", "updated_at", "category", "creation_status", "vouchers_generation_status", "readonly", "protected", "category_id", "categories", "object", "referral_program", "loyalty_tiers_expiration"] @field_validator('campaign_type') def campaign_type_validate_enum(cls, value): @@ -71,8 +72,8 @@ def campaign_type_validate_enum(cls, value): if value is None: return value - if value not in set(['LOYALTY_PROGRAM', 'GIFT_VOUCHERS', 'DISCOUNT_COUPONS', 'PROMOTION', 'REFERRAL_PROGRAM', 'LUCKY_DRAW']): - raise ValueError("must be one of enum values ('LOYALTY_PROGRAM', 'GIFT_VOUCHERS', 'DISCOUNT_COUPONS', 'PROMOTION', 'REFERRAL_PROGRAM', 'LUCKY_DRAW')") + if value not in set(['LOYALTY_PROGRAM', 'GIFT_VOUCHERS', 'DISCOUNT_COUPONS', 'PROMOTION', 'REFERRAL_PROGRAM']): + raise ValueError("must be one of enum values ('LOYALTY_PROGRAM', 'GIFT_VOUCHERS', 'DISCOUNT_COUPONS', 'PROMOTION', 'REFERRAL_PROGRAM')") return value @field_validator('type') @@ -272,6 +273,11 @@ def to_dict(self) -> Dict[str, Any]: if self.vouchers_generation_status is None and "vouchers_generation_status" in self.model_fields_set: _dict['vouchers_generation_status'] = None + # set to None if readonly (nullable) is None + # and model_fields_set contains the field + if self.readonly is None and "readonly" in self.model_fields_set: + _dict['readonly'] = None + # set to None if protected (nullable) is None # and model_fields_set contains the field if self.protected is None and "protected" in self.model_fields_set: @@ -327,6 +333,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "category": obj.get("category"), "creation_status": obj.get("creation_status"), "vouchers_generation_status": obj.get("vouchers_generation_status"), + "readonly": obj.get("readonly"), "protected": obj.get("protected"), "category_id": obj.get("category_id"), "categories": [Category.from_dict(_item) for _item in obj["categories"]] if obj.get("categories") is not None else None, diff --git a/voucherify/models/campaigns_create_request_body.py b/voucherify/models/campaigns_create_request_body.py index b59271a8..c7a5ad8f 100644 --- a/voucherify/models/campaigns_create_request_body.py +++ b/voucherify/models/campaigns_create_request_body.py @@ -24,7 +24,6 @@ from typing_extensions import Annotated from voucherify.models.campaigns_create_request_body_promotion import CampaignsCreateRequestBodyPromotion from voucherify.models.campaigns_create_request_body_voucher import CampaignsCreateRequestBodyVoucher -from voucherify.models.lucky_draw import LuckyDraw from voucherify.models.referral_program import ReferralProgram from voucherify.models.validity_hours import ValidityHours from voucherify.models.validity_timeframe import ValidityTimeframe @@ -56,8 +55,7 @@ class CampaignsCreateRequestBody(BaseModel): voucher: Optional[CampaignsCreateRequestBodyVoucher] = None referral_program: Optional[ReferralProgram] = None promotion: Optional[CampaignsCreateRequestBodyPromotion] = None - lucky_draw: Optional[LuckyDraw] = None - __properties: ClassVar[List[str]] = ["name", "description", "type", "join_once", "auto_join", "use_voucher_metadata_schema", "vouchers_count", "start_date", "expiration_date", "validity_timeframe", "validity_day_of_week", "validity_hours", "activity_duration_after_publishing", "validation_rules", "category_id", "category", "metadata", "campaign_type", "voucher", "referral_program", "promotion", "lucky_draw"] + __properties: ClassVar[List[str]] = ["name", "description", "type", "join_once", "auto_join", "use_voucher_metadata_schema", "vouchers_count", "start_date", "expiration_date", "validity_timeframe", "validity_day_of_week", "validity_hours", "activity_duration_after_publishing", "validation_rules", "category_id", "category", "metadata", "campaign_type", "voucher", "referral_program", "promotion"] @field_validator('type') def type_validate_enum(cls, value): @@ -86,8 +84,8 @@ def campaign_type_validate_enum(cls, value): if value is None: return value - if value not in set(['DISCOUNT_COUPONS', 'REFERRAL_PROGRAM', 'GIFT_VOUCHERS', 'LOYALTY_PROGRAM', 'PROMOTION', 'LUCKY_DRAW']): - raise ValueError("must be one of enum values ('DISCOUNT_COUPONS', 'REFERRAL_PROGRAM', 'GIFT_VOUCHERS', 'LOYALTY_PROGRAM', 'PROMOTION', 'LUCKY_DRAW')") + if value not in set(['DISCOUNT_COUPONS', 'REFERRAL_PROGRAM', 'GIFT_VOUCHERS', 'LOYALTY_PROGRAM', 'PROMOTION']): + raise ValueError("must be one of enum values ('DISCOUNT_COUPONS', 'REFERRAL_PROGRAM', 'GIFT_VOUCHERS', 'LOYALTY_PROGRAM', 'PROMOTION')") return value model_config = ConfigDict( @@ -144,9 +142,6 @@ def to_dict(self) -> Dict[str, Any]: # override the default output from pydantic by calling `to_dict()` of promotion if self.promotion: _dict['promotion'] = self.promotion.to_dict() - # override the default output from pydantic by calling `to_dict()` of lucky_draw - if self.lucky_draw: - _dict['lucky_draw'] = self.lucky_draw.to_dict() # set to None if name (nullable) is None # and model_fields_set contains the field if self.name is None and "name" in self.model_fields_set: @@ -264,8 +259,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "campaign_type": obj.get("campaign_type"), "voucher": CampaignsCreateRequestBodyVoucher.from_dict(obj["voucher"]) if obj.get("voucher") is not None else None, "referral_program": ReferralProgram.from_dict(obj["referral_program"]) if obj.get("referral_program") is not None else None, - "promotion": CampaignsCreateRequestBodyPromotion.from_dict(obj["promotion"]) if obj.get("promotion") is not None else None, - "lucky_draw": LuckyDraw.from_dict(obj["lucky_draw"]) if obj.get("lucky_draw") is not None else None + "promotion": CampaignsCreateRequestBodyPromotion.from_dict(obj["promotion"]) if obj.get("promotion") is not None else None }) return _obj diff --git a/voucherify/models/campaigns_create_response_body.py b/voucherify/models/campaigns_create_response_body.py index dece3870..2d1e4385 100644 --- a/voucherify/models/campaigns_create_response_body.py +++ b/voucherify/models/campaigns_create_response_body.py @@ -60,6 +60,7 @@ class CampaignsCreateResponseBody(BaseModel): category: Optional[StrictStr] = Field(default=None, description="Unique category name.") creation_status: Optional[StrictStr] = Field(default=None, description="Indicates the status of the campaign creation.") vouchers_generation_status: Optional[StrictStr] = Field(default=None, description="Indicates the status of the campaign's voucher generation.") + readonly: Optional[StrictBool] = Field(default=None, description="Indicates whether the campaign can be only read by a restricted user in the Areas and Stores enterprise feature. It is returned only to restricted users; this field is not returned for users with other roles.") protected: Optional[StrictBool] = Field(default=None, description="Indicates whether the resource can be deleted.") category_id: Optional[StrictStr] = Field(default=None, description="Unique category ID that this campaign belongs to.") categories: Optional[List[Category]] = Field(default=None, description="Contains details about the category.") @@ -69,7 +70,7 @@ class CampaignsCreateResponseBody(BaseModel): promotion: Optional[PromotionTiersList] = None validation_rules_assignments: Optional[ValidationRulesAssignmentsList] = None access_settings_assignments: Optional[AccessSettingsCampaignAssignmentsList] = None - __properties: ClassVar[List[str]] = ["id", "name", "description", "campaign_type", "type", "voucher", "auto_join", "join_once", "use_voucher_metadata_schema", "validity_timeframe", "validity_day_of_week", "validity_hours", "activity_duration_after_publishing", "vouchers_count", "start_date", "expiration_date", "active", "metadata", "created_at", "updated_at", "category", "creation_status", "vouchers_generation_status", "protected", "category_id", "categories", "object", "referral_program", "loyalty_tiers_expiration", "promotion", "validation_rules_assignments", "access_settings_assignments"] + __properties: ClassVar[List[str]] = ["id", "name", "description", "campaign_type", "type", "voucher", "auto_join", "join_once", "use_voucher_metadata_schema", "validity_timeframe", "validity_day_of_week", "validity_hours", "activity_duration_after_publishing", "vouchers_count", "start_date", "expiration_date", "active", "metadata", "created_at", "updated_at", "category", "creation_status", "vouchers_generation_status", "readonly", "protected", "category_id", "categories", "object", "referral_program", "loyalty_tiers_expiration", "promotion", "validation_rules_assignments", "access_settings_assignments"] @field_validator('campaign_type') def campaign_type_validate_enum(cls, value): @@ -77,8 +78,8 @@ def campaign_type_validate_enum(cls, value): if value is None: return value - if value not in set(['LOYALTY_PROGRAM', 'GIFT_VOUCHERS', 'DISCOUNT_COUPONS', 'PROMOTION', 'REFERRAL_PROGRAM', 'LUCKY_DRAW']): - raise ValueError("must be one of enum values ('LOYALTY_PROGRAM', 'GIFT_VOUCHERS', 'DISCOUNT_COUPONS', 'PROMOTION', 'REFERRAL_PROGRAM', 'LUCKY_DRAW')") + if value not in set(['LOYALTY_PROGRAM', 'GIFT_VOUCHERS', 'DISCOUNT_COUPONS', 'PROMOTION', 'REFERRAL_PROGRAM']): + raise ValueError("must be one of enum values ('LOYALTY_PROGRAM', 'GIFT_VOUCHERS', 'DISCOUNT_COUPONS', 'PROMOTION', 'REFERRAL_PROGRAM')") return value @field_validator('type') @@ -287,6 +288,11 @@ def to_dict(self) -> Dict[str, Any]: if self.vouchers_generation_status is None and "vouchers_generation_status" in self.model_fields_set: _dict['vouchers_generation_status'] = None + # set to None if readonly (nullable) is None + # and model_fields_set contains the field + if self.readonly is None and "readonly" in self.model_fields_set: + _dict['readonly'] = None + # set to None if protected (nullable) is None # and model_fields_set contains the field if self.protected is None and "protected" in self.model_fields_set: @@ -342,6 +348,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "category": obj.get("category"), "creation_status": obj.get("creation_status"), "vouchers_generation_status": obj.get("vouchers_generation_status"), + "readonly": obj.get("readonly"), "protected": obj.get("protected"), "category_id": obj.get("category_id"), "categories": [Category.from_dict(_item) for _item in obj["categories"]] if obj.get("categories") is not None else None, diff --git a/voucherify/models/campaigns_get_response_body.py b/voucherify/models/campaigns_get_response_body.py index 174fd48e..9ec80278 100644 --- a/voucherify/models/campaigns_get_response_body.py +++ b/voucherify/models/campaigns_get_response_body.py @@ -60,6 +60,7 @@ class CampaignsGetResponseBody(BaseModel): category: Optional[StrictStr] = Field(default=None, description="Unique category name.") creation_status: Optional[StrictStr] = Field(default=None, description="Indicates the status of the campaign creation.") vouchers_generation_status: Optional[StrictStr] = Field(default=None, description="Indicates the status of the campaign's voucher generation.") + readonly: Optional[StrictBool] = Field(default=None, description="Indicates whether the campaign can be only read by a restricted user in the Areas and Stores enterprise feature. It is returned only to restricted users; this field is not returned for users with other roles.") protected: Optional[StrictBool] = Field(default=None, description="Indicates whether the resource can be deleted.") category_id: Optional[StrictStr] = Field(default=None, description="Unique category ID that this campaign belongs to.") categories: Optional[List[Category]] = Field(default=None, description="Contains details about the category.") @@ -69,7 +70,7 @@ class CampaignsGetResponseBody(BaseModel): promotion: Optional[PromotionTiersList] = None validation_rules_assignments: Optional[ValidationRulesAssignmentsList] = None access_settings_assignments: Optional[AccessSettingsCampaignAssignmentsList] = None - __properties: ClassVar[List[str]] = ["id", "name", "description", "campaign_type", "type", "voucher", "auto_join", "join_once", "use_voucher_metadata_schema", "validity_timeframe", "validity_day_of_week", "validity_hours", "activity_duration_after_publishing", "vouchers_count", "start_date", "expiration_date", "active", "metadata", "created_at", "updated_at", "category", "creation_status", "vouchers_generation_status", "protected", "category_id", "categories", "object", "referral_program", "loyalty_tiers_expiration", "promotion", "validation_rules_assignments", "access_settings_assignments"] + __properties: ClassVar[List[str]] = ["id", "name", "description", "campaign_type", "type", "voucher", "auto_join", "join_once", "use_voucher_metadata_schema", "validity_timeframe", "validity_day_of_week", "validity_hours", "activity_duration_after_publishing", "vouchers_count", "start_date", "expiration_date", "active", "metadata", "created_at", "updated_at", "category", "creation_status", "vouchers_generation_status", "readonly", "protected", "category_id", "categories", "object", "referral_program", "loyalty_tiers_expiration", "promotion", "validation_rules_assignments", "access_settings_assignments"] @field_validator('campaign_type') def campaign_type_validate_enum(cls, value): @@ -77,8 +78,8 @@ def campaign_type_validate_enum(cls, value): if value is None: return value - if value not in set(['LOYALTY_PROGRAM', 'GIFT_VOUCHERS', 'DISCOUNT_COUPONS', 'PROMOTION', 'REFERRAL_PROGRAM', 'LUCKY_DRAW']): - raise ValueError("must be one of enum values ('LOYALTY_PROGRAM', 'GIFT_VOUCHERS', 'DISCOUNT_COUPONS', 'PROMOTION', 'REFERRAL_PROGRAM', 'LUCKY_DRAW')") + if value not in set(['LOYALTY_PROGRAM', 'GIFT_VOUCHERS', 'DISCOUNT_COUPONS', 'PROMOTION', 'REFERRAL_PROGRAM']): + raise ValueError("must be one of enum values ('LOYALTY_PROGRAM', 'GIFT_VOUCHERS', 'DISCOUNT_COUPONS', 'PROMOTION', 'REFERRAL_PROGRAM')") return value @field_validator('type') @@ -287,6 +288,11 @@ def to_dict(self) -> Dict[str, Any]: if self.vouchers_generation_status is None and "vouchers_generation_status" in self.model_fields_set: _dict['vouchers_generation_status'] = None + # set to None if readonly (nullable) is None + # and model_fields_set contains the field + if self.readonly is None and "readonly" in self.model_fields_set: + _dict['readonly'] = None + # set to None if protected (nullable) is None # and model_fields_set contains the field if self.protected is None and "protected" in self.model_fields_set: @@ -342,6 +348,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "category": obj.get("category"), "creation_status": obj.get("creation_status"), "vouchers_generation_status": obj.get("vouchers_generation_status"), + "readonly": obj.get("readonly"), "protected": obj.get("protected"), "category_id": obj.get("category_id"), "categories": [Category.from_dict(_item) for _item in obj["categories"]] if obj.get("categories") is not None else None, diff --git a/voucherify/models/campaigns_update_request_body.py b/voucherify/models/campaigns_update_request_body.py index 8e4b4751..25a241a6 100644 --- a/voucherify/models/campaigns_update_request_body.py +++ b/voucherify/models/campaigns_update_request_body.py @@ -19,9 +19,8 @@ import json from datetime import datetime -from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr, field_validator +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr, field_validator from typing import Any, ClassVar, Dict, List, Optional -from typing_extensions import Annotated from voucherify.models.campaigns_update_request_body_options import CampaignsUpdateRequestBodyOptions from voucherify.models.gift import Gift from voucherify.models.loyalty_tiers_expiration_all import LoyaltyTiersExpirationAll @@ -35,6 +34,11 @@ class CampaignsUpdateRequestBody(BaseModel): """ CampaignsUpdateRequestBody """ # noqa: E501 + discount: Optional[Dict[str, Any]] = None + referral_program: Optional[ReferralProgram] = None + gift: Optional[Gift] = None + loyalty_tiers_expiration: Optional[LoyaltyTiersExpirationAll] = None + options: Optional[CampaignsUpdateRequestBodyOptions] = None start_date: Optional[datetime] = Field(default=None, description="Activation timestamp defines when the campaign starts to be active in ISO 8601 format. Campaign is *inactive before* this date. ") expiration_date: Optional[datetime] = Field(default=None, description="Expiration timestamp defines when the campaign expires in ISO 8601 format. Campaign is *inactive after* this date.") validity_timeframe: Optional[ValidityTimeframe] = None @@ -42,22 +46,10 @@ class CampaignsUpdateRequestBody(BaseModel): validity_hours: Optional[ValidityHours] = None description: Optional[StrictStr] = Field(default=None, description="An optional field to keep any extra textual information about the campaign such as a campaign description and details.") category: Optional[StrictStr] = Field(default=None, description="The category assigned to the campaign. Either pass this parameter OR the `category_id`.") - metadata: Optional[Dict[str, Any]] = None + metadata: Optional[Dict[str, Any]] = Field(default=None, description="The metadata object stores all custom attributes assigned to the campaign. A set of key/value pairs that you can attach to a campaign object. It can be useful for storing additional information about the campaign in a structured format.") unset_metadata_fields: Optional[List[StrictStr]] = Field(default=None, description="Determine which metadata should be removed from campaign.") category_id: Optional[StrictStr] = Field(default=None, description="Unique category ID that this campaign belongs to. Either pass this parameter OR the `category`.") - activity_duration_after_publishing: Optional[StrictStr] = Field(default=None, description="Defines the amount of time the vouchers will be active after publishing. The value is shown in the ISO 8601 format. For example, a voucher with the value of P24D will be valid for a duration of 24 days.") - join_once: Optional[StrictBool] = Field(default=None, description="If this value is set to `true`, customers will be able to join the campaign only once.") - auto_join: Optional[StrictBool] = Field(default=None, description="Indicates whether customers will be able to auto-join a loyalty campaign if any earning rule is fulfilled.") - type: Optional[StrictStr] = Field(default=None, description="Defines whether the campaign can be updated with new vouchers after campaign creation. - `AUTO_UPDATE`: By choosing the auto update option you will create a campaign that can be enhanced by new vouchers after the time of creation (e.g. by publish vouchers method). - `STATIC`: vouchers need to be manually published.") - discount: Optional[Dict[str, Any]] = None - referral_program: Optional[ReferralProgram] = None - gift: Optional[Gift] = None - loyalty_tiers_expiration: Optional[LoyaltyTiersExpirationAll] = None - options: Optional[CampaignsUpdateRequestBodyOptions] = None - winners_count: Optional[Annotated[str, Field(strict=True)]] = Field(default=None, description="It represents the total number of winners in a lucky draw.") - unique_winners_per_draw: Optional[StrictStr] = Field(default=None, description="It indicates whether each winner in a draw is unique or not.") - unique_winners: Optional[StrictStr] = Field(default=None, description="Specifies whether each participant can win only once across multiple draws.") - __properties: ClassVar[List[str]] = ["start_date", "expiration_date", "validity_timeframe", "validity_day_of_week", "validity_hours", "description", "category", "metadata", "unset_metadata_fields", "category_id", "activity_duration_after_publishing", "join_once", "auto_join", "type", "discount", "referral_program", "gift", "loyalty_tiers_expiration", "options", "winners_count", "unique_winners_per_draw", "unique_winners"] + __properties: ClassVar[List[str]] = ["discount", "referral_program", "gift", "loyalty_tiers_expiration", "options", "start_date", "expiration_date", "validity_timeframe", "validity_day_of_week", "validity_hours", "description", "category", "metadata", "unset_metadata_fields", "category_id"] @field_validator('validity_day_of_week') def validity_day_of_week_validate_enum(cls, value): @@ -70,16 +62,6 @@ def validity_day_of_week_validate_enum(cls, value): raise ValueError("each list item must be one of (0, 1, 2, 3, 4, 5, 6)") return value - @field_validator('type') - def type_validate_enum(cls, value): - """Validates the enum""" - if value is None: - return value - - if value not in set(['AUTO_UPDATE', 'STATIC']): - raise ValueError("must be one of enum values ('AUTO_UPDATE', 'STATIC')") - return value - model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -119,12 +101,6 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) - # override the default output from pydantic by calling `to_dict()` of validity_timeframe - if self.validity_timeframe: - _dict['validity_timeframe'] = self.validity_timeframe.to_dict() - # override the default output from pydantic by calling `to_dict()` of validity_hours - if self.validity_hours: - _dict['validity_hours'] = self.validity_hours.to_dict() # override the default output from pydantic by calling `to_dict()` of referral_program if self.referral_program: _dict['referral_program'] = self.referral_program.to_dict() @@ -137,6 +113,22 @@ def to_dict(self) -> Dict[str, Any]: # override the default output from pydantic by calling `to_dict()` of options if self.options: _dict['options'] = self.options.to_dict() + # override the default output from pydantic by calling `to_dict()` of validity_timeframe + if self.validity_timeframe: + _dict['validity_timeframe'] = self.validity_timeframe.to_dict() + # override the default output from pydantic by calling `to_dict()` of validity_hours + if self.validity_hours: + _dict['validity_hours'] = self.validity_hours.to_dict() + # set to None if discount (nullable) is None + # and model_fields_set contains the field + if self.discount is None and "discount" in self.model_fields_set: + _dict['discount'] = None + + # set to None if options (nullable) is None + # and model_fields_set contains the field + if self.options is None and "options" in self.model_fields_set: + _dict['options'] = None + # set to None if start_date (nullable) is None # and model_fields_set contains the field if self.start_date is None and "start_date" in self.model_fields_set: @@ -172,51 +164,6 @@ def to_dict(self) -> Dict[str, Any]: if self.category_id is None and "category_id" in self.model_fields_set: _dict['category_id'] = None - # set to None if activity_duration_after_publishing (nullable) is None - # and model_fields_set contains the field - if self.activity_duration_after_publishing is None and "activity_duration_after_publishing" in self.model_fields_set: - _dict['activity_duration_after_publishing'] = None - - # set to None if join_once (nullable) is None - # and model_fields_set contains the field - if self.join_once is None and "join_once" in self.model_fields_set: - _dict['join_once'] = None - - # set to None if auto_join (nullable) is None - # and model_fields_set contains the field - if self.auto_join is None and "auto_join" in self.model_fields_set: - _dict['auto_join'] = None - - # set to None if type (nullable) is None - # and model_fields_set contains the field - if self.type is None and "type" in self.model_fields_set: - _dict['type'] = None - - # set to None if discount (nullable) is None - # and model_fields_set contains the field - if self.discount is None and "discount" in self.model_fields_set: - _dict['discount'] = None - - # set to None if options (nullable) is None - # and model_fields_set contains the field - if self.options is None and "options" in self.model_fields_set: - _dict['options'] = None - - # set to None if winners_count (nullable) is None - # and model_fields_set contains the field - if self.winners_count is None and "winners_count" in self.model_fields_set: - _dict['winners_count'] = None - - # set to None if unique_winners_per_draw (nullable) is None - # and model_fields_set contains the field - if self.unique_winners_per_draw is None and "unique_winners_per_draw" in self.model_fields_set: - _dict['unique_winners_per_draw'] = None - - # set to None if unique_winners (nullable) is None - # and model_fields_set contains the field - if self.unique_winners is None and "unique_winners" in self.model_fields_set: - _dict['unique_winners'] = None - return _dict @classmethod @@ -229,6 +176,11 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: return cls.model_validate(obj) _obj = cls.model_validate({ + "discount": obj.get("discount"), + "referral_program": ReferralProgram.from_dict(obj["referral_program"]) if obj.get("referral_program") is not None else None, + "gift": Gift.from_dict(obj["gift"]) if obj.get("gift") is not None else None, + "loyalty_tiers_expiration": LoyaltyTiersExpirationAll.from_dict(obj["loyalty_tiers_expiration"]) if obj.get("loyalty_tiers_expiration") is not None else None, + "options": CampaignsUpdateRequestBodyOptions.from_dict(obj["options"]) if obj.get("options") is not None else None, "start_date": obj.get("start_date"), "expiration_date": obj.get("expiration_date"), "validity_timeframe": ValidityTimeframe.from_dict(obj["validity_timeframe"]) if obj.get("validity_timeframe") is not None else None, @@ -238,19 +190,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "category": obj.get("category"), "metadata": obj.get("metadata"), "unset_metadata_fields": obj.get("unset_metadata_fields"), - "category_id": obj.get("category_id"), - "activity_duration_after_publishing": obj.get("activity_duration_after_publishing"), - "join_once": obj.get("join_once"), - "auto_join": obj.get("auto_join"), - "type": obj.get("type"), - "discount": obj.get("discount"), - "referral_program": ReferralProgram.from_dict(obj["referral_program"]) if obj.get("referral_program") is not None else None, - "gift": Gift.from_dict(obj["gift"]) if obj.get("gift") is not None else None, - "loyalty_tiers_expiration": LoyaltyTiersExpirationAll.from_dict(obj["loyalty_tiers_expiration"]) if obj.get("loyalty_tiers_expiration") is not None else None, - "options": CampaignsUpdateRequestBodyOptions.from_dict(obj["options"]) if obj.get("options") is not None else None, - "winners_count": obj.get("winners_count"), - "unique_winners_per_draw": obj.get("unique_winners_per_draw"), - "unique_winners": obj.get("unique_winners") + "category_id": obj.get("category_id") }) return _obj diff --git a/voucherify/models/campaigns_update_response_body.py b/voucherify/models/campaigns_update_response_body.py index 066f7517..b66689dc 100644 --- a/voucherify/models/campaigns_update_response_body.py +++ b/voucherify/models/campaigns_update_response_body.py @@ -60,6 +60,7 @@ class CampaignsUpdateResponseBody(BaseModel): category: Optional[StrictStr] = Field(default=None, description="Unique category name.") creation_status: Optional[StrictStr] = Field(default=None, description="Indicates the status of the campaign creation.") vouchers_generation_status: Optional[StrictStr] = Field(default=None, description="Indicates the status of the campaign's voucher generation.") + readonly: Optional[StrictBool] = Field(default=None, description="Indicates whether the campaign can be only read by a restricted user in the Areas and Stores enterprise feature. It is returned only to restricted users; this field is not returned for users with other roles.") protected: Optional[StrictBool] = Field(default=None, description="Indicates whether the resource can be deleted.") category_id: Optional[StrictStr] = Field(default=None, description="Unique category ID that this campaign belongs to.") categories: Optional[List[Category]] = Field(default=None, description="Contains details about the category.") @@ -69,7 +70,7 @@ class CampaignsUpdateResponseBody(BaseModel): promotion: Optional[PromotionTiersList] = None validation_rules_assignments: Optional[ValidationRulesAssignmentsList] = None access_settings_assignments: Optional[AccessSettingsCampaignAssignmentsList] = None - __properties: ClassVar[List[str]] = ["id", "name", "description", "campaign_type", "type", "voucher", "auto_join", "join_once", "use_voucher_metadata_schema", "validity_timeframe", "validity_day_of_week", "validity_hours", "activity_duration_after_publishing", "vouchers_count", "start_date", "expiration_date", "active", "metadata", "created_at", "updated_at", "category", "creation_status", "vouchers_generation_status", "protected", "category_id", "categories", "object", "referral_program", "loyalty_tiers_expiration", "promotion", "validation_rules_assignments", "access_settings_assignments"] + __properties: ClassVar[List[str]] = ["id", "name", "description", "campaign_type", "type", "voucher", "auto_join", "join_once", "use_voucher_metadata_schema", "validity_timeframe", "validity_day_of_week", "validity_hours", "activity_duration_after_publishing", "vouchers_count", "start_date", "expiration_date", "active", "metadata", "created_at", "updated_at", "category", "creation_status", "vouchers_generation_status", "readonly", "protected", "category_id", "categories", "object", "referral_program", "loyalty_tiers_expiration", "promotion", "validation_rules_assignments", "access_settings_assignments"] @field_validator('campaign_type') def campaign_type_validate_enum(cls, value): @@ -77,8 +78,8 @@ def campaign_type_validate_enum(cls, value): if value is None: return value - if value not in set(['LOYALTY_PROGRAM', 'GIFT_VOUCHERS', 'DISCOUNT_COUPONS', 'PROMOTION', 'REFERRAL_PROGRAM', 'LUCKY_DRAW']): - raise ValueError("must be one of enum values ('LOYALTY_PROGRAM', 'GIFT_VOUCHERS', 'DISCOUNT_COUPONS', 'PROMOTION', 'REFERRAL_PROGRAM', 'LUCKY_DRAW')") + if value not in set(['LOYALTY_PROGRAM', 'GIFT_VOUCHERS', 'DISCOUNT_COUPONS', 'PROMOTION', 'REFERRAL_PROGRAM']): + raise ValueError("must be one of enum values ('LOYALTY_PROGRAM', 'GIFT_VOUCHERS', 'DISCOUNT_COUPONS', 'PROMOTION', 'REFERRAL_PROGRAM')") return value @field_validator('type') @@ -287,6 +288,11 @@ def to_dict(self) -> Dict[str, Any]: if self.vouchers_generation_status is None and "vouchers_generation_status" in self.model_fields_set: _dict['vouchers_generation_status'] = None + # set to None if readonly (nullable) is None + # and model_fields_set contains the field + if self.readonly is None and "readonly" in self.model_fields_set: + _dict['readonly'] = None + # set to None if protected (nullable) is None # and model_fields_set contains the field if self.protected is None and "protected" in self.model_fields_set: @@ -342,6 +348,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "category": obj.get("category"), "creation_status": obj.get("creation_status"), "vouchers_generation_status": obj.get("vouchers_generation_status"), + "readonly": obj.get("readonly"), "protected": obj.get("protected"), "category_id": obj.get("category_id"), "categories": [Category.from_dict(_item) for _item in obj["categories"]] if obj.get("categories") is not None else None, diff --git a/voucherify/models/customer_redeemable.py b/voucherify/models/customer_redeemable.py index 9e8636d8..a23fde6f 100644 --- a/voucherify/models/customer_redeemable.py +++ b/voucherify/models/customer_redeemable.py @@ -57,8 +57,8 @@ def campaign_type_validate_enum(cls, value): if value is None: return value - if value not in set(['LOYALTY_PROGRAM', 'GIFT_VOUCHERS', 'DISCOUNT_COUPONS', 'PROMOTION', 'REFERRAL_PROGRAM', 'LUCKY_DRAW']): - raise ValueError("must be one of enum values ('LOYALTY_PROGRAM', 'GIFT_VOUCHERS', 'DISCOUNT_COUPONS', 'PROMOTION', 'REFERRAL_PROGRAM', 'LUCKY_DRAW')") + if value not in set(['LOYALTY_PROGRAM', 'GIFT_VOUCHERS', 'DISCOUNT_COUPONS', 'PROMOTION', 'REFERRAL_PROGRAM']): + raise ValueError("must be one of enum values ('LOYALTY_PROGRAM', 'GIFT_VOUCHERS', 'DISCOUNT_COUPONS', 'PROMOTION', 'REFERRAL_PROGRAM')") return value @field_validator('voucher_type') @@ -67,8 +67,8 @@ def voucher_type_validate_enum(cls, value): if value is None: return value - if value not in set(['GIFT_VOUCHER', 'DISCOUNT_VOUCHER', 'LOYALTY_CARD', 'LUCKY_DRAW_CODE']): - raise ValueError("must be one of enum values ('GIFT_VOUCHER', 'DISCOUNT_VOUCHER', 'LOYALTY_CARD', 'LUCKY_DRAW_CODE')") + if value not in set(['GIFT_VOUCHER', 'DISCOUNT_VOUCHER', 'LOYALTY_CARD']): + raise ValueError("must be one of enum values ('GIFT_VOUCHER', 'DISCOUNT_VOUCHER', 'LOYALTY_CARD')") return value model_config = ConfigDict( diff --git a/voucherify/models/filter_conditions_date_time.py b/voucherify/models/filter_conditions_date_time.py new file mode 100644 index 00000000..03650f5d --- /dev/null +++ b/voucherify/models/filter_conditions_date_time.py @@ -0,0 +1,129 @@ +# coding: utf-8 + +""" + Voucherify API + + Voucherify promotion engine REST API. Please see https://docs.voucherify.io/docs for more details. + + The version of the OpenAPI document: v2018-08-01 + Contact: support@voucherify.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class FilterConditionsDateTime(BaseModel): + """ + Data filters used to narrow down the data records to be returned in the result. + """ # noqa: E501 + after: Optional[datetime] = Field(default=None, description="Value is after this date. The value for this parameter is shown in the ISO 8601 format.", alias="$after") + before: Optional[datetime] = Field(default=None, description="Value is before this date. The value for this parameter is shown in the ISO 8601 format.", alias="$before") + has_value: Optional[StrictStr] = Field(default=None, description="Value is NOT null. The value for this parameter is an empty string.", alias="$has_value") + is_unknown: Optional[StrictStr] = Field(default=None, description="Value is null. The value for this parameter is an empty string.", alias="$is_unknown") + more_than: Optional[StrictInt] = Field(default=None, description="Value is more days ago before the current date and time, e.g. more than `10` days ago.") + less_than: Optional[StrictInt] = Field(default=None, description="Value is less days before the current date and time, e.g. less than `10` days ago.") + __properties: ClassVar[List[str]] = ["$after", "$before", "$has_value", "$is_unknown", "more_than", "less_than"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of FilterConditionsDateTime from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if after (nullable) is None + # and model_fields_set contains the field + if self.after is None and "after" in self.model_fields_set: + _dict['$after'] = None + + # set to None if before (nullable) is None + # and model_fields_set contains the field + if self.before is None and "before" in self.model_fields_set: + _dict['$before'] = None + + # set to None if has_value (nullable) is None + # and model_fields_set contains the field + if self.has_value is None and "has_value" in self.model_fields_set: + _dict['$has_value'] = None + + # set to None if is_unknown (nullable) is None + # and model_fields_set contains the field + if self.is_unknown is None and "is_unknown" in self.model_fields_set: + _dict['$is_unknown'] = None + + # set to None if more_than (nullable) is None + # and model_fields_set contains the field + if self.more_than is None and "more_than" in self.model_fields_set: + _dict['more_than'] = None + + # set to None if less_than (nullable) is None + # and model_fields_set contains the field + if self.less_than is None and "less_than" in self.model_fields_set: + _dict['less_than'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of FilterConditionsDateTime from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "$after": obj.get("$after"), + "$before": obj.get("$before"), + "$has_value": obj.get("$has_value"), + "$is_unknown": obj.get("$is_unknown"), + "more_than": obj.get("more_than"), + "less_than": obj.get("less_than") + }) + return _obj + + diff --git a/voucherify/models/filter_conditions_date_time_conditions.py b/voucherify/models/filter_conditions_date_time_conditions.py new file mode 100644 index 00000000..3e5ea96d --- /dev/null +++ b/voucherify/models/filter_conditions_date_time_conditions.py @@ -0,0 +1,129 @@ +# coding: utf-8 + +""" + Voucherify API + + Voucherify promotion engine REST API. Please see https://docs.voucherify.io/docs for more details. + + The version of the OpenAPI document: v2018-08-01 + Contact: support@voucherify.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class FilterConditionsDateTimeConditions(BaseModel): + """ + Data filters used to narrow down the data records to be returned in the result. + """ # noqa: E501 + after: Optional[datetime] = Field(default=None, description="Value is after this date. The value for this parameter is shown in the ISO 8601 format.", alias="$after") + before: Optional[datetime] = Field(default=None, description="Value is before this date. The value for this parameter is shown in the ISO 8601 format.", alias="$before") + has_value: Optional[StrictStr] = Field(default=None, description="Value is NOT null. The value for this parameter is an empty string.", alias="$has_value") + is_unknown: Optional[StrictStr] = Field(default=None, description="Value is null. The value for this parameter is an empty string.", alias="$is_unknown") + more_than: Optional[StrictInt] = Field(default=None, description="Value is more days ago before the current date and time, e.g. more than `10` days ago.") + less_than: Optional[StrictInt] = Field(default=None, description="Value is less days before the current date and time, e.g. less than `10` days ago.") + __properties: ClassVar[List[str]] = ["$after", "$before", "$has_value", "$is_unknown", "more_than", "less_than"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of FilterConditionsDateTimeConditions from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if after (nullable) is None + # and model_fields_set contains the field + if self.after is None and "after" in self.model_fields_set: + _dict['$after'] = None + + # set to None if before (nullable) is None + # and model_fields_set contains the field + if self.before is None and "before" in self.model_fields_set: + _dict['$before'] = None + + # set to None if has_value (nullable) is None + # and model_fields_set contains the field + if self.has_value is None and "has_value" in self.model_fields_set: + _dict['$has_value'] = None + + # set to None if is_unknown (nullable) is None + # and model_fields_set contains the field + if self.is_unknown is None and "is_unknown" in self.model_fields_set: + _dict['$is_unknown'] = None + + # set to None if more_than (nullable) is None + # and model_fields_set contains the field + if self.more_than is None and "more_than" in self.model_fields_set: + _dict['more_than'] = None + + # set to None if less_than (nullable) is None + # and model_fields_set contains the field + if self.less_than is None and "less_than" in self.model_fields_set: + _dict['less_than'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of FilterConditionsDateTimeConditions from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "$after": obj.get("$after"), + "$before": obj.get("$before"), + "$has_value": obj.get("$has_value"), + "$is_unknown": obj.get("$is_unknown"), + "more_than": obj.get("more_than"), + "less_than": obj.get("less_than") + }) + return _obj + + diff --git a/voucherify/models/loyalties_create_campaign_response_body.py b/voucherify/models/loyalties_create_campaign_response_body.py index db24e410..f9c72e6a 100644 --- a/voucherify/models/loyalties_create_campaign_response_body.py +++ b/voucherify/models/loyalties_create_campaign_response_body.py @@ -58,6 +58,7 @@ class LoyaltiesCreateCampaignResponseBody(BaseModel): category: Optional[StrictStr] = Field(default=None, description="Unique category name.") creation_status: Optional[StrictStr] = Field(default=None, description="Indicates the status of the campaign creation.") vouchers_generation_status: Optional[StrictStr] = Field(default=None, description="Indicates the status of the campaign's voucher generation.") + readonly: Optional[StrictBool] = Field(default=None, description="Indicates whether the campaign can be only read by a restricted user in the Areas and Stores enterprise feature. It is returned only to restricted users; this field is not returned for users with other roles.") protected: Optional[StrictBool] = Field(default=None, description="Indicates whether the resource can be deleted.") category_id: Optional[StrictStr] = Field(default=None, description="Unique category ID that this campaign belongs to.") categories: Optional[List[Category]] = Field(default=None, description="Contains details about the category.") @@ -65,7 +66,7 @@ class LoyaltiesCreateCampaignResponseBody(BaseModel): loyalty_tiers_expiration: Optional[LoyaltyTiersExpirationAll] = None validation_rules_assignments: Optional[ValidationRulesAssignmentsList] = None access_settings_assignments: Optional[AccessSettingsCampaignAssignmentsList] = None - __properties: ClassVar[List[str]] = ["id", "name", "description", "campaign_type", "type", "voucher", "auto_join", "join_once", "use_voucher_metadata_schema", "validity_timeframe", "validity_day_of_week", "validity_hours", "activity_duration_after_publishing", "vouchers_count", "start_date", "expiration_date", "active", "metadata", "created_at", "updated_at", "category", "creation_status", "vouchers_generation_status", "protected", "category_id", "categories", "object", "loyalty_tiers_expiration", "validation_rules_assignments", "access_settings_assignments"] + __properties: ClassVar[List[str]] = ["id", "name", "description", "campaign_type", "type", "voucher", "auto_join", "join_once", "use_voucher_metadata_schema", "validity_timeframe", "validity_day_of_week", "validity_hours", "activity_duration_after_publishing", "vouchers_count", "start_date", "expiration_date", "active", "metadata", "created_at", "updated_at", "category", "creation_status", "vouchers_generation_status", "readonly", "protected", "category_id", "categories", "object", "loyalty_tiers_expiration", "validation_rules_assignments", "access_settings_assignments"] @field_validator('campaign_type') def campaign_type_validate_enum(cls, value): @@ -277,6 +278,11 @@ def to_dict(self) -> Dict[str, Any]: if self.vouchers_generation_status is None and "vouchers_generation_status" in self.model_fields_set: _dict['vouchers_generation_status'] = None + # set to None if readonly (nullable) is None + # and model_fields_set contains the field + if self.readonly is None and "readonly" in self.model_fields_set: + _dict['readonly'] = None + # set to None if protected (nullable) is None # and model_fields_set contains the field if self.protected is None and "protected" in self.model_fields_set: @@ -332,6 +338,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "category": obj.get("category"), "creation_status": obj.get("creation_status"), "vouchers_generation_status": obj.get("vouchers_generation_status"), + "readonly": obj.get("readonly"), "protected": obj.get("protected"), "category_id": obj.get("category_id"), "categories": [Category.from_dict(_item) for _item in obj["categories"]] if obj.get("categories") is not None else None, diff --git a/voucherify/models/loyalties_get_campaign_response_body.py b/voucherify/models/loyalties_get_campaign_response_body.py index 7ce9849a..ad930b8a 100644 --- a/voucherify/models/loyalties_get_campaign_response_body.py +++ b/voucherify/models/loyalties_get_campaign_response_body.py @@ -58,6 +58,7 @@ class LoyaltiesGetCampaignResponseBody(BaseModel): category: Optional[StrictStr] = Field(default=None, description="Unique category name.") creation_status: Optional[StrictStr] = Field(default=None, description="Indicates the status of the campaign creation.") vouchers_generation_status: Optional[StrictStr] = Field(default=None, description="Indicates the status of the campaign's voucher generation.") + readonly: Optional[StrictBool] = Field(default=None, description="Indicates whether the campaign can be only read by a restricted user in the Areas and Stores enterprise feature. It is returned only to restricted users; this field is not returned for users with other roles.") protected: Optional[StrictBool] = Field(default=None, description="Indicates whether the resource can be deleted.") category_id: Optional[StrictStr] = Field(default=None, description="Unique category ID that this campaign belongs to.") categories: Optional[List[Category]] = Field(default=None, description="Contains details about the category.") @@ -65,7 +66,7 @@ class LoyaltiesGetCampaignResponseBody(BaseModel): loyalty_tiers_expiration: Optional[LoyaltyTiersExpirationAll] = None validation_rules_assignments: Optional[ValidationRulesAssignmentsList] = None access_settings_assignments: Optional[AccessSettingsCampaignAssignmentsList] = None - __properties: ClassVar[List[str]] = ["id", "name", "description", "campaign_type", "type", "voucher", "auto_join", "join_once", "use_voucher_metadata_schema", "validity_timeframe", "validity_day_of_week", "validity_hours", "activity_duration_after_publishing", "vouchers_count", "start_date", "expiration_date", "active", "metadata", "created_at", "updated_at", "category", "creation_status", "vouchers_generation_status", "protected", "category_id", "categories", "object", "loyalty_tiers_expiration", "validation_rules_assignments", "access_settings_assignments"] + __properties: ClassVar[List[str]] = ["id", "name", "description", "campaign_type", "type", "voucher", "auto_join", "join_once", "use_voucher_metadata_schema", "validity_timeframe", "validity_day_of_week", "validity_hours", "activity_duration_after_publishing", "vouchers_count", "start_date", "expiration_date", "active", "metadata", "created_at", "updated_at", "category", "creation_status", "vouchers_generation_status", "readonly", "protected", "category_id", "categories", "object", "loyalty_tiers_expiration", "validation_rules_assignments", "access_settings_assignments"] @field_validator('campaign_type') def campaign_type_validate_enum(cls, value): @@ -277,6 +278,11 @@ def to_dict(self) -> Dict[str, Any]: if self.vouchers_generation_status is None and "vouchers_generation_status" in self.model_fields_set: _dict['vouchers_generation_status'] = None + # set to None if readonly (nullable) is None + # and model_fields_set contains the field + if self.readonly is None and "readonly" in self.model_fields_set: + _dict['readonly'] = None + # set to None if protected (nullable) is None # and model_fields_set contains the field if self.protected is None and "protected" in self.model_fields_set: @@ -332,6 +338,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "category": obj.get("category"), "creation_status": obj.get("creation_status"), "vouchers_generation_status": obj.get("vouchers_generation_status"), + "readonly": obj.get("readonly"), "protected": obj.get("protected"), "category_id": obj.get("category_id"), "categories": [Category.from_dict(_item) for _item in obj["categories"]] if obj.get("categories") is not None else None, diff --git a/voucherify/models/loyalties_update_campaign_response_body.py b/voucherify/models/loyalties_update_campaign_response_body.py index 87663f9e..31f48ea9 100644 --- a/voucherify/models/loyalties_update_campaign_response_body.py +++ b/voucherify/models/loyalties_update_campaign_response_body.py @@ -58,6 +58,7 @@ class LoyaltiesUpdateCampaignResponseBody(BaseModel): category: Optional[StrictStr] = Field(default=None, description="Unique category name.") creation_status: Optional[StrictStr] = Field(default=None, description="Indicates the status of the campaign creation.") vouchers_generation_status: Optional[StrictStr] = Field(default=None, description="Indicates the status of the campaign's voucher generation.") + readonly: Optional[StrictBool] = Field(default=None, description="Indicates whether the campaign can be only read by a restricted user in the Areas and Stores enterprise feature. It is returned only to restricted users; this field is not returned for users with other roles.") protected: Optional[StrictBool] = Field(default=None, description="Indicates whether the resource can be deleted.") category_id: Optional[StrictStr] = Field(default=None, description="Unique category ID that this campaign belongs to.") categories: Optional[List[Category]] = Field(default=None, description="Contains details about the category.") @@ -65,7 +66,7 @@ class LoyaltiesUpdateCampaignResponseBody(BaseModel): loyalty_tiers_expiration: Optional[LoyaltyTiersExpirationAll] = None validation_rules_assignments: Optional[ValidationRulesAssignmentsList] = None access_settings_assignments: Optional[AccessSettingsCampaignAssignmentsList] = None - __properties: ClassVar[List[str]] = ["id", "name", "description", "campaign_type", "type", "voucher", "auto_join", "join_once", "use_voucher_metadata_schema", "validity_timeframe", "validity_day_of_week", "validity_hours", "activity_duration_after_publishing", "vouchers_count", "start_date", "expiration_date", "active", "metadata", "created_at", "updated_at", "category", "creation_status", "vouchers_generation_status", "protected", "category_id", "categories", "object", "loyalty_tiers_expiration", "validation_rules_assignments", "access_settings_assignments"] + __properties: ClassVar[List[str]] = ["id", "name", "description", "campaign_type", "type", "voucher", "auto_join", "join_once", "use_voucher_metadata_schema", "validity_timeframe", "validity_day_of_week", "validity_hours", "activity_duration_after_publishing", "vouchers_count", "start_date", "expiration_date", "active", "metadata", "created_at", "updated_at", "category", "creation_status", "vouchers_generation_status", "readonly", "protected", "category_id", "categories", "object", "loyalty_tiers_expiration", "validation_rules_assignments", "access_settings_assignments"] @field_validator('campaign_type') def campaign_type_validate_enum(cls, value): @@ -277,6 +278,11 @@ def to_dict(self) -> Dict[str, Any]: if self.vouchers_generation_status is None and "vouchers_generation_status" in self.model_fields_set: _dict['vouchers_generation_status'] = None + # set to None if readonly (nullable) is None + # and model_fields_set contains the field + if self.readonly is None and "readonly" in self.model_fields_set: + _dict['readonly'] = None + # set to None if protected (nullable) is None # and model_fields_set contains the field if self.protected is None and "protected" in self.model_fields_set: @@ -332,6 +338,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "category": obj.get("category"), "creation_status": obj.get("creation_status"), "vouchers_generation_status": obj.get("vouchers_generation_status"), + "readonly": obj.get("readonly"), "protected": obj.get("protected"), "category_id": obj.get("category_id"), "categories": [Category.from_dict(_item) for _item in obj["categories"]] if obj.get("categories") is not None else None, diff --git a/voucherify/models/loyalty_campaign.py b/voucherify/models/loyalty_campaign.py index a3474a76..14844d1c 100644 --- a/voucherify/models/loyalty_campaign.py +++ b/voucherify/models/loyalty_campaign.py @@ -58,6 +58,7 @@ class LoyaltyCampaign(BaseModel): category: Optional[StrictStr] = Field(default=None, description="Unique category name.") creation_status: Optional[StrictStr] = Field(default=None, description="Indicates the status of the campaign creation.") vouchers_generation_status: Optional[StrictStr] = Field(default=None, description="Indicates the status of the campaign's voucher generation.") + readonly: Optional[StrictBool] = Field(default=None, description="Indicates whether the campaign can be only read by a restricted user in the Areas and Stores enterprise feature. It is returned only to restricted users; this field is not returned for users with other roles.") protected: Optional[StrictBool] = Field(default=None, description="Indicates whether the resource can be deleted.") category_id: Optional[StrictStr] = Field(default=None, description="Unique category ID that this campaign belongs to.") categories: Optional[List[Category]] = Field(default=None, description="Contains details about the category.") @@ -65,7 +66,7 @@ class LoyaltyCampaign(BaseModel): loyalty_tiers_expiration: Optional[LoyaltyTiersExpirationAll] = None validation_rules_assignments: Optional[ValidationRulesAssignmentsList] = None access_settings_assignments: Optional[AccessSettingsCampaignAssignmentsList] = None - __properties: ClassVar[List[str]] = ["id", "name", "description", "campaign_type", "type", "voucher", "auto_join", "join_once", "use_voucher_metadata_schema", "validity_timeframe", "validity_day_of_week", "validity_hours", "activity_duration_after_publishing", "vouchers_count", "start_date", "expiration_date", "active", "metadata", "created_at", "updated_at", "category", "creation_status", "vouchers_generation_status", "protected", "category_id", "categories", "object", "loyalty_tiers_expiration", "validation_rules_assignments", "access_settings_assignments"] + __properties: ClassVar[List[str]] = ["id", "name", "description", "campaign_type", "type", "voucher", "auto_join", "join_once", "use_voucher_metadata_schema", "validity_timeframe", "validity_day_of_week", "validity_hours", "activity_duration_after_publishing", "vouchers_count", "start_date", "expiration_date", "active", "metadata", "created_at", "updated_at", "category", "creation_status", "vouchers_generation_status", "readonly", "protected", "category_id", "categories", "object", "loyalty_tiers_expiration", "validation_rules_assignments", "access_settings_assignments"] @field_validator('campaign_type') def campaign_type_validate_enum(cls, value): @@ -277,6 +278,11 @@ def to_dict(self) -> Dict[str, Any]: if self.vouchers_generation_status is None and "vouchers_generation_status" in self.model_fields_set: _dict['vouchers_generation_status'] = None + # set to None if readonly (nullable) is None + # and model_fields_set contains the field + if self.readonly is None and "readonly" in self.model_fields_set: + _dict['readonly'] = None + # set to None if protected (nullable) is None # and model_fields_set contains the field if self.protected is None and "protected" in self.model_fields_set: @@ -332,6 +338,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "category": obj.get("category"), "creation_status": obj.get("creation_status"), "vouchers_generation_status": obj.get("vouchers_generation_status"), + "readonly": obj.get("readonly"), "protected": obj.get("protected"), "category_id": obj.get("category_id"), "categories": [Category.from_dict(_item) for _item in obj["categories"]] if obj.get("categories") is not None else None, diff --git a/voucherify/models/management_project.py b/voucherify/models/management_project.py new file mode 100644 index 00000000..12efc474 --- /dev/null +++ b/voucherify/models/management_project.py @@ -0,0 +1,283 @@ +# coding: utf-8 + +""" + Voucherify API + + Voucherify promotion engine REST API. Please see https://docs.voucherify.io/docs for more details. + + The version of the OpenAPI document: v2018-08-01 + Contact: support@voucherify.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from voucherify.models.management_project_api_usage_notifications import ManagementProjectApiUsageNotifications +from voucherify.models.management_project_default_code_config import ManagementProjectDefaultCodeConfig +from voucherify.models.management_project_limits import ManagementProjectLimits +from voucherify.models.management_project_webhooks_callout_notifications import ManagementProjectWebhooksCalloutNotifications +from typing import Optional, Set +from typing_extensions import Self + +class ManagementProject(BaseModel): + """ + ManagementProject + """ # noqa: E501 + id: Optional[StrictStr] = Field(default=None, description="Unique identifier of the project.") + name: Optional[StrictStr] = Field(default=None, description="The name of the project.") + description: Optional[StrictStr] = Field(default=None, description="A user-defined description of the project, e.g. its purpose, scope, region.") + timezone: Optional[StrictStr] = Field(default=None, description="The time zone in which the project is established. It can be in the GMT format or in accordance with IANA time zone database.") + currency: Optional[StrictStr] = Field(default=None, description="The currency used in the project. It is equal to a 3-letter ISO 4217 code.") + dial_code: Optional[StrictStr] = Field(default=None, description="The country dial code for the project. It is equal to an ITU country code.") + webhook_version: Optional[StrictStr] = Field(default='v2024-01-01', description="The webhook version used in the project.") + client_trusted_domains: Optional[List[StrictStr]] = Field(default=None, description="An array of URL addresses that allow client requests.") + client_redeem_enabled: Optional[StrictBool] = Field(default=None, description="Enables client-side redemption.") + client_publish_enabled: Optional[StrictBool] = Field(default=None, description="Enables client-side publication.") + client_list_vouchers_enabled: Optional[StrictBool] = Field(default=None, description="Enables client-side listing of vouchers.") + client_create_customer_enabled: Optional[StrictBool] = Field(default=None, description="Enables client-side creation of customers.") + client_loyalty_events_enabled: Optional[StrictBool] = Field(default=None, description="Enables client-side events for loyalty and referral programs.") + client_set_voucher_expiration_date_enabled: Optional[StrictBool] = Field(default=None, description="Enables client-side setting of voucher expiration date.") + api_usage_notifications: Optional[ManagementProjectApiUsageNotifications] = None + webhooks_callout_notifications: Optional[ManagementProjectWebhooksCalloutNotifications] = None + cluster_id: Optional[StrictStr] = Field(default=None, description="The identifier of the cluster where the project will be created.") + case_sensitive_codes: Optional[StrictBool] = Field(default=None, description="Determines if the vouchers in the project will be: - case sensitive - if `true`, `C0dE-cfV` is **not** equal to `c0de-cfv`), - case insensitive - if `false`, `C0dE-cfV` is equal to `c0de-cfv`.") + api_version: Optional[StrictStr] = Field(default='v2018-08-01', description="The API version used in the project. Currently, the default and only value is `v2018-08-01`.") + is_sandbox: Optional[StrictBool] = Field(default=None, description="Determines if the project is a sandbox project.") + webhook_token: Optional[StrictStr] = Field(default=None, description="Webhook token used for authentication.") + default_code_config: Optional[ManagementProjectDefaultCodeConfig] = None + limits: Optional[ManagementProjectLimits] = None + __properties: ClassVar[List[str]] = ["id", "name", "description", "timezone", "currency", "dial_code", "webhook_version", "client_trusted_domains", "client_redeem_enabled", "client_publish_enabled", "client_list_vouchers_enabled", "client_create_customer_enabled", "client_loyalty_events_enabled", "client_set_voucher_expiration_date_enabled", "api_usage_notifications", "webhooks_callout_notifications", "cluster_id", "case_sensitive_codes", "api_version", "is_sandbox", "webhook_token", "default_code_config", "limits"] + + @field_validator('webhook_version') + def webhook_version_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['v2024-01-01']): + raise ValueError("must be one of enum values ('v2024-01-01')") + return value + + @field_validator('api_version') + def api_version_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['v2018-08-01']): + raise ValueError("must be one of enum values ('v2018-08-01')") + return value + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ManagementProject from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of api_usage_notifications + if self.api_usage_notifications: + _dict['api_usage_notifications'] = self.api_usage_notifications.to_dict() + # override the default output from pydantic by calling `to_dict()` of webhooks_callout_notifications + if self.webhooks_callout_notifications: + _dict['webhooks_callout_notifications'] = self.webhooks_callout_notifications.to_dict() + # override the default output from pydantic by calling `to_dict()` of default_code_config + if self.default_code_config: + _dict['default_code_config'] = self.default_code_config.to_dict() + # override the default output from pydantic by calling `to_dict()` of limits + if self.limits: + _dict['limits'] = self.limits.to_dict() + # set to None if id (nullable) is None + # and model_fields_set contains the field + if self.id is None and "id" in self.model_fields_set: + _dict['id'] = None + + # set to None if name (nullable) is None + # and model_fields_set contains the field + if self.name is None and "name" in self.model_fields_set: + _dict['name'] = None + + # set to None if description (nullable) is None + # and model_fields_set contains the field + if self.description is None and "description" in self.model_fields_set: + _dict['description'] = None + + # set to None if timezone (nullable) is None + # and model_fields_set contains the field + if self.timezone is None and "timezone" in self.model_fields_set: + _dict['timezone'] = None + + # set to None if currency (nullable) is None + # and model_fields_set contains the field + if self.currency is None and "currency" in self.model_fields_set: + _dict['currency'] = None + + # set to None if dial_code (nullable) is None + # and model_fields_set contains the field + if self.dial_code is None and "dial_code" in self.model_fields_set: + _dict['dial_code'] = None + + # set to None if webhook_version (nullable) is None + # and model_fields_set contains the field + if self.webhook_version is None and "webhook_version" in self.model_fields_set: + _dict['webhook_version'] = None + + # set to None if client_trusted_domains (nullable) is None + # and model_fields_set contains the field + if self.client_trusted_domains is None and "client_trusted_domains" in self.model_fields_set: + _dict['client_trusted_domains'] = None + + # set to None if client_redeem_enabled (nullable) is None + # and model_fields_set contains the field + if self.client_redeem_enabled is None and "client_redeem_enabled" in self.model_fields_set: + _dict['client_redeem_enabled'] = None + + # set to None if client_publish_enabled (nullable) is None + # and model_fields_set contains the field + if self.client_publish_enabled is None and "client_publish_enabled" in self.model_fields_set: + _dict['client_publish_enabled'] = None + + # set to None if client_list_vouchers_enabled (nullable) is None + # and model_fields_set contains the field + if self.client_list_vouchers_enabled is None and "client_list_vouchers_enabled" in self.model_fields_set: + _dict['client_list_vouchers_enabled'] = None + + # set to None if client_create_customer_enabled (nullable) is None + # and model_fields_set contains the field + if self.client_create_customer_enabled is None and "client_create_customer_enabled" in self.model_fields_set: + _dict['client_create_customer_enabled'] = None + + # set to None if client_loyalty_events_enabled (nullable) is None + # and model_fields_set contains the field + if self.client_loyalty_events_enabled is None and "client_loyalty_events_enabled" in self.model_fields_set: + _dict['client_loyalty_events_enabled'] = None + + # set to None if client_set_voucher_expiration_date_enabled (nullable) is None + # and model_fields_set contains the field + if self.client_set_voucher_expiration_date_enabled is None and "client_set_voucher_expiration_date_enabled" in self.model_fields_set: + _dict['client_set_voucher_expiration_date_enabled'] = None + + # set to None if api_usage_notifications (nullable) is None + # and model_fields_set contains the field + if self.api_usage_notifications is None and "api_usage_notifications" in self.model_fields_set: + _dict['api_usage_notifications'] = None + + # set to None if webhooks_callout_notifications (nullable) is None + # and model_fields_set contains the field + if self.webhooks_callout_notifications is None and "webhooks_callout_notifications" in self.model_fields_set: + _dict['webhooks_callout_notifications'] = None + + # set to None if cluster_id (nullable) is None + # and model_fields_set contains the field + if self.cluster_id is None and "cluster_id" in self.model_fields_set: + _dict['cluster_id'] = None + + # set to None if case_sensitive_codes (nullable) is None + # and model_fields_set contains the field + if self.case_sensitive_codes is None and "case_sensitive_codes" in self.model_fields_set: + _dict['case_sensitive_codes'] = None + + # set to None if api_version (nullable) is None + # and model_fields_set contains the field + if self.api_version is None and "api_version" in self.model_fields_set: + _dict['api_version'] = None + + # set to None if is_sandbox (nullable) is None + # and model_fields_set contains the field + if self.is_sandbox is None and "is_sandbox" in self.model_fields_set: + _dict['is_sandbox'] = None + + # set to None if webhook_token (nullable) is None + # and model_fields_set contains the field + if self.webhook_token is None and "webhook_token" in self.model_fields_set: + _dict['webhook_token'] = None + + # set to None if default_code_config (nullable) is None + # and model_fields_set contains the field + if self.default_code_config is None and "default_code_config" in self.model_fields_set: + _dict['default_code_config'] = None + + # set to None if limits (nullable) is None + # and model_fields_set contains the field + if self.limits is None and "limits" in self.model_fields_set: + _dict['limits'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ManagementProject from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id"), + "name": obj.get("name"), + "description": obj.get("description"), + "timezone": obj.get("timezone"), + "currency": obj.get("currency"), + "dial_code": obj.get("dial_code"), + "webhook_version": obj.get("webhook_version") if obj.get("webhook_version") is not None else 'v2024-01-01', + "client_trusted_domains": obj.get("client_trusted_domains"), + "client_redeem_enabled": obj.get("client_redeem_enabled"), + "client_publish_enabled": obj.get("client_publish_enabled"), + "client_list_vouchers_enabled": obj.get("client_list_vouchers_enabled"), + "client_create_customer_enabled": obj.get("client_create_customer_enabled"), + "client_loyalty_events_enabled": obj.get("client_loyalty_events_enabled"), + "client_set_voucher_expiration_date_enabled": obj.get("client_set_voucher_expiration_date_enabled"), + "api_usage_notifications": ManagementProjectApiUsageNotifications.from_dict(obj["api_usage_notifications"]) if obj.get("api_usage_notifications") is not None else None, + "webhooks_callout_notifications": ManagementProjectWebhooksCalloutNotifications.from_dict(obj["webhooks_callout_notifications"]) if obj.get("webhooks_callout_notifications") is not None else None, + "cluster_id": obj.get("cluster_id"), + "case_sensitive_codes": obj.get("case_sensitive_codes"), + "api_version": obj.get("api_version") if obj.get("api_version") is not None else 'v2018-08-01', + "is_sandbox": obj.get("is_sandbox"), + "webhook_token": obj.get("webhook_token"), + "default_code_config": ManagementProjectDefaultCodeConfig.from_dict(obj["default_code_config"]) if obj.get("default_code_config") is not None else None, + "limits": ManagementProjectLimits.from_dict(obj["limits"]) if obj.get("limits") is not None else None + }) + return _obj + + diff --git a/voucherify/models/management_project_api_usage_notifications.py b/voucherify/models/management_project_api_usage_notifications.py new file mode 100644 index 00000000..9708928f --- /dev/null +++ b/voucherify/models/management_project_api_usage_notifications.py @@ -0,0 +1,117 @@ +# coding: utf-8 + +""" + Voucherify API + + Voucherify promotion engine REST API. Please see https://docs.voucherify.io/docs for more details. + + The version of the OpenAPI document: v2018-08-01 + Contact: support@voucherify.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict +from typing import Any, ClassVar, Dict, List, Optional +from voucherify.models.usage_notifications import UsageNotifications +from typing import Optional, Set +from typing_extensions import Self + +class ManagementProjectApiUsageNotifications(BaseModel): + """ + Determines the notification settings. + """ # noqa: E501 + redemptions: Optional[UsageNotifications] = None + messages: Optional[UsageNotifications] = None + api_calls: Optional[UsageNotifications] = None + bulk_api_calls: Optional[UsageNotifications] = None + webhook_calls: Optional[UsageNotifications] = None + cycle_calls: Optional[UsageNotifications] = None + __properties: ClassVar[List[str]] = ["redemptions", "messages", "api_calls", "bulk_api_calls", "webhook_calls", "cycle_calls"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ManagementProjectApiUsageNotifications from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of redemptions + if self.redemptions: + _dict['redemptions'] = self.redemptions.to_dict() + # override the default output from pydantic by calling `to_dict()` of messages + if self.messages: + _dict['messages'] = self.messages.to_dict() + # override the default output from pydantic by calling `to_dict()` of api_calls + if self.api_calls: + _dict['api_calls'] = self.api_calls.to_dict() + # override the default output from pydantic by calling `to_dict()` of bulk_api_calls + if self.bulk_api_calls: + _dict['bulk_api_calls'] = self.bulk_api_calls.to_dict() + # override the default output from pydantic by calling `to_dict()` of webhook_calls + if self.webhook_calls: + _dict['webhook_calls'] = self.webhook_calls.to_dict() + # override the default output from pydantic by calling `to_dict()` of cycle_calls + if self.cycle_calls: + _dict['cycle_calls'] = self.cycle_calls.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ManagementProjectApiUsageNotifications from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "redemptions": UsageNotifications.from_dict(obj["redemptions"]) if obj.get("redemptions") is not None else None, + "messages": UsageNotifications.from_dict(obj["messages"]) if obj.get("messages") is not None else None, + "api_calls": UsageNotifications.from_dict(obj["api_calls"]) if obj.get("api_calls") is not None else None, + "bulk_api_calls": UsageNotifications.from_dict(obj["bulk_api_calls"]) if obj.get("bulk_api_calls") is not None else None, + "webhook_calls": UsageNotifications.from_dict(obj["webhook_calls"]) if obj.get("webhook_calls") is not None else None, + "cycle_calls": UsageNotifications.from_dict(obj["cycle_calls"]) if obj.get("cycle_calls") is not None else None + }) + return _obj + + diff --git a/voucherify/models/management_project_default_code_config.py b/voucherify/models/management_project_default_code_config.py new file mode 100644 index 00000000..1c3d2d8e --- /dev/null +++ b/voucherify/models/management_project_default_code_config.py @@ -0,0 +1,93 @@ +# coding: utf-8 + +""" + Voucherify API + + Voucherify promotion engine REST API. Please see https://docs.voucherify.io/docs for more details. + + The version of the OpenAPI document: v2018-08-01 + Contact: support@voucherify.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class ManagementProjectDefaultCodeConfig(BaseModel): + """ + Determines the character set that is used as default for vouchers. It is affected by the `\"case_sensitive_codes\"` setting. + """ # noqa: E501 + charset: Optional[StrictStr] = Field(default=None, description="Lists all characters that are used as default for vouchers") + __properties: ClassVar[List[str]] = ["charset"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ManagementProjectDefaultCodeConfig from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if charset (nullable) is None + # and model_fields_set contains the field + if self.charset is None and "charset" in self.model_fields_set: + _dict['charset'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ManagementProjectDefaultCodeConfig from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "charset": obj.get("charset") + }) + return _obj + + diff --git a/voucherify/models/management_project_limits.py b/voucherify/models/management_project_limits.py new file mode 100644 index 00000000..05ffadec --- /dev/null +++ b/voucherify/models/management_project_limits.py @@ -0,0 +1,116 @@ +# coding: utf-8 + +""" + Voucherify API + + Voucherify promotion engine REST API. Please see https://docs.voucherify.io/docs for more details. + + The version of the OpenAPI document: v2018-08-01 + Contact: support@voucherify.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict +from typing import Any, ClassVar, Dict, List, Optional +from voucherify.models.management_project_limits_api_calls_item import ManagementProjectLimitsApiCallsItem +from voucherify.models.management_project_limits_bulk_api_calls_item import ManagementProjectLimitsBulkApiCallsItem +from typing import Optional, Set +from typing_extensions import Self + +class ManagementProjectLimits(BaseModel): + """ + Determines additional limits set on a given project, e.g. the Sandbox project. If no limits are returned, the limits set for the whole organization apply. + """ # noqa: E501 + api_calls: Optional[List[ManagementProjectLimitsApiCallsItem]] = None + bulk_api_calls: Optional[List[ManagementProjectLimitsBulkApiCallsItem]] = None + __properties: ClassVar[List[str]] = ["api_calls", "bulk_api_calls"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ManagementProjectLimits from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in api_calls (list) + _items = [] + if self.api_calls: + for _item_api_calls in self.api_calls: + if _item_api_calls: + _items.append(_item_api_calls.to_dict()) + _dict['api_calls'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in bulk_api_calls (list) + _items = [] + if self.bulk_api_calls: + for _item_bulk_api_calls in self.bulk_api_calls: + if _item_bulk_api_calls: + _items.append(_item_bulk_api_calls.to_dict()) + _dict['bulk_api_calls'] = _items + # set to None if api_calls (nullable) is None + # and model_fields_set contains the field + if self.api_calls is None and "api_calls" in self.model_fields_set: + _dict['api_calls'] = None + + # set to None if bulk_api_calls (nullable) is None + # and model_fields_set contains the field + if self.bulk_api_calls is None and "bulk_api_calls" in self.model_fields_set: + _dict['bulk_api_calls'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ManagementProjectLimits from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "api_calls": [ManagementProjectLimitsApiCallsItem.from_dict(_item) for _item in obj["api_calls"]] if obj.get("api_calls") is not None else None, + "bulk_api_calls": [ManagementProjectLimitsBulkApiCallsItem.from_dict(_item) for _item in obj["bulk_api_calls"]] if obj.get("bulk_api_calls") is not None else None + }) + return _obj + + diff --git a/voucherify/models/management_project_limits_api_calls_item.py b/voucherify/models/management_project_limits_api_calls_item.py new file mode 100644 index 00000000..f12a9e0a --- /dev/null +++ b/voucherify/models/management_project_limits_api_calls_item.py @@ -0,0 +1,90 @@ +# coding: utf-8 + +""" + Voucherify API + + Voucherify promotion engine REST API. Please see https://docs.voucherify.io/docs for more details. + + The version of the OpenAPI document: v2018-08-01 + Contact: support@voucherify.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class ManagementProjectLimitsApiCallsItem(BaseModel): + """ + Determines the limit of API calls per given unit time. + """ # noqa: E501 + value: Optional[StrictInt] = Field(default=None, description="Determines the maximum number of API calls per time set in `\"duration\"`.") + duration: Optional[StrictStr] = Field(default=None, description="Determines the amount of time during which the calls up to the number specified in the `value` can be made. The duration is presented in the ISO 8601 format, e.g. `PT1H` means one hour.") + __properties: ClassVar[List[str]] = ["value", "duration"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ManagementProjectLimitsApiCallsItem from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ManagementProjectLimitsApiCallsItem from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "value": obj.get("value"), + "duration": obj.get("duration") + }) + return _obj + + diff --git a/voucherify/models/management_project_limits_bulk_api_calls_item.py b/voucherify/models/management_project_limits_bulk_api_calls_item.py new file mode 100644 index 00000000..c7a3258e --- /dev/null +++ b/voucherify/models/management_project_limits_bulk_api_calls_item.py @@ -0,0 +1,90 @@ +# coding: utf-8 + +""" + Voucherify API + + Voucherify promotion engine REST API. Please see https://docs.voucherify.io/docs for more details. + + The version of the OpenAPI document: v2018-08-01 + Contact: support@voucherify.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class ManagementProjectLimitsBulkApiCallsItem(BaseModel): + """ + + """ # noqa: E501 + value: Optional[StrictInt] = Field(default=None, description="Determines the maximum number of API calls per time set in `\"duration\"`.") + duration: Optional[StrictStr] = Field(default=None, description="Determines the amount of time during which the calls up to the number specified in the `value` can be made. The duration is presented in the ISO 8601 format, e.g. `PT1H` means one hour.") + __properties: ClassVar[List[str]] = ["value", "duration"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ManagementProjectLimitsBulkApiCallsItem from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ManagementProjectLimitsBulkApiCallsItem from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "value": obj.get("value"), + "duration": obj.get("duration") + }) + return _obj + + diff --git a/voucherify/models/management_project_webhooks_callout_notifications.py b/voucherify/models/management_project_webhooks_callout_notifications.py new file mode 100644 index 00000000..f15fbdf8 --- /dev/null +++ b/voucherify/models/management_project_webhooks_callout_notifications.py @@ -0,0 +1,108 @@ +# coding: utf-8 + +""" + Voucherify API + + Voucherify promotion engine REST API. Please see https://docs.voucherify.io/docs for more details. + + The version of the OpenAPI document: v2018-08-01 + Contact: support@voucherify.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict +from typing import Any, ClassVar, Dict, List, Optional +from voucherify.models.management_project_webhooks_callout_notifications_distributions import ManagementProjectWebhooksCalloutNotificationsDistributions +from voucherify.models.management_project_webhooks_callout_notifications_webhooks import ManagementProjectWebhooksCalloutNotificationsWebhooks +from typing import Optional, Set +from typing_extensions import Self + +class ManagementProjectWebhooksCalloutNotifications(BaseModel): + """ + Determines the notification settings for webhook callouts configured in Distributions and Project settings. + """ # noqa: E501 + distributions: Optional[ManagementProjectWebhooksCalloutNotificationsDistributions] = None + webhooks: Optional[ManagementProjectWebhooksCalloutNotificationsWebhooks] = None + __properties: ClassVar[List[str]] = ["distributions", "webhooks"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ManagementProjectWebhooksCalloutNotifications from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of distributions + if self.distributions: + _dict['distributions'] = self.distributions.to_dict() + # override the default output from pydantic by calling `to_dict()` of webhooks + if self.webhooks: + _dict['webhooks'] = self.webhooks.to_dict() + # set to None if distributions (nullable) is None + # and model_fields_set contains the field + if self.distributions is None and "distributions" in self.model_fields_set: + _dict['distributions'] = None + + # set to None if webhooks (nullable) is None + # and model_fields_set contains the field + if self.webhooks is None and "webhooks" in self.model_fields_set: + _dict['webhooks'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ManagementProjectWebhooksCalloutNotifications from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "distributions": ManagementProjectWebhooksCalloutNotificationsDistributions.from_dict(obj["distributions"]) if obj.get("distributions") is not None else None, + "webhooks": ManagementProjectWebhooksCalloutNotificationsWebhooks.from_dict(obj["webhooks"]) if obj.get("webhooks") is not None else None + }) + return _obj + + diff --git a/voucherify/models/management_project_webhooks_callout_notifications_distributions.py b/voucherify/models/management_project_webhooks_callout_notifications_distributions.py new file mode 100644 index 00000000..12ca0f30 --- /dev/null +++ b/voucherify/models/management_project_webhooks_callout_notifications_distributions.py @@ -0,0 +1,107 @@ +# coding: utf-8 + +""" + Voucherify API + + Voucherify promotion engine REST API. Please see https://docs.voucherify.io/docs for more details. + + The version of the OpenAPI document: v2018-08-01 + Contact: support@voucherify.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class ManagementProjectWebhooksCalloutNotificationsDistributions(BaseModel): + """ + Determines the notification settings for webhooks sent through Distributions. + """ # noqa: E501 + email: Optional[StrictBool] = Field(default=None, description="Enables the notification through an email.") + in_app: Optional[StrictBool] = Field(default=None, description="Enables the notification through an email.") + emails: Optional[List[StrictStr]] = Field(default=None, description="An array of email addresses which will receive the notification.") + __properties: ClassVar[List[str]] = ["email", "in_app", "emails"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ManagementProjectWebhooksCalloutNotificationsDistributions from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if email (nullable) is None + # and model_fields_set contains the field + if self.email is None and "email" in self.model_fields_set: + _dict['email'] = None + + # set to None if in_app (nullable) is None + # and model_fields_set contains the field + if self.in_app is None and "in_app" in self.model_fields_set: + _dict['in_app'] = None + + # set to None if emails (nullable) is None + # and model_fields_set contains the field + if self.emails is None and "emails" in self.model_fields_set: + _dict['emails'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ManagementProjectWebhooksCalloutNotificationsDistributions from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "email": obj.get("email"), + "in_app": obj.get("in_app"), + "emails": obj.get("emails") + }) + return _obj + + diff --git a/voucherify/models/management_project_webhooks_callout_notifications_webhooks.py b/voucherify/models/management_project_webhooks_callout_notifications_webhooks.py new file mode 100644 index 00000000..477ace11 --- /dev/null +++ b/voucherify/models/management_project_webhooks_callout_notifications_webhooks.py @@ -0,0 +1,107 @@ +# coding: utf-8 + +""" + Voucherify API + + Voucherify promotion engine REST API. Please see https://docs.voucherify.io/docs for more details. + + The version of the OpenAPI document: v2018-08-01 + Contact: support@voucherify.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class ManagementProjectWebhooksCalloutNotificationsWebhooks(BaseModel): + """ + Determines the notification settings for webhooks sent as set out in the Project settings. + """ # noqa: E501 + email: Optional[StrictBool] = Field(default=None, description="Enables the notification through an email.") + in_app: Optional[StrictBool] = Field(default=None, description="Enables the notification through an email.") + emails: Optional[List[StrictStr]] = Field(default=None, description="An array of email addresses which will receive the notification.") + __properties: ClassVar[List[str]] = ["email", "in_app", "emails"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ManagementProjectWebhooksCalloutNotificationsWebhooks from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if email (nullable) is None + # and model_fields_set contains the field + if self.email is None and "email" in self.model_fields_set: + _dict['email'] = None + + # set to None if in_app (nullable) is None + # and model_fields_set contains the field + if self.in_app is None and "in_app" in self.model_fields_set: + _dict['in_app'] = None + + # set to None if emails (nullable) is None + # and model_fields_set contains the field + if self.emails is None and "emails" in self.model_fields_set: + _dict['emails'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ManagementProjectWebhooksCalloutNotificationsWebhooks from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "email": obj.get("email"), + "in_app": obj.get("in_app"), + "emails": obj.get("emails") + }) + return _obj + + diff --git a/voucherify/models/management_projects_branding.py b/voucherify/models/management_projects_branding.py new file mode 100644 index 00000000..ee850a41 --- /dev/null +++ b/voucherify/models/management_projects_branding.py @@ -0,0 +1,137 @@ +# coding: utf-8 + +""" + Voucherify API + + Voucherify promotion engine REST API. Please see https://docs.voucherify.io/docs for more details. + + The version of the OpenAPI document: v2018-08-01 + Contact: support@voucherify.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from voucherify.models.management_projects_branding_address import ManagementProjectsBrandingAddress +from voucherify.models.management_projects_branding_brand import ManagementProjectsBrandingBrand +from voucherify.models.management_projects_branding_cockpits import ManagementProjectsBrandingCockpits +from voucherify.models.management_projects_branding_contact import ManagementProjectsBrandingContact +from typing import Optional, Set +from typing_extensions import Self + +class ManagementProjectsBranding(BaseModel): + """ + Response brand schema. + """ # noqa: E501 + id: Optional[StrictStr] = Field(default=None, description="Unique identifier of the brand configuration.") + brand: Optional[ManagementProjectsBrandingBrand] = None + address: Optional[ManagementProjectsBrandingAddress] = None + contact: Optional[ManagementProjectsBrandingContact] = None + cockpits: Optional[ManagementProjectsBrandingCockpits] = None + __properties: ClassVar[List[str]] = ["id", "brand", "address", "contact", "cockpits"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ManagementProjectsBranding from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of brand + if self.brand: + _dict['brand'] = self.brand.to_dict() + # override the default output from pydantic by calling `to_dict()` of address + if self.address: + _dict['address'] = self.address.to_dict() + # override the default output from pydantic by calling `to_dict()` of contact + if self.contact: + _dict['contact'] = self.contact.to_dict() + # override the default output from pydantic by calling `to_dict()` of cockpits + if self.cockpits: + _dict['cockpits'] = self.cockpits.to_dict() + # set to None if id (nullable) is None + # and model_fields_set contains the field + if self.id is None and "id" in self.model_fields_set: + _dict['id'] = None + + # set to None if brand (nullable) is None + # and model_fields_set contains the field + if self.brand is None and "brand" in self.model_fields_set: + _dict['brand'] = None + + # set to None if address (nullable) is None + # and model_fields_set contains the field + if self.address is None and "address" in self.model_fields_set: + _dict['address'] = None + + # set to None if contact (nullable) is None + # and model_fields_set contains the field + if self.contact is None and "contact" in self.model_fields_set: + _dict['contact'] = None + + # set to None if cockpits (nullable) is None + # and model_fields_set contains the field + if self.cockpits is None and "cockpits" in self.model_fields_set: + _dict['cockpits'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ManagementProjectsBranding from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id"), + "brand": ManagementProjectsBrandingBrand.from_dict(obj["brand"]) if obj.get("brand") is not None else None, + "address": ManagementProjectsBrandingAddress.from_dict(obj["address"]) if obj.get("address") is not None else None, + "contact": ManagementProjectsBrandingContact.from_dict(obj["contact"]) if obj.get("contact") is not None else None, + "cockpits": ManagementProjectsBrandingCockpits.from_dict(obj["cockpits"]) if obj.get("cockpits") is not None else None + }) + return _obj + + diff --git a/voucherify/models/management_projects_branding_address.py b/voucherify/models/management_projects_branding_address.py new file mode 100644 index 00000000..4c27226b --- /dev/null +++ b/voucherify/models/management_projects_branding_address.py @@ -0,0 +1,121 @@ +# coding: utf-8 + +""" + Voucherify API + + Voucherify promotion engine REST API. Please see https://docs.voucherify.io/docs for more details. + + The version of the OpenAPI document: v2018-08-01 + Contact: support@voucherify.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class ManagementProjectsBrandingAddress(BaseModel): + """ + Defines the address details. + """ # noqa: E501 + street: Optional[StrictStr] = Field(default=None, description="Defines the brand's street.") + city: Optional[StrictStr] = Field(default=None, description="Defines the brand's city.") + postal: Optional[StrictStr] = Field(default=None, description="Defines the brand's postal code.") + state: Optional[StrictStr] = Field(default=None, description="Defines the brand's state or similar administrative area.") + country: Optional[StrictStr] = Field(default=None, description="Defines the brand's country.") + __properties: ClassVar[List[str]] = ["street", "city", "postal", "state", "country"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ManagementProjectsBrandingAddress from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if street (nullable) is None + # and model_fields_set contains the field + if self.street is None and "street" in self.model_fields_set: + _dict['street'] = None + + # set to None if city (nullable) is None + # and model_fields_set contains the field + if self.city is None and "city" in self.model_fields_set: + _dict['city'] = None + + # set to None if postal (nullable) is None + # and model_fields_set contains the field + if self.postal is None and "postal" in self.model_fields_set: + _dict['postal'] = None + + # set to None if state (nullable) is None + # and model_fields_set contains the field + if self.state is None and "state" in self.model_fields_set: + _dict['state'] = None + + # set to None if country (nullable) is None + # and model_fields_set contains the field + if self.country is None and "country" in self.model_fields_set: + _dict['country'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ManagementProjectsBrandingAddress from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "street": obj.get("street"), + "city": obj.get("city"), + "postal": obj.get("postal"), + "state": obj.get("state"), + "country": obj.get("country") + }) + return _obj + + diff --git a/voucherify/models/management_projects_branding_brand.py b/voucherify/models/management_projects_branding_brand.py new file mode 100644 index 00000000..5bfb03c5 --- /dev/null +++ b/voucherify/models/management_projects_branding_brand.py @@ -0,0 +1,121 @@ +# coding: utf-8 + +""" + Voucherify API + + Voucherify promotion engine REST API. Please see https://docs.voucherify.io/docs for more details. + + The version of the OpenAPI document: v2018-08-01 + Contact: support@voucherify.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class ManagementProjectsBrandingBrand(BaseModel): + """ + Defines basic brand details. + """ # noqa: E501 + name: Optional[StrictStr] = Field(default=None, description="Defines brand name.") + privacy_policy_url: Optional[StrictStr] = Field(default=None, description="Defines the URL to the brand's privacy policy. It must be a valid URL format.") + terms_of_use_url: Optional[StrictStr] = Field(default=None, description="Defines the URL to the brand's terms of use. It must be a valid URL format.") + permission_reminder: Optional[StrictStr] = Field(default=None, description="Defines the message that is displayed to customers who opted in an email newsletter.") + website_url: Optional[StrictStr] = Field(default=None, description="Defines the URL to the brand's website. It must be a valid URL format.") + __properties: ClassVar[List[str]] = ["name", "privacy_policy_url", "terms_of_use_url", "permission_reminder", "website_url"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ManagementProjectsBrandingBrand from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if name (nullable) is None + # and model_fields_set contains the field + if self.name is None and "name" in self.model_fields_set: + _dict['name'] = None + + # set to None if privacy_policy_url (nullable) is None + # and model_fields_set contains the field + if self.privacy_policy_url is None and "privacy_policy_url" in self.model_fields_set: + _dict['privacy_policy_url'] = None + + # set to None if terms_of_use_url (nullable) is None + # and model_fields_set contains the field + if self.terms_of_use_url is None and "terms_of_use_url" in self.model_fields_set: + _dict['terms_of_use_url'] = None + + # set to None if permission_reminder (nullable) is None + # and model_fields_set contains the field + if self.permission_reminder is None and "permission_reminder" in self.model_fields_set: + _dict['permission_reminder'] = None + + # set to None if website_url (nullable) is None + # and model_fields_set contains the field + if self.website_url is None and "website_url" in self.model_fields_set: + _dict['website_url'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ManagementProjectsBrandingBrand from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "name": obj.get("name"), + "privacy_policy_url": obj.get("privacy_policy_url"), + "terms_of_use_url": obj.get("terms_of_use_url"), + "permission_reminder": obj.get("permission_reminder"), + "website_url": obj.get("website_url") + }) + return _obj + + diff --git a/voucherify/models/management_projects_branding_cockpits.py b/voucherify/models/management_projects_branding_cockpits.py new file mode 100644 index 00000000..5a943d9a --- /dev/null +++ b/voucherify/models/management_projects_branding_cockpits.py @@ -0,0 +1,152 @@ +# coding: utf-8 + +""" + Voucherify API + + Voucherify promotion engine REST API. Please see https://docs.voucherify.io/docs for more details. + + The version of the OpenAPI document: v2018-08-01 + Contact: support@voucherify.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class ManagementProjectsBrandingCockpits(BaseModel): + """ + Defines customer cockpit details. + """ # noqa: E501 + campaigns_overview_enabled: Optional[StrictBool] = Field(default=None, description="Enables the campaign overview for customers.") + loyalty_enabled: Optional[StrictBool] = Field(default=None, description="Enables the loyalty campaign overview for customers.") + gift_cards_enabled: Optional[StrictBool] = Field(default=None, description="Enables the gift card overview for customers.") + coupons_enabled: Optional[StrictBool] = Field(default=None, description="Enables the discount coupon overview for customers.") + referrals_enabled: Optional[StrictBool] = Field(default=None, description="Enables the referral campaign overview for customers.") + theme: Optional[StrictStr] = Field(default=None, description="Determines the color scheme of the customer cockpit.") + use_custom_double_opt_in_redirect_url: Optional[StrictBool] = Field(default=None, description="Enables the double opt-in option. It must be a valid URL format.") + custom_double_opt_in_redirect_url: Optional[StrictStr] = Field(default=None, description="Defines the URL for the double opt-in consent. It must be a valid URL format.") + __properties: ClassVar[List[str]] = ["campaigns_overview_enabled", "loyalty_enabled", "gift_cards_enabled", "coupons_enabled", "referrals_enabled", "theme", "use_custom_double_opt_in_redirect_url", "custom_double_opt_in_redirect_url"] + + @field_validator('theme') + def theme_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['blue', 'dark-green', 'default', 'green', 'grey', 'orange', 'purple', 'red']): + raise ValueError("must be one of enum values ('blue', 'dark-green', 'default', 'green', 'grey', 'orange', 'purple', 'red')") + return value + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ManagementProjectsBrandingCockpits from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if campaigns_overview_enabled (nullable) is None + # and model_fields_set contains the field + if self.campaigns_overview_enabled is None and "campaigns_overview_enabled" in self.model_fields_set: + _dict['campaigns_overview_enabled'] = None + + # set to None if loyalty_enabled (nullable) is None + # and model_fields_set contains the field + if self.loyalty_enabled is None and "loyalty_enabled" in self.model_fields_set: + _dict['loyalty_enabled'] = None + + # set to None if gift_cards_enabled (nullable) is None + # and model_fields_set contains the field + if self.gift_cards_enabled is None and "gift_cards_enabled" in self.model_fields_set: + _dict['gift_cards_enabled'] = None + + # set to None if coupons_enabled (nullable) is None + # and model_fields_set contains the field + if self.coupons_enabled is None and "coupons_enabled" in self.model_fields_set: + _dict['coupons_enabled'] = None + + # set to None if referrals_enabled (nullable) is None + # and model_fields_set contains the field + if self.referrals_enabled is None and "referrals_enabled" in self.model_fields_set: + _dict['referrals_enabled'] = None + + # set to None if theme (nullable) is None + # and model_fields_set contains the field + if self.theme is None and "theme" in self.model_fields_set: + _dict['theme'] = None + + # set to None if use_custom_double_opt_in_redirect_url (nullable) is None + # and model_fields_set contains the field + if self.use_custom_double_opt_in_redirect_url is None and "use_custom_double_opt_in_redirect_url" in self.model_fields_set: + _dict['use_custom_double_opt_in_redirect_url'] = None + + # set to None if custom_double_opt_in_redirect_url (nullable) is None + # and model_fields_set contains the field + if self.custom_double_opt_in_redirect_url is None and "custom_double_opt_in_redirect_url" in self.model_fields_set: + _dict['custom_double_opt_in_redirect_url'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ManagementProjectsBrandingCockpits from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "campaigns_overview_enabled": obj.get("campaigns_overview_enabled"), + "loyalty_enabled": obj.get("loyalty_enabled"), + "gift_cards_enabled": obj.get("gift_cards_enabled"), + "coupons_enabled": obj.get("coupons_enabled"), + "referrals_enabled": obj.get("referrals_enabled"), + "theme": obj.get("theme"), + "use_custom_double_opt_in_redirect_url": obj.get("use_custom_double_opt_in_redirect_url"), + "custom_double_opt_in_redirect_url": obj.get("custom_double_opt_in_redirect_url") + }) + return _obj + + diff --git a/voucherify/models/management_projects_branding_contact.py b/voucherify/models/management_projects_branding_contact.py new file mode 100644 index 00000000..278f9c39 --- /dev/null +++ b/voucherify/models/management_projects_branding_contact.py @@ -0,0 +1,100 @@ +# coding: utf-8 + +""" + Voucherify API + + Voucherify promotion engine REST API. Please see https://docs.voucherify.io/docs for more details. + + The version of the OpenAPI document: v2018-08-01 + Contact: support@voucherify.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class ManagementProjectsBrandingContact(BaseModel): + """ + Defines contact details. + """ # noqa: E501 + email: Optional[StrictStr] = Field(default=None, description="Defines the brand's email address. It must be a valid email format.") + phone: Optional[StrictStr] = Field(default=None, description="Defines the brand's phone number.") + __properties: ClassVar[List[str]] = ["email", "phone"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ManagementProjectsBrandingContact from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if email (nullable) is None + # and model_fields_set contains the field + if self.email is None and "email" in self.model_fields_set: + _dict['email'] = None + + # set to None if phone (nullable) is None + # and model_fields_set contains the field + if self.phone is None and "phone" in self.model_fields_set: + _dict['phone'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ManagementProjectsBrandingContact from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "email": obj.get("email"), + "phone": obj.get("phone") + }) + return _obj + + diff --git a/voucherify/models/management_projects_branding_create_request_body.py b/voucherify/models/management_projects_branding_create_request_body.py new file mode 100644 index 00000000..77028dfe --- /dev/null +++ b/voucherify/models/management_projects_branding_create_request_body.py @@ -0,0 +1,130 @@ +# coding: utf-8 + +""" + Voucherify API + + Voucherify promotion engine REST API. Please see https://docs.voucherify.io/docs for more details. + + The version of the OpenAPI document: v2018-08-01 + Contact: support@voucherify.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict +from typing import Any, ClassVar, Dict, List, Optional +from voucherify.models.management_projects_branding_create_request_body_address import ManagementProjectsBrandingCreateRequestBodyAddress +from voucherify.models.management_projects_branding_create_request_body_brand import ManagementProjectsBrandingCreateRequestBodyBrand +from voucherify.models.management_projects_branding_create_request_body_cockpits import ManagementProjectsBrandingCreateRequestBodyCockpits +from voucherify.models.management_projects_branding_create_request_body_contact import ManagementProjectsBrandingCreateRequestBodyContact +from typing import Optional, Set +from typing_extensions import Self + +class ManagementProjectsBrandingCreateRequestBody(BaseModel): + """ + Request body schema for **POST** `v1/management/v1/projects/{projectId}/branding`. + """ # noqa: E501 + brand: Optional[ManagementProjectsBrandingCreateRequestBodyBrand] = None + address: Optional[ManagementProjectsBrandingCreateRequestBodyAddress] = None + contact: Optional[ManagementProjectsBrandingCreateRequestBodyContact] = None + cockpits: Optional[ManagementProjectsBrandingCreateRequestBodyCockpits] = None + __properties: ClassVar[List[str]] = ["brand", "address", "contact", "cockpits"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ManagementProjectsBrandingCreateRequestBody from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of brand + if self.brand: + _dict['brand'] = self.brand.to_dict() + # override the default output from pydantic by calling `to_dict()` of address + if self.address: + _dict['address'] = self.address.to_dict() + # override the default output from pydantic by calling `to_dict()` of contact + if self.contact: + _dict['contact'] = self.contact.to_dict() + # override the default output from pydantic by calling `to_dict()` of cockpits + if self.cockpits: + _dict['cockpits'] = self.cockpits.to_dict() + # set to None if brand (nullable) is None + # and model_fields_set contains the field + if self.brand is None and "brand" in self.model_fields_set: + _dict['brand'] = None + + # set to None if address (nullable) is None + # and model_fields_set contains the field + if self.address is None and "address" in self.model_fields_set: + _dict['address'] = None + + # set to None if contact (nullable) is None + # and model_fields_set contains the field + if self.contact is None and "contact" in self.model_fields_set: + _dict['contact'] = None + + # set to None if cockpits (nullable) is None + # and model_fields_set contains the field + if self.cockpits is None and "cockpits" in self.model_fields_set: + _dict['cockpits'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ManagementProjectsBrandingCreateRequestBody from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "brand": ManagementProjectsBrandingCreateRequestBodyBrand.from_dict(obj["brand"]) if obj.get("brand") is not None else None, + "address": ManagementProjectsBrandingCreateRequestBodyAddress.from_dict(obj["address"]) if obj.get("address") is not None else None, + "contact": ManagementProjectsBrandingCreateRequestBodyContact.from_dict(obj["contact"]) if obj.get("contact") is not None else None, + "cockpits": ManagementProjectsBrandingCreateRequestBodyCockpits.from_dict(obj["cockpits"]) if obj.get("cockpits") is not None else None + }) + return _obj + + diff --git a/voucherify/models/management_projects_branding_create_request_body_address.py b/voucherify/models/management_projects_branding_create_request_body_address.py new file mode 100644 index 00000000..cfefe55d --- /dev/null +++ b/voucherify/models/management_projects_branding_create_request_body_address.py @@ -0,0 +1,121 @@ +# coding: utf-8 + +""" + Voucherify API + + Voucherify promotion engine REST API. Please see https://docs.voucherify.io/docs for more details. + + The version of the OpenAPI document: v2018-08-01 + Contact: support@voucherify.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class ManagementProjectsBrandingCreateRequestBodyAddress(BaseModel): + """ + Defines the address details. + """ # noqa: E501 + street: Optional[StrictStr] = Field(default=None, description="Defines the brand's street.") + city: Optional[StrictStr] = Field(default=None, description="Defines the brand's city.") + postal: Optional[StrictStr] = Field(default=None, description="Defines the brand's postal code.") + state: Optional[StrictStr] = Field(default=None, description="Defines the brand's state or similar administrative area.") + country: Optional[StrictStr] = Field(default=None, description="Defines the brand's country.") + __properties: ClassVar[List[str]] = ["street", "city", "postal", "state", "country"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ManagementProjectsBrandingCreateRequestBodyAddress from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if street (nullable) is None + # and model_fields_set contains the field + if self.street is None and "street" in self.model_fields_set: + _dict['street'] = None + + # set to None if city (nullable) is None + # and model_fields_set contains the field + if self.city is None and "city" in self.model_fields_set: + _dict['city'] = None + + # set to None if postal (nullable) is None + # and model_fields_set contains the field + if self.postal is None and "postal" in self.model_fields_set: + _dict['postal'] = None + + # set to None if state (nullable) is None + # and model_fields_set contains the field + if self.state is None and "state" in self.model_fields_set: + _dict['state'] = None + + # set to None if country (nullable) is None + # and model_fields_set contains the field + if self.country is None and "country" in self.model_fields_set: + _dict['country'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ManagementProjectsBrandingCreateRequestBodyAddress from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "street": obj.get("street"), + "city": obj.get("city"), + "postal": obj.get("postal"), + "state": obj.get("state"), + "country": obj.get("country") + }) + return _obj + + diff --git a/voucherify/models/management_projects_branding_create_request_body_brand.py b/voucherify/models/management_projects_branding_create_request_body_brand.py new file mode 100644 index 00000000..1bd6d424 --- /dev/null +++ b/voucherify/models/management_projects_branding_create_request_body_brand.py @@ -0,0 +1,121 @@ +# coding: utf-8 + +""" + Voucherify API + + Voucherify promotion engine REST API. Please see https://docs.voucherify.io/docs for more details. + + The version of the OpenAPI document: v2018-08-01 + Contact: support@voucherify.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class ManagementProjectsBrandingCreateRequestBodyBrand(BaseModel): + """ + Defines basic brand details. + """ # noqa: E501 + name: Optional[StrictStr] = Field(default=None, description="Defines brand name.") + privacy_policy_url: Optional[StrictStr] = Field(default=None, description="Defines the URL to the brand's privacy policy. It must be a valid URL format.") + terms_of_use_url: Optional[StrictStr] = Field(default=None, description="Defines the URL to the brand's terms of use. It must be a valid URL format.") + permission_reminder: Optional[StrictStr] = Field(default='You are receiving this email because you opted in at our website.', description="Defines the message that is displayed to customers who opted in an email newsletter.") + website_url: Optional[StrictStr] = Field(default=None, description="Defines the URL to the brand's website. It must be a valid URL format.") + __properties: ClassVar[List[str]] = ["name", "privacy_policy_url", "terms_of_use_url", "permission_reminder", "website_url"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ManagementProjectsBrandingCreateRequestBodyBrand from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if name (nullable) is None + # and model_fields_set contains the field + if self.name is None and "name" in self.model_fields_set: + _dict['name'] = None + + # set to None if privacy_policy_url (nullable) is None + # and model_fields_set contains the field + if self.privacy_policy_url is None and "privacy_policy_url" in self.model_fields_set: + _dict['privacy_policy_url'] = None + + # set to None if terms_of_use_url (nullable) is None + # and model_fields_set contains the field + if self.terms_of_use_url is None and "terms_of_use_url" in self.model_fields_set: + _dict['terms_of_use_url'] = None + + # set to None if permission_reminder (nullable) is None + # and model_fields_set contains the field + if self.permission_reminder is None and "permission_reminder" in self.model_fields_set: + _dict['permission_reminder'] = None + + # set to None if website_url (nullable) is None + # and model_fields_set contains the field + if self.website_url is None and "website_url" in self.model_fields_set: + _dict['website_url'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ManagementProjectsBrandingCreateRequestBodyBrand from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "name": obj.get("name"), + "privacy_policy_url": obj.get("privacy_policy_url"), + "terms_of_use_url": obj.get("terms_of_use_url"), + "permission_reminder": obj.get("permission_reminder") if obj.get("permission_reminder") is not None else 'You are receiving this email because you opted in at our website.', + "website_url": obj.get("website_url") + }) + return _obj + + diff --git a/voucherify/models/management_projects_branding_create_request_body_cockpits.py b/voucherify/models/management_projects_branding_create_request_body_cockpits.py new file mode 100644 index 00000000..0786d5bd --- /dev/null +++ b/voucherify/models/management_projects_branding_create_request_body_cockpits.py @@ -0,0 +1,152 @@ +# coding: utf-8 + +""" + Voucherify API + + Voucherify promotion engine REST API. Please see https://docs.voucherify.io/docs for more details. + + The version of the OpenAPI document: v2018-08-01 + Contact: support@voucherify.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class ManagementProjectsBrandingCreateRequestBodyCockpits(BaseModel): + """ + Defines customer cockpit details. + """ # noqa: E501 + campaigns_overview_enabled: Optional[StrictBool] = Field(default=False, description="Enables the campaign overview for customers.") + loyalty_enabled: Optional[StrictBool] = Field(default=True, description="Enables the loyalty campaign overview for customers.") + gift_cards_enabled: Optional[StrictBool] = Field(default=True, description="Enables the gift card overview for customers.") + coupons_enabled: Optional[StrictBool] = Field(default=True, description="Enables the discount coupon overview for customers.") + referrals_enabled: Optional[StrictBool] = Field(default=True, description="Enables the referral campaign overview for customers.") + theme: Optional[StrictStr] = Field(default='default', description="Determines the color scheme of the customer cockpit.") + use_custom_double_opt_in_redirect_url: Optional[StrictBool] = Field(default=False, description="Enables the double opt-in option. It must be a valid URL format.") + custom_double_opt_in_redirect_url: Optional[StrictStr] = Field(default=None, description="Defines the URL for the double opt-in consent. It must be a valid URL format.") + __properties: ClassVar[List[str]] = ["campaigns_overview_enabled", "loyalty_enabled", "gift_cards_enabled", "coupons_enabled", "referrals_enabled", "theme", "use_custom_double_opt_in_redirect_url", "custom_double_opt_in_redirect_url"] + + @field_validator('theme') + def theme_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['blue', 'dark-green', 'default', 'green', 'grey', 'orange', 'purple', 'red']): + raise ValueError("must be one of enum values ('blue', 'dark-green', 'default', 'green', 'grey', 'orange', 'purple', 'red')") + return value + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ManagementProjectsBrandingCreateRequestBodyCockpits from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if campaigns_overview_enabled (nullable) is None + # and model_fields_set contains the field + if self.campaigns_overview_enabled is None and "campaigns_overview_enabled" in self.model_fields_set: + _dict['campaigns_overview_enabled'] = None + + # set to None if loyalty_enabled (nullable) is None + # and model_fields_set contains the field + if self.loyalty_enabled is None and "loyalty_enabled" in self.model_fields_set: + _dict['loyalty_enabled'] = None + + # set to None if gift_cards_enabled (nullable) is None + # and model_fields_set contains the field + if self.gift_cards_enabled is None and "gift_cards_enabled" in self.model_fields_set: + _dict['gift_cards_enabled'] = None + + # set to None if coupons_enabled (nullable) is None + # and model_fields_set contains the field + if self.coupons_enabled is None and "coupons_enabled" in self.model_fields_set: + _dict['coupons_enabled'] = None + + # set to None if referrals_enabled (nullable) is None + # and model_fields_set contains the field + if self.referrals_enabled is None and "referrals_enabled" in self.model_fields_set: + _dict['referrals_enabled'] = None + + # set to None if theme (nullable) is None + # and model_fields_set contains the field + if self.theme is None and "theme" in self.model_fields_set: + _dict['theme'] = None + + # set to None if use_custom_double_opt_in_redirect_url (nullable) is None + # and model_fields_set contains the field + if self.use_custom_double_opt_in_redirect_url is None and "use_custom_double_opt_in_redirect_url" in self.model_fields_set: + _dict['use_custom_double_opt_in_redirect_url'] = None + + # set to None if custom_double_opt_in_redirect_url (nullable) is None + # and model_fields_set contains the field + if self.custom_double_opt_in_redirect_url is None and "custom_double_opt_in_redirect_url" in self.model_fields_set: + _dict['custom_double_opt_in_redirect_url'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ManagementProjectsBrandingCreateRequestBodyCockpits from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "campaigns_overview_enabled": obj.get("campaigns_overview_enabled") if obj.get("campaigns_overview_enabled") is not None else False, + "loyalty_enabled": obj.get("loyalty_enabled") if obj.get("loyalty_enabled") is not None else True, + "gift_cards_enabled": obj.get("gift_cards_enabled") if obj.get("gift_cards_enabled") is not None else True, + "coupons_enabled": obj.get("coupons_enabled") if obj.get("coupons_enabled") is not None else True, + "referrals_enabled": obj.get("referrals_enabled") if obj.get("referrals_enabled") is not None else True, + "theme": obj.get("theme") if obj.get("theme") is not None else 'default', + "use_custom_double_opt_in_redirect_url": obj.get("use_custom_double_opt_in_redirect_url") if obj.get("use_custom_double_opt_in_redirect_url") is not None else False, + "custom_double_opt_in_redirect_url": obj.get("custom_double_opt_in_redirect_url") + }) + return _obj + + diff --git a/voucherify/models/management_projects_branding_create_request_body_contact.py b/voucherify/models/management_projects_branding_create_request_body_contact.py new file mode 100644 index 00000000..682d0e3a --- /dev/null +++ b/voucherify/models/management_projects_branding_create_request_body_contact.py @@ -0,0 +1,100 @@ +# coding: utf-8 + +""" + Voucherify API + + Voucherify promotion engine REST API. Please see https://docs.voucherify.io/docs for more details. + + The version of the OpenAPI document: v2018-08-01 + Contact: support@voucherify.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class ManagementProjectsBrandingCreateRequestBodyContact(BaseModel): + """ + Defines contact details. + """ # noqa: E501 + email: Optional[StrictStr] = Field(default=None, description="Defines the brand's email address. It must be a valid email format.") + phone: Optional[StrictStr] = Field(default=None, description="Defines the brand's phone number.") + __properties: ClassVar[List[str]] = ["email", "phone"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ManagementProjectsBrandingCreateRequestBodyContact from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if email (nullable) is None + # and model_fields_set contains the field + if self.email is None and "email" in self.model_fields_set: + _dict['email'] = None + + # set to None if phone (nullable) is None + # and model_fields_set contains the field + if self.phone is None and "phone" in self.model_fields_set: + _dict['phone'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ManagementProjectsBrandingCreateRequestBodyContact from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "email": obj.get("email"), + "phone": obj.get("phone") + }) + return _obj + + diff --git a/voucherify/models/management_projects_branding_create_response_body.py b/voucherify/models/management_projects_branding_create_response_body.py new file mode 100644 index 00000000..d7007f1e --- /dev/null +++ b/voucherify/models/management_projects_branding_create_response_body.py @@ -0,0 +1,137 @@ +# coding: utf-8 + +""" + Voucherify API + + Voucherify promotion engine REST API. Please see https://docs.voucherify.io/docs for more details. + + The version of the OpenAPI document: v2018-08-01 + Contact: support@voucherify.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from voucherify.models.management_projects_branding_create_response_body_address import ManagementProjectsBrandingCreateResponseBodyAddress +from voucherify.models.management_projects_branding_create_response_body_brand import ManagementProjectsBrandingCreateResponseBodyBrand +from voucherify.models.management_projects_branding_create_response_body_cockpits import ManagementProjectsBrandingCreateResponseBodyCockpits +from voucherify.models.management_projects_branding_create_response_body_contact import ManagementProjectsBrandingCreateResponseBodyContact +from typing import Optional, Set +from typing_extensions import Self + +class ManagementProjectsBrandingCreateResponseBody(BaseModel): + """ + Response body schema for **POST** `v1/management/v1/projects/{projectId}/branding`. + """ # noqa: E501 + id: Optional[StrictStr] = Field(default=None, description="Unique identifier of the brand configuration.") + brand: Optional[ManagementProjectsBrandingCreateResponseBodyBrand] = None + address: Optional[ManagementProjectsBrandingCreateResponseBodyAddress] = None + contact: Optional[ManagementProjectsBrandingCreateResponseBodyContact] = None + cockpits: Optional[ManagementProjectsBrandingCreateResponseBodyCockpits] = None + __properties: ClassVar[List[str]] = ["id", "brand", "address", "contact", "cockpits"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ManagementProjectsBrandingCreateResponseBody from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of brand + if self.brand: + _dict['brand'] = self.brand.to_dict() + # override the default output from pydantic by calling `to_dict()` of address + if self.address: + _dict['address'] = self.address.to_dict() + # override the default output from pydantic by calling `to_dict()` of contact + if self.contact: + _dict['contact'] = self.contact.to_dict() + # override the default output from pydantic by calling `to_dict()` of cockpits + if self.cockpits: + _dict['cockpits'] = self.cockpits.to_dict() + # set to None if id (nullable) is None + # and model_fields_set contains the field + if self.id is None and "id" in self.model_fields_set: + _dict['id'] = None + + # set to None if brand (nullable) is None + # and model_fields_set contains the field + if self.brand is None and "brand" in self.model_fields_set: + _dict['brand'] = None + + # set to None if address (nullable) is None + # and model_fields_set contains the field + if self.address is None and "address" in self.model_fields_set: + _dict['address'] = None + + # set to None if contact (nullable) is None + # and model_fields_set contains the field + if self.contact is None and "contact" in self.model_fields_set: + _dict['contact'] = None + + # set to None if cockpits (nullable) is None + # and model_fields_set contains the field + if self.cockpits is None and "cockpits" in self.model_fields_set: + _dict['cockpits'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ManagementProjectsBrandingCreateResponseBody from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id"), + "brand": ManagementProjectsBrandingCreateResponseBodyBrand.from_dict(obj["brand"]) if obj.get("brand") is not None else None, + "address": ManagementProjectsBrandingCreateResponseBodyAddress.from_dict(obj["address"]) if obj.get("address") is not None else None, + "contact": ManagementProjectsBrandingCreateResponseBodyContact.from_dict(obj["contact"]) if obj.get("contact") is not None else None, + "cockpits": ManagementProjectsBrandingCreateResponseBodyCockpits.from_dict(obj["cockpits"]) if obj.get("cockpits") is not None else None + }) + return _obj + + diff --git a/voucherify/models/management_projects_branding_create_response_body_address.py b/voucherify/models/management_projects_branding_create_response_body_address.py new file mode 100644 index 00000000..8e94770e --- /dev/null +++ b/voucherify/models/management_projects_branding_create_response_body_address.py @@ -0,0 +1,121 @@ +# coding: utf-8 + +""" + Voucherify API + + Voucherify promotion engine REST API. Please see https://docs.voucherify.io/docs for more details. + + The version of the OpenAPI document: v2018-08-01 + Contact: support@voucherify.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class ManagementProjectsBrandingCreateResponseBodyAddress(BaseModel): + """ + Defines the address details. + """ # noqa: E501 + street: Optional[StrictStr] = Field(default=None, description="Defines the brand's street.") + city: Optional[StrictStr] = Field(default=None, description="Defines the brand's city.") + postal: Optional[StrictStr] = Field(default=None, description="Defines the brand's postal code.") + state: Optional[StrictStr] = Field(default=None, description="Defines the brand's state or similar administrative area.") + country: Optional[StrictStr] = Field(default=None, description="Defines the brand's country.") + __properties: ClassVar[List[str]] = ["street", "city", "postal", "state", "country"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ManagementProjectsBrandingCreateResponseBodyAddress from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if street (nullable) is None + # and model_fields_set contains the field + if self.street is None and "street" in self.model_fields_set: + _dict['street'] = None + + # set to None if city (nullable) is None + # and model_fields_set contains the field + if self.city is None and "city" in self.model_fields_set: + _dict['city'] = None + + # set to None if postal (nullable) is None + # and model_fields_set contains the field + if self.postal is None and "postal" in self.model_fields_set: + _dict['postal'] = None + + # set to None if state (nullable) is None + # and model_fields_set contains the field + if self.state is None and "state" in self.model_fields_set: + _dict['state'] = None + + # set to None if country (nullable) is None + # and model_fields_set contains the field + if self.country is None and "country" in self.model_fields_set: + _dict['country'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ManagementProjectsBrandingCreateResponseBodyAddress from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "street": obj.get("street"), + "city": obj.get("city"), + "postal": obj.get("postal"), + "state": obj.get("state"), + "country": obj.get("country") + }) + return _obj + + diff --git a/voucherify/models/management_projects_branding_create_response_body_brand.py b/voucherify/models/management_projects_branding_create_response_body_brand.py new file mode 100644 index 00000000..0adb8c05 --- /dev/null +++ b/voucherify/models/management_projects_branding_create_response_body_brand.py @@ -0,0 +1,121 @@ +# coding: utf-8 + +""" + Voucherify API + + Voucherify promotion engine REST API. Please see https://docs.voucherify.io/docs for more details. + + The version of the OpenAPI document: v2018-08-01 + Contact: support@voucherify.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class ManagementProjectsBrandingCreateResponseBodyBrand(BaseModel): + """ + Defines basic brand details. + """ # noqa: E501 + name: Optional[StrictStr] = Field(default=None, description="Defines brand name.") + privacy_policy_url: Optional[StrictStr] = Field(default=None, description="Defines the URL to the brand's privacy policy. It must be a valid URL format.") + terms_of_use_url: Optional[StrictStr] = Field(default=None, description="Defines the URL to the brand's terms of use. It must be a valid URL format.") + permission_reminder: Optional[StrictStr] = Field(default=None, description="Defines the message that is displayed to customers who opted in an email newsletter.") + website_url: Optional[StrictStr] = Field(default=None, description="Defines the URL to the brand's website. It must be a valid URL format.") + __properties: ClassVar[List[str]] = ["name", "privacy_policy_url", "terms_of_use_url", "permission_reminder", "website_url"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ManagementProjectsBrandingCreateResponseBodyBrand from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if name (nullable) is None + # and model_fields_set contains the field + if self.name is None and "name" in self.model_fields_set: + _dict['name'] = None + + # set to None if privacy_policy_url (nullable) is None + # and model_fields_set contains the field + if self.privacy_policy_url is None and "privacy_policy_url" in self.model_fields_set: + _dict['privacy_policy_url'] = None + + # set to None if terms_of_use_url (nullable) is None + # and model_fields_set contains the field + if self.terms_of_use_url is None and "terms_of_use_url" in self.model_fields_set: + _dict['terms_of_use_url'] = None + + # set to None if permission_reminder (nullable) is None + # and model_fields_set contains the field + if self.permission_reminder is None and "permission_reminder" in self.model_fields_set: + _dict['permission_reminder'] = None + + # set to None if website_url (nullable) is None + # and model_fields_set contains the field + if self.website_url is None and "website_url" in self.model_fields_set: + _dict['website_url'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ManagementProjectsBrandingCreateResponseBodyBrand from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "name": obj.get("name"), + "privacy_policy_url": obj.get("privacy_policy_url"), + "terms_of_use_url": obj.get("terms_of_use_url"), + "permission_reminder": obj.get("permission_reminder"), + "website_url": obj.get("website_url") + }) + return _obj + + diff --git a/voucherify/models/management_projects_branding_create_response_body_cockpits.py b/voucherify/models/management_projects_branding_create_response_body_cockpits.py new file mode 100644 index 00000000..cce21299 --- /dev/null +++ b/voucherify/models/management_projects_branding_create_response_body_cockpits.py @@ -0,0 +1,152 @@ +# coding: utf-8 + +""" + Voucherify API + + Voucherify promotion engine REST API. Please see https://docs.voucherify.io/docs for more details. + + The version of the OpenAPI document: v2018-08-01 + Contact: support@voucherify.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class ManagementProjectsBrandingCreateResponseBodyCockpits(BaseModel): + """ + Defines customer cockpit details. + """ # noqa: E501 + campaigns_overview_enabled: Optional[StrictBool] = Field(default=None, description="Enables the campaign overview for customers.") + loyalty_enabled: Optional[StrictBool] = Field(default=None, description="Enables the loyalty campaign overview for customers.") + gift_cards_enabled: Optional[StrictBool] = Field(default=None, description="Enables the gift card overview for customers.") + coupons_enabled: Optional[StrictBool] = Field(default=None, description="Enables the discount coupon overview for customers.") + referrals_enabled: Optional[StrictBool] = Field(default=None, description="Enables the referral campaign overview for customers.") + theme: Optional[StrictStr] = Field(default=None, description="Determines the color scheme of the customer cockpit.") + use_custom_double_opt_in_redirect_url: Optional[StrictBool] = Field(default=None, description="Enables the double opt-in option. It must be a valid URL format.") + custom_double_opt_in_redirect_url: Optional[StrictStr] = Field(default=None, description="Defines the URL for the double opt-in consent. It must be a valid URL format.") + __properties: ClassVar[List[str]] = ["campaigns_overview_enabled", "loyalty_enabled", "gift_cards_enabled", "coupons_enabled", "referrals_enabled", "theme", "use_custom_double_opt_in_redirect_url", "custom_double_opt_in_redirect_url"] + + @field_validator('theme') + def theme_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['blue', 'dark-green', 'default', 'green', 'grey', 'orange', 'purple', 'red']): + raise ValueError("must be one of enum values ('blue', 'dark-green', 'default', 'green', 'grey', 'orange', 'purple', 'red')") + return value + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ManagementProjectsBrandingCreateResponseBodyCockpits from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if campaigns_overview_enabled (nullable) is None + # and model_fields_set contains the field + if self.campaigns_overview_enabled is None and "campaigns_overview_enabled" in self.model_fields_set: + _dict['campaigns_overview_enabled'] = None + + # set to None if loyalty_enabled (nullable) is None + # and model_fields_set contains the field + if self.loyalty_enabled is None and "loyalty_enabled" in self.model_fields_set: + _dict['loyalty_enabled'] = None + + # set to None if gift_cards_enabled (nullable) is None + # and model_fields_set contains the field + if self.gift_cards_enabled is None and "gift_cards_enabled" in self.model_fields_set: + _dict['gift_cards_enabled'] = None + + # set to None if coupons_enabled (nullable) is None + # and model_fields_set contains the field + if self.coupons_enabled is None and "coupons_enabled" in self.model_fields_set: + _dict['coupons_enabled'] = None + + # set to None if referrals_enabled (nullable) is None + # and model_fields_set contains the field + if self.referrals_enabled is None and "referrals_enabled" in self.model_fields_set: + _dict['referrals_enabled'] = None + + # set to None if theme (nullable) is None + # and model_fields_set contains the field + if self.theme is None and "theme" in self.model_fields_set: + _dict['theme'] = None + + # set to None if use_custom_double_opt_in_redirect_url (nullable) is None + # and model_fields_set contains the field + if self.use_custom_double_opt_in_redirect_url is None and "use_custom_double_opt_in_redirect_url" in self.model_fields_set: + _dict['use_custom_double_opt_in_redirect_url'] = None + + # set to None if custom_double_opt_in_redirect_url (nullable) is None + # and model_fields_set contains the field + if self.custom_double_opt_in_redirect_url is None and "custom_double_opt_in_redirect_url" in self.model_fields_set: + _dict['custom_double_opt_in_redirect_url'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ManagementProjectsBrandingCreateResponseBodyCockpits from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "campaigns_overview_enabled": obj.get("campaigns_overview_enabled"), + "loyalty_enabled": obj.get("loyalty_enabled"), + "gift_cards_enabled": obj.get("gift_cards_enabled"), + "coupons_enabled": obj.get("coupons_enabled"), + "referrals_enabled": obj.get("referrals_enabled"), + "theme": obj.get("theme"), + "use_custom_double_opt_in_redirect_url": obj.get("use_custom_double_opt_in_redirect_url"), + "custom_double_opt_in_redirect_url": obj.get("custom_double_opt_in_redirect_url") + }) + return _obj + + diff --git a/voucherify/models/management_projects_branding_create_response_body_contact.py b/voucherify/models/management_projects_branding_create_response_body_contact.py new file mode 100644 index 00000000..fedde81f --- /dev/null +++ b/voucherify/models/management_projects_branding_create_response_body_contact.py @@ -0,0 +1,100 @@ +# coding: utf-8 + +""" + Voucherify API + + Voucherify promotion engine REST API. Please see https://docs.voucherify.io/docs for more details. + + The version of the OpenAPI document: v2018-08-01 + Contact: support@voucherify.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class ManagementProjectsBrandingCreateResponseBodyContact(BaseModel): + """ + Defines contact details. + """ # noqa: E501 + email: Optional[StrictStr] = Field(default=None, description="Defines the brand's email address. It must be a valid email format.") + phone: Optional[StrictStr] = Field(default=None, description="Defines the brand's phone number.") + __properties: ClassVar[List[str]] = ["email", "phone"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ManagementProjectsBrandingCreateResponseBodyContact from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if email (nullable) is None + # and model_fields_set contains the field + if self.email is None and "email" in self.model_fields_set: + _dict['email'] = None + + # set to None if phone (nullable) is None + # and model_fields_set contains the field + if self.phone is None and "phone" in self.model_fields_set: + _dict['phone'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ManagementProjectsBrandingCreateResponseBodyContact from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "email": obj.get("email"), + "phone": obj.get("phone") + }) + return _obj + + diff --git a/voucherify/models/management_projects_branding_get_response_body.py b/voucherify/models/management_projects_branding_get_response_body.py new file mode 100644 index 00000000..a02f29e5 --- /dev/null +++ b/voucherify/models/management_projects_branding_get_response_body.py @@ -0,0 +1,137 @@ +# coding: utf-8 + +""" + Voucherify API + + Voucherify promotion engine REST API. Please see https://docs.voucherify.io/docs for more details. + + The version of the OpenAPI document: v2018-08-01 + Contact: support@voucherify.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from voucherify.models.management_projects_branding_get_response_body_address import ManagementProjectsBrandingGetResponseBodyAddress +from voucherify.models.management_projects_branding_get_response_body_brand import ManagementProjectsBrandingGetResponseBodyBrand +from voucherify.models.management_projects_branding_get_response_body_cockpits import ManagementProjectsBrandingGetResponseBodyCockpits +from voucherify.models.management_projects_branding_get_response_body_contact import ManagementProjectsBrandingGetResponseBodyContact +from typing import Optional, Set +from typing_extensions import Self + +class ManagementProjectsBrandingGetResponseBody(BaseModel): + """ + Response body schema for **GET** `v1/management/v1/projects/{projectId}/branding/{brandingId}`. + """ # noqa: E501 + id: Optional[StrictStr] = Field(default=None, description="Unique identifier of the brand configuration.") + brand: Optional[ManagementProjectsBrandingGetResponseBodyBrand] = None + address: Optional[ManagementProjectsBrandingGetResponseBodyAddress] = None + contact: Optional[ManagementProjectsBrandingGetResponseBodyContact] = None + cockpits: Optional[ManagementProjectsBrandingGetResponseBodyCockpits] = None + __properties: ClassVar[List[str]] = ["id", "brand", "address", "contact", "cockpits"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ManagementProjectsBrandingGetResponseBody from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of brand + if self.brand: + _dict['brand'] = self.brand.to_dict() + # override the default output from pydantic by calling `to_dict()` of address + if self.address: + _dict['address'] = self.address.to_dict() + # override the default output from pydantic by calling `to_dict()` of contact + if self.contact: + _dict['contact'] = self.contact.to_dict() + # override the default output from pydantic by calling `to_dict()` of cockpits + if self.cockpits: + _dict['cockpits'] = self.cockpits.to_dict() + # set to None if id (nullable) is None + # and model_fields_set contains the field + if self.id is None and "id" in self.model_fields_set: + _dict['id'] = None + + # set to None if brand (nullable) is None + # and model_fields_set contains the field + if self.brand is None and "brand" in self.model_fields_set: + _dict['brand'] = None + + # set to None if address (nullable) is None + # and model_fields_set contains the field + if self.address is None and "address" in self.model_fields_set: + _dict['address'] = None + + # set to None if contact (nullable) is None + # and model_fields_set contains the field + if self.contact is None and "contact" in self.model_fields_set: + _dict['contact'] = None + + # set to None if cockpits (nullable) is None + # and model_fields_set contains the field + if self.cockpits is None and "cockpits" in self.model_fields_set: + _dict['cockpits'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ManagementProjectsBrandingGetResponseBody from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id"), + "brand": ManagementProjectsBrandingGetResponseBodyBrand.from_dict(obj["brand"]) if obj.get("brand") is not None else None, + "address": ManagementProjectsBrandingGetResponseBodyAddress.from_dict(obj["address"]) if obj.get("address") is not None else None, + "contact": ManagementProjectsBrandingGetResponseBodyContact.from_dict(obj["contact"]) if obj.get("contact") is not None else None, + "cockpits": ManagementProjectsBrandingGetResponseBodyCockpits.from_dict(obj["cockpits"]) if obj.get("cockpits") is not None else None + }) + return _obj + + diff --git a/voucherify/models/management_projects_branding_get_response_body_address.py b/voucherify/models/management_projects_branding_get_response_body_address.py new file mode 100644 index 00000000..b58ef213 --- /dev/null +++ b/voucherify/models/management_projects_branding_get_response_body_address.py @@ -0,0 +1,121 @@ +# coding: utf-8 + +""" + Voucherify API + + Voucherify promotion engine REST API. Please see https://docs.voucherify.io/docs for more details. + + The version of the OpenAPI document: v2018-08-01 + Contact: support@voucherify.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class ManagementProjectsBrandingGetResponseBodyAddress(BaseModel): + """ + Defines the address details. + """ # noqa: E501 + street: Optional[StrictStr] = Field(default=None, description="Defines the brand's street.") + city: Optional[StrictStr] = Field(default=None, description="Defines the brand's city.") + postal: Optional[StrictStr] = Field(default=None, description="Defines the brand's postal code.") + state: Optional[StrictStr] = Field(default=None, description="Defines the brand's state or similar administrative area.") + country: Optional[StrictStr] = Field(default=None, description="Defines the brand's country.") + __properties: ClassVar[List[str]] = ["street", "city", "postal", "state", "country"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ManagementProjectsBrandingGetResponseBodyAddress from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if street (nullable) is None + # and model_fields_set contains the field + if self.street is None and "street" in self.model_fields_set: + _dict['street'] = None + + # set to None if city (nullable) is None + # and model_fields_set contains the field + if self.city is None and "city" in self.model_fields_set: + _dict['city'] = None + + # set to None if postal (nullable) is None + # and model_fields_set contains the field + if self.postal is None and "postal" in self.model_fields_set: + _dict['postal'] = None + + # set to None if state (nullable) is None + # and model_fields_set contains the field + if self.state is None and "state" in self.model_fields_set: + _dict['state'] = None + + # set to None if country (nullable) is None + # and model_fields_set contains the field + if self.country is None and "country" in self.model_fields_set: + _dict['country'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ManagementProjectsBrandingGetResponseBodyAddress from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "street": obj.get("street"), + "city": obj.get("city"), + "postal": obj.get("postal"), + "state": obj.get("state"), + "country": obj.get("country") + }) + return _obj + + diff --git a/voucherify/models/management_projects_branding_get_response_body_brand.py b/voucherify/models/management_projects_branding_get_response_body_brand.py new file mode 100644 index 00000000..dcff12a6 --- /dev/null +++ b/voucherify/models/management_projects_branding_get_response_body_brand.py @@ -0,0 +1,121 @@ +# coding: utf-8 + +""" + Voucherify API + + Voucherify promotion engine REST API. Please see https://docs.voucherify.io/docs for more details. + + The version of the OpenAPI document: v2018-08-01 + Contact: support@voucherify.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class ManagementProjectsBrandingGetResponseBodyBrand(BaseModel): + """ + Defines basic brand details. + """ # noqa: E501 + name: Optional[StrictStr] = Field(default=None, description="Defines brand name.") + privacy_policy_url: Optional[StrictStr] = Field(default=None, description="Defines the URL to the brand's privacy policy. It must be a valid URL format.") + terms_of_use_url: Optional[StrictStr] = Field(default=None, description="Defines the URL to the brand's terms of use. It must be a valid URL format.") + permission_reminder: Optional[StrictStr] = Field(default=None, description="Defines the message that is displayed to customers who opted in an email newsletter.") + website_url: Optional[StrictStr] = Field(default=None, description="Defines the URL to the brand's website. It must be a valid URL format.") + __properties: ClassVar[List[str]] = ["name", "privacy_policy_url", "terms_of_use_url", "permission_reminder", "website_url"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ManagementProjectsBrandingGetResponseBodyBrand from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if name (nullable) is None + # and model_fields_set contains the field + if self.name is None and "name" in self.model_fields_set: + _dict['name'] = None + + # set to None if privacy_policy_url (nullable) is None + # and model_fields_set contains the field + if self.privacy_policy_url is None and "privacy_policy_url" in self.model_fields_set: + _dict['privacy_policy_url'] = None + + # set to None if terms_of_use_url (nullable) is None + # and model_fields_set contains the field + if self.terms_of_use_url is None and "terms_of_use_url" in self.model_fields_set: + _dict['terms_of_use_url'] = None + + # set to None if permission_reminder (nullable) is None + # and model_fields_set contains the field + if self.permission_reminder is None and "permission_reminder" in self.model_fields_set: + _dict['permission_reminder'] = None + + # set to None if website_url (nullable) is None + # and model_fields_set contains the field + if self.website_url is None and "website_url" in self.model_fields_set: + _dict['website_url'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ManagementProjectsBrandingGetResponseBodyBrand from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "name": obj.get("name"), + "privacy_policy_url": obj.get("privacy_policy_url"), + "terms_of_use_url": obj.get("terms_of_use_url"), + "permission_reminder": obj.get("permission_reminder"), + "website_url": obj.get("website_url") + }) + return _obj + + diff --git a/voucherify/models/management_projects_branding_get_response_body_cockpits.py b/voucherify/models/management_projects_branding_get_response_body_cockpits.py new file mode 100644 index 00000000..e5fe0e79 --- /dev/null +++ b/voucherify/models/management_projects_branding_get_response_body_cockpits.py @@ -0,0 +1,152 @@ +# coding: utf-8 + +""" + Voucherify API + + Voucherify promotion engine REST API. Please see https://docs.voucherify.io/docs for more details. + + The version of the OpenAPI document: v2018-08-01 + Contact: support@voucherify.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class ManagementProjectsBrandingGetResponseBodyCockpits(BaseModel): + """ + Defines customer cockpit details. + """ # noqa: E501 + campaigns_overview_enabled: Optional[StrictBool] = Field(default=None, description="Enables the campaign overview for customers.") + loyalty_enabled: Optional[StrictBool] = Field(default=None, description="Enables the loyalty campaign overview for customers.") + gift_cards_enabled: Optional[StrictBool] = Field(default=None, description="Enables the gift card overview for customers.") + coupons_enabled: Optional[StrictBool] = Field(default=None, description="Enables the discount coupon overview for customers.") + referrals_enabled: Optional[StrictBool] = Field(default=None, description="Enables the referral campaign overview for customers.") + theme: Optional[StrictStr] = Field(default=None, description="Determines the color scheme of the customer cockpit.") + use_custom_double_opt_in_redirect_url: Optional[StrictBool] = Field(default=None, description="Enables the double opt-in option. It must be a valid URL format.") + custom_double_opt_in_redirect_url: Optional[StrictStr] = Field(default=None, description="Defines the URL for the double opt-in consent. It must be a valid URL format.") + __properties: ClassVar[List[str]] = ["campaigns_overview_enabled", "loyalty_enabled", "gift_cards_enabled", "coupons_enabled", "referrals_enabled", "theme", "use_custom_double_opt_in_redirect_url", "custom_double_opt_in_redirect_url"] + + @field_validator('theme') + def theme_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['blue', 'dark-green', 'default', 'green', 'grey', 'orange', 'purple', 'red']): + raise ValueError("must be one of enum values ('blue', 'dark-green', 'default', 'green', 'grey', 'orange', 'purple', 'red')") + return value + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ManagementProjectsBrandingGetResponseBodyCockpits from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if campaigns_overview_enabled (nullable) is None + # and model_fields_set contains the field + if self.campaigns_overview_enabled is None and "campaigns_overview_enabled" in self.model_fields_set: + _dict['campaigns_overview_enabled'] = None + + # set to None if loyalty_enabled (nullable) is None + # and model_fields_set contains the field + if self.loyalty_enabled is None and "loyalty_enabled" in self.model_fields_set: + _dict['loyalty_enabled'] = None + + # set to None if gift_cards_enabled (nullable) is None + # and model_fields_set contains the field + if self.gift_cards_enabled is None and "gift_cards_enabled" in self.model_fields_set: + _dict['gift_cards_enabled'] = None + + # set to None if coupons_enabled (nullable) is None + # and model_fields_set contains the field + if self.coupons_enabled is None and "coupons_enabled" in self.model_fields_set: + _dict['coupons_enabled'] = None + + # set to None if referrals_enabled (nullable) is None + # and model_fields_set contains the field + if self.referrals_enabled is None and "referrals_enabled" in self.model_fields_set: + _dict['referrals_enabled'] = None + + # set to None if theme (nullable) is None + # and model_fields_set contains the field + if self.theme is None and "theme" in self.model_fields_set: + _dict['theme'] = None + + # set to None if use_custom_double_opt_in_redirect_url (nullable) is None + # and model_fields_set contains the field + if self.use_custom_double_opt_in_redirect_url is None and "use_custom_double_opt_in_redirect_url" in self.model_fields_set: + _dict['use_custom_double_opt_in_redirect_url'] = None + + # set to None if custom_double_opt_in_redirect_url (nullable) is None + # and model_fields_set contains the field + if self.custom_double_opt_in_redirect_url is None and "custom_double_opt_in_redirect_url" in self.model_fields_set: + _dict['custom_double_opt_in_redirect_url'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ManagementProjectsBrandingGetResponseBodyCockpits from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "campaigns_overview_enabled": obj.get("campaigns_overview_enabled"), + "loyalty_enabled": obj.get("loyalty_enabled"), + "gift_cards_enabled": obj.get("gift_cards_enabled"), + "coupons_enabled": obj.get("coupons_enabled"), + "referrals_enabled": obj.get("referrals_enabled"), + "theme": obj.get("theme"), + "use_custom_double_opt_in_redirect_url": obj.get("use_custom_double_opt_in_redirect_url"), + "custom_double_opt_in_redirect_url": obj.get("custom_double_opt_in_redirect_url") + }) + return _obj + + diff --git a/voucherify/models/management_projects_branding_get_response_body_contact.py b/voucherify/models/management_projects_branding_get_response_body_contact.py new file mode 100644 index 00000000..7e36a90c --- /dev/null +++ b/voucherify/models/management_projects_branding_get_response_body_contact.py @@ -0,0 +1,100 @@ +# coding: utf-8 + +""" + Voucherify API + + Voucherify promotion engine REST API. Please see https://docs.voucherify.io/docs for more details. + + The version of the OpenAPI document: v2018-08-01 + Contact: support@voucherify.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class ManagementProjectsBrandingGetResponseBodyContact(BaseModel): + """ + Defines contact details. + """ # noqa: E501 + email: Optional[StrictStr] = Field(default=None, description="Defines the brand's email address. It must be a valid email format.") + phone: Optional[StrictStr] = Field(default=None, description="Defines the brand's phone number.") + __properties: ClassVar[List[str]] = ["email", "phone"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ManagementProjectsBrandingGetResponseBodyContact from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if email (nullable) is None + # and model_fields_set contains the field + if self.email is None and "email" in self.model_fields_set: + _dict['email'] = None + + # set to None if phone (nullable) is None + # and model_fields_set contains the field + if self.phone is None and "phone" in self.model_fields_set: + _dict['phone'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ManagementProjectsBrandingGetResponseBodyContact from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "email": obj.get("email"), + "phone": obj.get("phone") + }) + return _obj + + diff --git a/voucherify/models/management_projects_branding_list_response_body.py b/voucherify/models/management_projects_branding_list_response_body.py new file mode 100644 index 00000000..db6bf807 --- /dev/null +++ b/voucherify/models/management_projects_branding_list_response_body.py @@ -0,0 +1,142 @@ +# coding: utf-8 + +""" + Voucherify API + + Voucherify promotion engine REST API. Please see https://docs.voucherify.io/docs for more details. + + The version of the OpenAPI document: v2018-08-01 + Contact: support@voucherify.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from voucherify.models.management_projects_branding import ManagementProjectsBranding +from typing import Optional, Set +from typing_extensions import Self + +class ManagementProjectsBrandingListResponseBody(BaseModel): + """ + Object containing a list of brand configurations. It always contains one item. + """ # noqa: E501 + object: Optional[StrictStr] = Field(default='list', description="The type of the object represented by JSON. This object stores information about the brand in a dictionary.") + data_ref: Optional[StrictStr] = Field(default='data', description="Identifies the name of the attribute that contains the array of brand objects.") + data: Optional[List[ManagementProjectsBranding]] = Field(default=None, description="Array of brand objects. It contains only one object.") + total: Optional[StrictInt] = Field(default=None, description="The total number of brand objects. It is always `1`.") + __properties: ClassVar[List[str]] = ["object", "data_ref", "data", "total"] + + @field_validator('object') + def object_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['list']): + raise ValueError("must be one of enum values ('list')") + return value + + @field_validator('data_ref') + def data_ref_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['data']): + raise ValueError("must be one of enum values ('data')") + return value + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ManagementProjectsBrandingListResponseBody from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in data (list) + _items = [] + if self.data: + for _item_data in self.data: + if _item_data: + _items.append(_item_data.to_dict()) + _dict['data'] = _items + # set to None if object (nullable) is None + # and model_fields_set contains the field + if self.object is None and "object" in self.model_fields_set: + _dict['object'] = None + + # set to None if data_ref (nullable) is None + # and model_fields_set contains the field + if self.data_ref is None and "data_ref" in self.model_fields_set: + _dict['data_ref'] = None + + # set to None if data (nullable) is None + # and model_fields_set contains the field + if self.data is None and "data" in self.model_fields_set: + _dict['data'] = None + + # set to None if total (nullable) is None + # and model_fields_set contains the field + if self.total is None and "total" in self.model_fields_set: + _dict['total'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ManagementProjectsBrandingListResponseBody from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "object": obj.get("object") if obj.get("object") is not None else 'list', + "data_ref": obj.get("data_ref") if obj.get("data_ref") is not None else 'data', + "data": [ManagementProjectsBranding.from_dict(_item) for _item in obj["data"]] if obj.get("data") is not None else None, + "total": obj.get("total") + }) + return _obj + + diff --git a/voucherify/models/management_projects_branding_update_request_body.py b/voucherify/models/management_projects_branding_update_request_body.py new file mode 100644 index 00000000..c505144c --- /dev/null +++ b/voucherify/models/management_projects_branding_update_request_body.py @@ -0,0 +1,130 @@ +# coding: utf-8 + +""" + Voucherify API + + Voucherify promotion engine REST API. Please see https://docs.voucherify.io/docs for more details. + + The version of the OpenAPI document: v2018-08-01 + Contact: support@voucherify.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict +from typing import Any, ClassVar, Dict, List, Optional +from voucherify.models.management_projects_branding_update_request_body_address import ManagementProjectsBrandingUpdateRequestBodyAddress +from voucherify.models.management_projects_branding_update_request_body_brand import ManagementProjectsBrandingUpdateRequestBodyBrand +from voucherify.models.management_projects_branding_update_request_body_cockpits import ManagementProjectsBrandingUpdateRequestBodyCockpits +from voucherify.models.management_projects_branding_update_request_body_contact import ManagementProjectsBrandingUpdateRequestBodyContact +from typing import Optional, Set +from typing_extensions import Self + +class ManagementProjectsBrandingUpdateRequestBody(BaseModel): + """ + ManagementProjectsBrandingUpdateRequestBody + """ # noqa: E501 + brand: Optional[ManagementProjectsBrandingUpdateRequestBodyBrand] = None + address: Optional[ManagementProjectsBrandingUpdateRequestBodyAddress] = None + contact: Optional[ManagementProjectsBrandingUpdateRequestBodyContact] = None + cockpits: Optional[ManagementProjectsBrandingUpdateRequestBodyCockpits] = None + __properties: ClassVar[List[str]] = ["brand", "address", "contact", "cockpits"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ManagementProjectsBrandingUpdateRequestBody from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of brand + if self.brand: + _dict['brand'] = self.brand.to_dict() + # override the default output from pydantic by calling `to_dict()` of address + if self.address: + _dict['address'] = self.address.to_dict() + # override the default output from pydantic by calling `to_dict()` of contact + if self.contact: + _dict['contact'] = self.contact.to_dict() + # override the default output from pydantic by calling `to_dict()` of cockpits + if self.cockpits: + _dict['cockpits'] = self.cockpits.to_dict() + # set to None if brand (nullable) is None + # and model_fields_set contains the field + if self.brand is None and "brand" in self.model_fields_set: + _dict['brand'] = None + + # set to None if address (nullable) is None + # and model_fields_set contains the field + if self.address is None and "address" in self.model_fields_set: + _dict['address'] = None + + # set to None if contact (nullable) is None + # and model_fields_set contains the field + if self.contact is None and "contact" in self.model_fields_set: + _dict['contact'] = None + + # set to None if cockpits (nullable) is None + # and model_fields_set contains the field + if self.cockpits is None and "cockpits" in self.model_fields_set: + _dict['cockpits'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ManagementProjectsBrandingUpdateRequestBody from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "brand": ManagementProjectsBrandingUpdateRequestBodyBrand.from_dict(obj["brand"]) if obj.get("brand") is not None else None, + "address": ManagementProjectsBrandingUpdateRequestBodyAddress.from_dict(obj["address"]) if obj.get("address") is not None else None, + "contact": ManagementProjectsBrandingUpdateRequestBodyContact.from_dict(obj["contact"]) if obj.get("contact") is not None else None, + "cockpits": ManagementProjectsBrandingUpdateRequestBodyCockpits.from_dict(obj["cockpits"]) if obj.get("cockpits") is not None else None + }) + return _obj + + diff --git a/voucherify/models/management_projects_branding_update_request_body_address.py b/voucherify/models/management_projects_branding_update_request_body_address.py new file mode 100644 index 00000000..e29dd71e --- /dev/null +++ b/voucherify/models/management_projects_branding_update_request_body_address.py @@ -0,0 +1,121 @@ +# coding: utf-8 + +""" + Voucherify API + + Voucherify promotion engine REST API. Please see https://docs.voucherify.io/docs for more details. + + The version of the OpenAPI document: v2018-08-01 + Contact: support@voucherify.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class ManagementProjectsBrandingUpdateRequestBodyAddress(BaseModel): + """ + Defines the address details. + """ # noqa: E501 + street: Optional[StrictStr] = Field(default=None, description="Defines the brand's street.") + city: Optional[StrictStr] = Field(default=None, description="Defines the brand's city.") + postal: Optional[StrictStr] = Field(default=None, description="Defines the brand's postal code") + state: Optional[StrictStr] = Field(default=None, description="Defines the brand's state or similar administrative area.") + country: Optional[StrictStr] = Field(default=None, description="Defines the brand's country.") + __properties: ClassVar[List[str]] = ["street", "city", "postal", "state", "country"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ManagementProjectsBrandingUpdateRequestBodyAddress from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if street (nullable) is None + # and model_fields_set contains the field + if self.street is None and "street" in self.model_fields_set: + _dict['street'] = None + + # set to None if city (nullable) is None + # and model_fields_set contains the field + if self.city is None and "city" in self.model_fields_set: + _dict['city'] = None + + # set to None if postal (nullable) is None + # and model_fields_set contains the field + if self.postal is None and "postal" in self.model_fields_set: + _dict['postal'] = None + + # set to None if state (nullable) is None + # and model_fields_set contains the field + if self.state is None and "state" in self.model_fields_set: + _dict['state'] = None + + # set to None if country (nullable) is None + # and model_fields_set contains the field + if self.country is None and "country" in self.model_fields_set: + _dict['country'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ManagementProjectsBrandingUpdateRequestBodyAddress from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "street": obj.get("street"), + "city": obj.get("city"), + "postal": obj.get("postal"), + "state": obj.get("state"), + "country": obj.get("country") + }) + return _obj + + diff --git a/voucherify/models/management_projects_branding_update_request_body_brand.py b/voucherify/models/management_projects_branding_update_request_body_brand.py new file mode 100644 index 00000000..ab417eb6 --- /dev/null +++ b/voucherify/models/management_projects_branding_update_request_body_brand.py @@ -0,0 +1,121 @@ +# coding: utf-8 + +""" + Voucherify API + + Voucherify promotion engine REST API. Please see https://docs.voucherify.io/docs for more details. + + The version of the OpenAPI document: v2018-08-01 + Contact: support@voucherify.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class ManagementProjectsBrandingUpdateRequestBodyBrand(BaseModel): + """ + Defines basic brand details. + """ # noqa: E501 + name: Optional[StrictStr] = Field(default=None, description="Defines brand name.") + privacy_policy_url: Optional[StrictStr] = Field(default=None, description="Defines the URL to the brand's privacy policy.") + terms_of_use_url: Optional[StrictStr] = Field(default=None, description="Defines the URL to the brand's terms of use.") + permission_reminder: Optional[StrictStr] = Field(default=None, description="Defines the message that is displayed to customers who opted in an email newsletter.") + website_url: Optional[StrictStr] = Field(default=None, description="Defines the URL to the brand's website.") + __properties: ClassVar[List[str]] = ["name", "privacy_policy_url", "terms_of_use_url", "permission_reminder", "website_url"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ManagementProjectsBrandingUpdateRequestBodyBrand from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if name (nullable) is None + # and model_fields_set contains the field + if self.name is None and "name" in self.model_fields_set: + _dict['name'] = None + + # set to None if privacy_policy_url (nullable) is None + # and model_fields_set contains the field + if self.privacy_policy_url is None and "privacy_policy_url" in self.model_fields_set: + _dict['privacy_policy_url'] = None + + # set to None if terms_of_use_url (nullable) is None + # and model_fields_set contains the field + if self.terms_of_use_url is None and "terms_of_use_url" in self.model_fields_set: + _dict['terms_of_use_url'] = None + + # set to None if permission_reminder (nullable) is None + # and model_fields_set contains the field + if self.permission_reminder is None and "permission_reminder" in self.model_fields_set: + _dict['permission_reminder'] = None + + # set to None if website_url (nullable) is None + # and model_fields_set contains the field + if self.website_url is None and "website_url" in self.model_fields_set: + _dict['website_url'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ManagementProjectsBrandingUpdateRequestBodyBrand from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "name": obj.get("name"), + "privacy_policy_url": obj.get("privacy_policy_url"), + "terms_of_use_url": obj.get("terms_of_use_url"), + "permission_reminder": obj.get("permission_reminder"), + "website_url": obj.get("website_url") + }) + return _obj + + diff --git a/voucherify/models/management_projects_branding_update_request_body_cockpits.py b/voucherify/models/management_projects_branding_update_request_body_cockpits.py new file mode 100644 index 00000000..52b11019 --- /dev/null +++ b/voucherify/models/management_projects_branding_update_request_body_cockpits.py @@ -0,0 +1,152 @@ +# coding: utf-8 + +""" + Voucherify API + + Voucherify promotion engine REST API. Please see https://docs.voucherify.io/docs for more details. + + The version of the OpenAPI document: v2018-08-01 + Contact: support@voucherify.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class ManagementProjectsBrandingUpdateRequestBodyCockpits(BaseModel): + """ + Defines customer cockpit details. + """ # noqa: E501 + campaigns_overview_enabled: Optional[StrictBool] = Field(default=None, description="Indicates if the campaign overview is turned on for customers.") + loyalty_enabled: Optional[StrictBool] = Field(default=None, description="Indicates if the loyalty campaign overview is turned on for customers.") + gift_cards_enabled: Optional[StrictBool] = Field(default=None, description="Indicates if the gift card overview is turned on for customers.") + coupons_enabled: Optional[StrictBool] = Field(default=None, description="Indicates if the discount coupon overview is turned on for customers.") + referrals_enabled: Optional[StrictBool] = Field(default=None, description="Indicates if the referral campaign overview is turned on for customers.") + theme: Optional[StrictStr] = Field(default=None, description="Determines the color scheme of the customer cockpit.") + use_custom_double_opt_in_redirect_url: Optional[StrictBool] = Field(default=None, description="Indicates if the double opt-in option is turned on.") + custom_double_opt_in_redirect_url: Optional[StrictStr] = Field(default=None, description="Defines the URL for the double opt-in consent.") + __properties: ClassVar[List[str]] = ["campaigns_overview_enabled", "loyalty_enabled", "gift_cards_enabled", "coupons_enabled", "referrals_enabled", "theme", "use_custom_double_opt_in_redirect_url", "custom_double_opt_in_redirect_url"] + + @field_validator('theme') + def theme_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['orange', 'green', 'dark-green', 'blue', 'purple', 'red', 'grey']): + raise ValueError("must be one of enum values ('orange', 'green', 'dark-green', 'blue', 'purple', 'red', 'grey')") + return value + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ManagementProjectsBrandingUpdateRequestBodyCockpits from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if campaigns_overview_enabled (nullable) is None + # and model_fields_set contains the field + if self.campaigns_overview_enabled is None and "campaigns_overview_enabled" in self.model_fields_set: + _dict['campaigns_overview_enabled'] = None + + # set to None if loyalty_enabled (nullable) is None + # and model_fields_set contains the field + if self.loyalty_enabled is None and "loyalty_enabled" in self.model_fields_set: + _dict['loyalty_enabled'] = None + + # set to None if gift_cards_enabled (nullable) is None + # and model_fields_set contains the field + if self.gift_cards_enabled is None and "gift_cards_enabled" in self.model_fields_set: + _dict['gift_cards_enabled'] = None + + # set to None if coupons_enabled (nullable) is None + # and model_fields_set contains the field + if self.coupons_enabled is None and "coupons_enabled" in self.model_fields_set: + _dict['coupons_enabled'] = None + + # set to None if referrals_enabled (nullable) is None + # and model_fields_set contains the field + if self.referrals_enabled is None and "referrals_enabled" in self.model_fields_set: + _dict['referrals_enabled'] = None + + # set to None if theme (nullable) is None + # and model_fields_set contains the field + if self.theme is None and "theme" in self.model_fields_set: + _dict['theme'] = None + + # set to None if use_custom_double_opt_in_redirect_url (nullable) is None + # and model_fields_set contains the field + if self.use_custom_double_opt_in_redirect_url is None and "use_custom_double_opt_in_redirect_url" in self.model_fields_set: + _dict['use_custom_double_opt_in_redirect_url'] = None + + # set to None if custom_double_opt_in_redirect_url (nullable) is None + # and model_fields_set contains the field + if self.custom_double_opt_in_redirect_url is None and "custom_double_opt_in_redirect_url" in self.model_fields_set: + _dict['custom_double_opt_in_redirect_url'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ManagementProjectsBrandingUpdateRequestBodyCockpits from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "campaigns_overview_enabled": obj.get("campaigns_overview_enabled"), + "loyalty_enabled": obj.get("loyalty_enabled"), + "gift_cards_enabled": obj.get("gift_cards_enabled"), + "coupons_enabled": obj.get("coupons_enabled"), + "referrals_enabled": obj.get("referrals_enabled"), + "theme": obj.get("theme"), + "use_custom_double_opt_in_redirect_url": obj.get("use_custom_double_opt_in_redirect_url"), + "custom_double_opt_in_redirect_url": obj.get("custom_double_opt_in_redirect_url") + }) + return _obj + + diff --git a/voucherify/models/management_projects_branding_update_request_body_contact.py b/voucherify/models/management_projects_branding_update_request_body_contact.py new file mode 100644 index 00000000..8e984645 --- /dev/null +++ b/voucherify/models/management_projects_branding_update_request_body_contact.py @@ -0,0 +1,100 @@ +# coding: utf-8 + +""" + Voucherify API + + Voucherify promotion engine REST API. Please see https://docs.voucherify.io/docs for more details. + + The version of the OpenAPI document: v2018-08-01 + Contact: support@voucherify.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class ManagementProjectsBrandingUpdateRequestBodyContact(BaseModel): + """ + Defines contact details. + """ # noqa: E501 + email: Optional[StrictStr] = Field(default=None, description="Defines the brand's email address. It must be a valid email format.") + phone: Optional[StrictStr] = Field(default=None, description="Defines the brand's phone number.") + __properties: ClassVar[List[str]] = ["email", "phone"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ManagementProjectsBrandingUpdateRequestBodyContact from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if email (nullable) is None + # and model_fields_set contains the field + if self.email is None and "email" in self.model_fields_set: + _dict['email'] = None + + # set to None if phone (nullable) is None + # and model_fields_set contains the field + if self.phone is None and "phone" in self.model_fields_set: + _dict['phone'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ManagementProjectsBrandingUpdateRequestBodyContact from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "email": obj.get("email"), + "phone": obj.get("phone") + }) + return _obj + + diff --git a/voucherify/models/management_projects_branding_update_response_body.py b/voucherify/models/management_projects_branding_update_response_body.py new file mode 100644 index 00000000..251571fd --- /dev/null +++ b/voucherify/models/management_projects_branding_update_response_body.py @@ -0,0 +1,137 @@ +# coding: utf-8 + +""" + Voucherify API + + Voucherify promotion engine REST API. Please see https://docs.voucherify.io/docs for more details. + + The version of the OpenAPI document: v2018-08-01 + Contact: support@voucherify.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from voucherify.models.management_projects_branding_update_response_body_address import ManagementProjectsBrandingUpdateResponseBodyAddress +from voucherify.models.management_projects_branding_update_response_body_brand import ManagementProjectsBrandingUpdateResponseBodyBrand +from voucherify.models.management_projects_branding_update_response_body_cockpits import ManagementProjectsBrandingUpdateResponseBodyCockpits +from voucherify.models.management_projects_branding_update_response_body_contact import ManagementProjectsBrandingUpdateResponseBodyContact +from typing import Optional, Set +from typing_extensions import Self + +class ManagementProjectsBrandingUpdateResponseBody(BaseModel): + """ + Response body schema for **PUT** `v1/management/v1/projects/{projectId}/branding/{brandingId}`. + """ # noqa: E501 + id: Optional[StrictStr] = Field(default=None, description="Unique identifier of the brand configuration.") + brand: Optional[ManagementProjectsBrandingUpdateResponseBodyBrand] = None + address: Optional[ManagementProjectsBrandingUpdateResponseBodyAddress] = None + contact: Optional[ManagementProjectsBrandingUpdateResponseBodyContact] = None + cockpits: Optional[ManagementProjectsBrandingUpdateResponseBodyCockpits] = None + __properties: ClassVar[List[str]] = ["id", "brand", "address", "contact", "cockpits"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ManagementProjectsBrandingUpdateResponseBody from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of brand + if self.brand: + _dict['brand'] = self.brand.to_dict() + # override the default output from pydantic by calling `to_dict()` of address + if self.address: + _dict['address'] = self.address.to_dict() + # override the default output from pydantic by calling `to_dict()` of contact + if self.contact: + _dict['contact'] = self.contact.to_dict() + # override the default output from pydantic by calling `to_dict()` of cockpits + if self.cockpits: + _dict['cockpits'] = self.cockpits.to_dict() + # set to None if id (nullable) is None + # and model_fields_set contains the field + if self.id is None and "id" in self.model_fields_set: + _dict['id'] = None + + # set to None if brand (nullable) is None + # and model_fields_set contains the field + if self.brand is None and "brand" in self.model_fields_set: + _dict['brand'] = None + + # set to None if address (nullable) is None + # and model_fields_set contains the field + if self.address is None and "address" in self.model_fields_set: + _dict['address'] = None + + # set to None if contact (nullable) is None + # and model_fields_set contains the field + if self.contact is None and "contact" in self.model_fields_set: + _dict['contact'] = None + + # set to None if cockpits (nullable) is None + # and model_fields_set contains the field + if self.cockpits is None and "cockpits" in self.model_fields_set: + _dict['cockpits'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ManagementProjectsBrandingUpdateResponseBody from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id"), + "brand": ManagementProjectsBrandingUpdateResponseBodyBrand.from_dict(obj["brand"]) if obj.get("brand") is not None else None, + "address": ManagementProjectsBrandingUpdateResponseBodyAddress.from_dict(obj["address"]) if obj.get("address") is not None else None, + "contact": ManagementProjectsBrandingUpdateResponseBodyContact.from_dict(obj["contact"]) if obj.get("contact") is not None else None, + "cockpits": ManagementProjectsBrandingUpdateResponseBodyCockpits.from_dict(obj["cockpits"]) if obj.get("cockpits") is not None else None + }) + return _obj + + diff --git a/voucherify/models/management_projects_branding_update_response_body_address.py b/voucherify/models/management_projects_branding_update_response_body_address.py new file mode 100644 index 00000000..6caeb479 --- /dev/null +++ b/voucherify/models/management_projects_branding_update_response_body_address.py @@ -0,0 +1,121 @@ +# coding: utf-8 + +""" + Voucherify API + + Voucherify promotion engine REST API. Please see https://docs.voucherify.io/docs for more details. + + The version of the OpenAPI document: v2018-08-01 + Contact: support@voucherify.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class ManagementProjectsBrandingUpdateResponseBodyAddress(BaseModel): + """ + Defines the address details. + """ # noqa: E501 + street: Optional[StrictStr] = Field(default=None, description="Defines the brand's street.") + city: Optional[StrictStr] = Field(default=None, description="Defines the brand's city.") + postal: Optional[StrictStr] = Field(default=None, description="Defines the brand's postal code.") + state: Optional[StrictStr] = Field(default=None, description="Defines the brand's state or similar administrative area.") + country: Optional[StrictStr] = Field(default=None, description="Defines the brand's country.") + __properties: ClassVar[List[str]] = ["street", "city", "postal", "state", "country"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ManagementProjectsBrandingUpdateResponseBodyAddress from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if street (nullable) is None + # and model_fields_set contains the field + if self.street is None and "street" in self.model_fields_set: + _dict['street'] = None + + # set to None if city (nullable) is None + # and model_fields_set contains the field + if self.city is None and "city" in self.model_fields_set: + _dict['city'] = None + + # set to None if postal (nullable) is None + # and model_fields_set contains the field + if self.postal is None and "postal" in self.model_fields_set: + _dict['postal'] = None + + # set to None if state (nullable) is None + # and model_fields_set contains the field + if self.state is None and "state" in self.model_fields_set: + _dict['state'] = None + + # set to None if country (nullable) is None + # and model_fields_set contains the field + if self.country is None and "country" in self.model_fields_set: + _dict['country'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ManagementProjectsBrandingUpdateResponseBodyAddress from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "street": obj.get("street"), + "city": obj.get("city"), + "postal": obj.get("postal"), + "state": obj.get("state"), + "country": obj.get("country") + }) + return _obj + + diff --git a/voucherify/models/management_projects_branding_update_response_body_brand.py b/voucherify/models/management_projects_branding_update_response_body_brand.py new file mode 100644 index 00000000..be3a08b0 --- /dev/null +++ b/voucherify/models/management_projects_branding_update_response_body_brand.py @@ -0,0 +1,121 @@ +# coding: utf-8 + +""" + Voucherify API + + Voucherify promotion engine REST API. Please see https://docs.voucherify.io/docs for more details. + + The version of the OpenAPI document: v2018-08-01 + Contact: support@voucherify.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class ManagementProjectsBrandingUpdateResponseBodyBrand(BaseModel): + """ + Defines basic brand details. + """ # noqa: E501 + name: Optional[StrictStr] = Field(default=None, description="Defines brand name.") + privacy_policy_url: Optional[StrictStr] = Field(default=None, description="Defines the URL to the brand's privacy policy. It must be a valid URL format.") + terms_of_use_url: Optional[StrictStr] = Field(default=None, description="Defines the URL to the brand's terms of use. It must be a valid URL format.") + permission_reminder: Optional[StrictStr] = Field(default=None, description="Defines the message that is displayed to customers who opted in an email newsletter.") + website_url: Optional[StrictStr] = Field(default=None, description="Defines the URL to the brand's website. It must be a valid URL format.") + __properties: ClassVar[List[str]] = ["name", "privacy_policy_url", "terms_of_use_url", "permission_reminder", "website_url"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ManagementProjectsBrandingUpdateResponseBodyBrand from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if name (nullable) is None + # and model_fields_set contains the field + if self.name is None and "name" in self.model_fields_set: + _dict['name'] = None + + # set to None if privacy_policy_url (nullable) is None + # and model_fields_set contains the field + if self.privacy_policy_url is None and "privacy_policy_url" in self.model_fields_set: + _dict['privacy_policy_url'] = None + + # set to None if terms_of_use_url (nullable) is None + # and model_fields_set contains the field + if self.terms_of_use_url is None and "terms_of_use_url" in self.model_fields_set: + _dict['terms_of_use_url'] = None + + # set to None if permission_reminder (nullable) is None + # and model_fields_set contains the field + if self.permission_reminder is None and "permission_reminder" in self.model_fields_set: + _dict['permission_reminder'] = None + + # set to None if website_url (nullable) is None + # and model_fields_set contains the field + if self.website_url is None and "website_url" in self.model_fields_set: + _dict['website_url'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ManagementProjectsBrandingUpdateResponseBodyBrand from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "name": obj.get("name"), + "privacy_policy_url": obj.get("privacy_policy_url"), + "terms_of_use_url": obj.get("terms_of_use_url"), + "permission_reminder": obj.get("permission_reminder"), + "website_url": obj.get("website_url") + }) + return _obj + + diff --git a/voucherify/models/management_projects_branding_update_response_body_cockpits.py b/voucherify/models/management_projects_branding_update_response_body_cockpits.py new file mode 100644 index 00000000..3610a112 --- /dev/null +++ b/voucherify/models/management_projects_branding_update_response_body_cockpits.py @@ -0,0 +1,152 @@ +# coding: utf-8 + +""" + Voucherify API + + Voucherify promotion engine REST API. Please see https://docs.voucherify.io/docs for more details. + + The version of the OpenAPI document: v2018-08-01 + Contact: support@voucherify.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class ManagementProjectsBrandingUpdateResponseBodyCockpits(BaseModel): + """ + Defines customer cockpit details. + """ # noqa: E501 + campaigns_overview_enabled: Optional[StrictBool] = Field(default=None, description="Enables the campaign overview for customers.") + loyalty_enabled: Optional[StrictBool] = Field(default=None, description="Enables the loyalty campaign overview for customers.") + gift_cards_enabled: Optional[StrictBool] = Field(default=None, description="Enables the gift card overview for customers.") + coupons_enabled: Optional[StrictBool] = Field(default=None, description="Enables the discount coupon overview for customers.") + referrals_enabled: Optional[StrictBool] = Field(default=None, description="Enables the referral campaign overview for customers.") + theme: Optional[StrictStr] = Field(default=None, description="Determines the color scheme of the customer cockpit.") + use_custom_double_opt_in_redirect_url: Optional[StrictBool] = Field(default=None, description="Enables the double opt-in option. It must be a valid URL format.") + custom_double_opt_in_redirect_url: Optional[StrictStr] = Field(default=None, description="Defines the URL for the double opt-in consent. It must be a valid URL format.") + __properties: ClassVar[List[str]] = ["campaigns_overview_enabled", "loyalty_enabled", "gift_cards_enabled", "coupons_enabled", "referrals_enabled", "theme", "use_custom_double_opt_in_redirect_url", "custom_double_opt_in_redirect_url"] + + @field_validator('theme') + def theme_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['blue', 'dark-green', 'default', 'green', 'grey', 'orange', 'purple', 'red']): + raise ValueError("must be one of enum values ('blue', 'dark-green', 'default', 'green', 'grey', 'orange', 'purple', 'red')") + return value + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ManagementProjectsBrandingUpdateResponseBodyCockpits from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if campaigns_overview_enabled (nullable) is None + # and model_fields_set contains the field + if self.campaigns_overview_enabled is None and "campaigns_overview_enabled" in self.model_fields_set: + _dict['campaigns_overview_enabled'] = None + + # set to None if loyalty_enabled (nullable) is None + # and model_fields_set contains the field + if self.loyalty_enabled is None and "loyalty_enabled" in self.model_fields_set: + _dict['loyalty_enabled'] = None + + # set to None if gift_cards_enabled (nullable) is None + # and model_fields_set contains the field + if self.gift_cards_enabled is None and "gift_cards_enabled" in self.model_fields_set: + _dict['gift_cards_enabled'] = None + + # set to None if coupons_enabled (nullable) is None + # and model_fields_set contains the field + if self.coupons_enabled is None and "coupons_enabled" in self.model_fields_set: + _dict['coupons_enabled'] = None + + # set to None if referrals_enabled (nullable) is None + # and model_fields_set contains the field + if self.referrals_enabled is None and "referrals_enabled" in self.model_fields_set: + _dict['referrals_enabled'] = None + + # set to None if theme (nullable) is None + # and model_fields_set contains the field + if self.theme is None and "theme" in self.model_fields_set: + _dict['theme'] = None + + # set to None if use_custom_double_opt_in_redirect_url (nullable) is None + # and model_fields_set contains the field + if self.use_custom_double_opt_in_redirect_url is None and "use_custom_double_opt_in_redirect_url" in self.model_fields_set: + _dict['use_custom_double_opt_in_redirect_url'] = None + + # set to None if custom_double_opt_in_redirect_url (nullable) is None + # and model_fields_set contains the field + if self.custom_double_opt_in_redirect_url is None and "custom_double_opt_in_redirect_url" in self.model_fields_set: + _dict['custom_double_opt_in_redirect_url'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ManagementProjectsBrandingUpdateResponseBodyCockpits from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "campaigns_overview_enabled": obj.get("campaigns_overview_enabled"), + "loyalty_enabled": obj.get("loyalty_enabled"), + "gift_cards_enabled": obj.get("gift_cards_enabled"), + "coupons_enabled": obj.get("coupons_enabled"), + "referrals_enabled": obj.get("referrals_enabled"), + "theme": obj.get("theme"), + "use_custom_double_opt_in_redirect_url": obj.get("use_custom_double_opt_in_redirect_url"), + "custom_double_opt_in_redirect_url": obj.get("custom_double_opt_in_redirect_url") + }) + return _obj + + diff --git a/voucherify/models/management_projects_branding_update_response_body_contact.py b/voucherify/models/management_projects_branding_update_response_body_contact.py new file mode 100644 index 00000000..347768de --- /dev/null +++ b/voucherify/models/management_projects_branding_update_response_body_contact.py @@ -0,0 +1,100 @@ +# coding: utf-8 + +""" + Voucherify API + + Voucherify promotion engine REST API. Please see https://docs.voucherify.io/docs for more details. + + The version of the OpenAPI document: v2018-08-01 + Contact: support@voucherify.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class ManagementProjectsBrandingUpdateResponseBodyContact(BaseModel): + """ + Defines contact details. + """ # noqa: E501 + email: Optional[StrictStr] = Field(default=None, description="Defines the brand's email address. It must be a valid email format.") + phone: Optional[StrictStr] = Field(default=None, description="Defines the brand's phone number.") + __properties: ClassVar[List[str]] = ["email", "phone"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ManagementProjectsBrandingUpdateResponseBodyContact from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if email (nullable) is None + # and model_fields_set contains the field + if self.email is None and "email" in self.model_fields_set: + _dict['email'] = None + + # set to None if phone (nullable) is None + # and model_fields_set contains the field + if self.phone is None and "phone" in self.model_fields_set: + _dict['phone'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ManagementProjectsBrandingUpdateResponseBodyContact from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "email": obj.get("email"), + "phone": obj.get("phone") + }) + return _obj + + diff --git a/voucherify/models/management_projects_create_request_body.py b/voucherify/models/management_projects_create_request_body.py new file mode 100644 index 00000000..28a69de1 --- /dev/null +++ b/voucherify/models/management_projects_create_request_body.py @@ -0,0 +1,255 @@ +# coding: utf-8 + +""" + Voucherify API + + Voucherify promotion engine REST API. Please see https://docs.voucherify.io/docs for more details. + + The version of the OpenAPI document: v2018-08-01 + Contact: support@voucherify.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from voucherify.models.management_projects_create_request_body_api_usage_notifications import ManagementProjectsCreateRequestBodyApiUsageNotifications +from voucherify.models.management_projects_create_request_body_users_item import ManagementProjectsCreateRequestBodyUsersItem +from voucherify.models.management_projects_create_request_body_webhooks_callout_notifications import ManagementProjectsCreateRequestBodyWebhooksCalloutNotifications +from typing import Optional, Set +from typing_extensions import Self + +class ManagementProjectsCreateRequestBody(BaseModel): + """ + Request body schema for **POST** `v1/management/v1/projects`. + """ # noqa: E501 + case_sensitive_codes: Optional[StrictBool] = Field(default=None, description="Determines if the vouchers in the project will be case sensitive (if `true`, `C0dE-cfV` is not equal to `c0de-cfv`) or case insensitive (if false, `C0dE-cfV` is equal to `c0de-cfv`).") + name: Optional[StrictStr] = Field(default=None, description="The name of the project.") + description: Optional[StrictStr] = Field(default=None, description="A user-defined description of the project, e.g. its purpose, scope, region.") + timezone: Optional[StrictStr] = Field(default=None, description="The time zone in which the project is established. It can be in the GMT format or in accordance with IANA time zone database.") + currency: Optional[StrictStr] = Field(default=None, description="The currency used in the project. It is equal to a 3-letter ISO 4217 code.") + dial_code: Optional[StrictStr] = Field(default=None, description="The country dial code for the project. It is equal to an ITU country code.") + webhook_version: Optional[StrictStr] = Field(default='v2024-01-01', description="The webhook version used in the project.") + client_trusted_domains: Optional[List[StrictStr]] = Field(default=None, description="An array of URL addresses that allow client requests.") + client_redeem_enabled: Optional[StrictBool] = Field(default=None, description="Enables client-side redemption.") + client_publish_enabled: Optional[StrictBool] = Field(default=None, description="Enables client-side publication.") + client_list_vouchers_enabled: Optional[StrictBool] = Field(default=None, description="Enables client-side listing of vouchers.") + client_create_customer_enabled: Optional[StrictBool] = Field(default=None, description="Enables client-side creation of customers.") + client_loyalty_events_enabled: Optional[StrictBool] = Field(default=None, description="Enables client-side events for loyalty and referral programs.") + client_set_voucher_expiration_date_enabled: Optional[StrictBool] = Field(default=None, description="Enables client-side setting of voucher expiration date.") + api_usage_notifications: Optional[ManagementProjectsCreateRequestBodyApiUsageNotifications] = None + webhooks_callout_notifications: Optional[ManagementProjectsCreateRequestBodyWebhooksCalloutNotifications] = None + cluster_id: Optional[StrictStr] = Field(default=None, description="The identifier of the cluster where the project will be created. The default cluster is `eu1` unless otherwise configured.") + api_version: Optional[StrictStr] = Field(default='v2018-08-01', description="The API version used in the project. Currently, the default and only value is `v2018-08-01`.") + users: Optional[List[ManagementProjectsCreateRequestBodyUsersItem]] = Field(default=None, description="The users (their identifiers, logins, and roles) who will be assigned to the project. You can assign only existing Voucherify users. It must be used either in the following combinations: - `id` and `role`, or - `login` and `role`.") + __properties: ClassVar[List[str]] = ["case_sensitive_codes", "name", "description", "timezone", "currency", "dial_code", "webhook_version", "client_trusted_domains", "client_redeem_enabled", "client_publish_enabled", "client_list_vouchers_enabled", "client_create_customer_enabled", "client_loyalty_events_enabled", "client_set_voucher_expiration_date_enabled", "api_usage_notifications", "webhooks_callout_notifications", "cluster_id", "api_version", "users"] + + @field_validator('webhook_version') + def webhook_version_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['v2024-01-01']): + raise ValueError("must be one of enum values ('v2024-01-01')") + return value + + @field_validator('api_version') + def api_version_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['v2018-08-01']): + raise ValueError("must be one of enum values ('v2018-08-01')") + return value + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ManagementProjectsCreateRequestBody from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of api_usage_notifications + if self.api_usage_notifications: + _dict['api_usage_notifications'] = self.api_usage_notifications.to_dict() + # override the default output from pydantic by calling `to_dict()` of webhooks_callout_notifications + if self.webhooks_callout_notifications: + _dict['webhooks_callout_notifications'] = self.webhooks_callout_notifications.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in users (list) + _items = [] + if self.users: + for _item_users in self.users: + if _item_users: + _items.append(_item_users.to_dict()) + _dict['users'] = _items + # set to None if case_sensitive_codes (nullable) is None + # and model_fields_set contains the field + if self.case_sensitive_codes is None and "case_sensitive_codes" in self.model_fields_set: + _dict['case_sensitive_codes'] = None + + # set to None if name (nullable) is None + # and model_fields_set contains the field + if self.name is None and "name" in self.model_fields_set: + _dict['name'] = None + + # set to None if description (nullable) is None + # and model_fields_set contains the field + if self.description is None and "description" in self.model_fields_set: + _dict['description'] = None + + # set to None if timezone (nullable) is None + # and model_fields_set contains the field + if self.timezone is None and "timezone" in self.model_fields_set: + _dict['timezone'] = None + + # set to None if currency (nullable) is None + # and model_fields_set contains the field + if self.currency is None and "currency" in self.model_fields_set: + _dict['currency'] = None + + # set to None if dial_code (nullable) is None + # and model_fields_set contains the field + if self.dial_code is None and "dial_code" in self.model_fields_set: + _dict['dial_code'] = None + + # set to None if webhook_version (nullable) is None + # and model_fields_set contains the field + if self.webhook_version is None and "webhook_version" in self.model_fields_set: + _dict['webhook_version'] = None + + # set to None if client_trusted_domains (nullable) is None + # and model_fields_set contains the field + if self.client_trusted_domains is None and "client_trusted_domains" in self.model_fields_set: + _dict['client_trusted_domains'] = None + + # set to None if client_redeem_enabled (nullable) is None + # and model_fields_set contains the field + if self.client_redeem_enabled is None and "client_redeem_enabled" in self.model_fields_set: + _dict['client_redeem_enabled'] = None + + # set to None if client_publish_enabled (nullable) is None + # and model_fields_set contains the field + if self.client_publish_enabled is None and "client_publish_enabled" in self.model_fields_set: + _dict['client_publish_enabled'] = None + + # set to None if client_list_vouchers_enabled (nullable) is None + # and model_fields_set contains the field + if self.client_list_vouchers_enabled is None and "client_list_vouchers_enabled" in self.model_fields_set: + _dict['client_list_vouchers_enabled'] = None + + # set to None if client_create_customer_enabled (nullable) is None + # and model_fields_set contains the field + if self.client_create_customer_enabled is None and "client_create_customer_enabled" in self.model_fields_set: + _dict['client_create_customer_enabled'] = None + + # set to None if client_loyalty_events_enabled (nullable) is None + # and model_fields_set contains the field + if self.client_loyalty_events_enabled is None and "client_loyalty_events_enabled" in self.model_fields_set: + _dict['client_loyalty_events_enabled'] = None + + # set to None if client_set_voucher_expiration_date_enabled (nullable) is None + # and model_fields_set contains the field + if self.client_set_voucher_expiration_date_enabled is None and "client_set_voucher_expiration_date_enabled" in self.model_fields_set: + _dict['client_set_voucher_expiration_date_enabled'] = None + + # set to None if api_usage_notifications (nullable) is None + # and model_fields_set contains the field + if self.api_usage_notifications is None and "api_usage_notifications" in self.model_fields_set: + _dict['api_usage_notifications'] = None + + # set to None if webhooks_callout_notifications (nullable) is None + # and model_fields_set contains the field + if self.webhooks_callout_notifications is None and "webhooks_callout_notifications" in self.model_fields_set: + _dict['webhooks_callout_notifications'] = None + + # set to None if cluster_id (nullable) is None + # and model_fields_set contains the field + if self.cluster_id is None and "cluster_id" in self.model_fields_set: + _dict['cluster_id'] = None + + # set to None if api_version (nullable) is None + # and model_fields_set contains the field + if self.api_version is None and "api_version" in self.model_fields_set: + _dict['api_version'] = None + + # set to None if users (nullable) is None + # and model_fields_set contains the field + if self.users is None and "users" in self.model_fields_set: + _dict['users'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ManagementProjectsCreateRequestBody from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "case_sensitive_codes": obj.get("case_sensitive_codes"), + "name": obj.get("name"), + "description": obj.get("description"), + "timezone": obj.get("timezone"), + "currency": obj.get("currency"), + "dial_code": obj.get("dial_code"), + "webhook_version": obj.get("webhook_version") if obj.get("webhook_version") is not None else 'v2024-01-01', + "client_trusted_domains": obj.get("client_trusted_domains"), + "client_redeem_enabled": obj.get("client_redeem_enabled"), + "client_publish_enabled": obj.get("client_publish_enabled"), + "client_list_vouchers_enabled": obj.get("client_list_vouchers_enabled"), + "client_create_customer_enabled": obj.get("client_create_customer_enabled"), + "client_loyalty_events_enabled": obj.get("client_loyalty_events_enabled"), + "client_set_voucher_expiration_date_enabled": obj.get("client_set_voucher_expiration_date_enabled"), + "api_usage_notifications": ManagementProjectsCreateRequestBodyApiUsageNotifications.from_dict(obj["api_usage_notifications"]) if obj.get("api_usage_notifications") is not None else None, + "webhooks_callout_notifications": ManagementProjectsCreateRequestBodyWebhooksCalloutNotifications.from_dict(obj["webhooks_callout_notifications"]) if obj.get("webhooks_callout_notifications") is not None else None, + "cluster_id": obj.get("cluster_id"), + "api_version": obj.get("api_version") if obj.get("api_version") is not None else 'v2018-08-01', + "users": [ManagementProjectsCreateRequestBodyUsersItem.from_dict(_item) for _item in obj["users"]] if obj.get("users") is not None else None + }) + return _obj + + diff --git a/voucherify/models/management_projects_create_request_body_api_usage_notifications.py b/voucherify/models/management_projects_create_request_body_api_usage_notifications.py new file mode 100644 index 00000000..db0c7f24 --- /dev/null +++ b/voucherify/models/management_projects_create_request_body_api_usage_notifications.py @@ -0,0 +1,117 @@ +# coding: utf-8 + +""" + Voucherify API + + Voucherify promotion engine REST API. Please see https://docs.voucherify.io/docs for more details. + + The version of the OpenAPI document: v2018-08-01 + Contact: support@voucherify.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict +from typing import Any, ClassVar, Dict, List, Optional +from voucherify.models.usage_notifications import UsageNotifications +from typing import Optional, Set +from typing_extensions import Self + +class ManagementProjectsCreateRequestBodyApiUsageNotifications(BaseModel): + """ + Determines the notification settings. + """ # noqa: E501 + redemptions: Optional[UsageNotifications] = None + messages: Optional[UsageNotifications] = None + api_calls: Optional[UsageNotifications] = None + bulk_api_calls: Optional[UsageNotifications] = None + webhook_calls: Optional[UsageNotifications] = None + cycle_calls: Optional[UsageNotifications] = None + __properties: ClassVar[List[str]] = ["redemptions", "messages", "api_calls", "bulk_api_calls", "webhook_calls", "cycle_calls"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ManagementProjectsCreateRequestBodyApiUsageNotifications from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of redemptions + if self.redemptions: + _dict['redemptions'] = self.redemptions.to_dict() + # override the default output from pydantic by calling `to_dict()` of messages + if self.messages: + _dict['messages'] = self.messages.to_dict() + # override the default output from pydantic by calling `to_dict()` of api_calls + if self.api_calls: + _dict['api_calls'] = self.api_calls.to_dict() + # override the default output from pydantic by calling `to_dict()` of bulk_api_calls + if self.bulk_api_calls: + _dict['bulk_api_calls'] = self.bulk_api_calls.to_dict() + # override the default output from pydantic by calling `to_dict()` of webhook_calls + if self.webhook_calls: + _dict['webhook_calls'] = self.webhook_calls.to_dict() + # override the default output from pydantic by calling `to_dict()` of cycle_calls + if self.cycle_calls: + _dict['cycle_calls'] = self.cycle_calls.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ManagementProjectsCreateRequestBodyApiUsageNotifications from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "redemptions": UsageNotifications.from_dict(obj["redemptions"]) if obj.get("redemptions") is not None else None, + "messages": UsageNotifications.from_dict(obj["messages"]) if obj.get("messages") is not None else None, + "api_calls": UsageNotifications.from_dict(obj["api_calls"]) if obj.get("api_calls") is not None else None, + "bulk_api_calls": UsageNotifications.from_dict(obj["bulk_api_calls"]) if obj.get("bulk_api_calls") is not None else None, + "webhook_calls": UsageNotifications.from_dict(obj["webhook_calls"]) if obj.get("webhook_calls") is not None else None, + "cycle_calls": UsageNotifications.from_dict(obj["cycle_calls"]) if obj.get("cycle_calls") is not None else None + }) + return _obj + + diff --git a/voucherify/models/management_projects_create_request_body_users_item.py b/voucherify/models/management_projects_create_request_body_users_item.py new file mode 100644 index 00000000..817ca3af --- /dev/null +++ b/voucherify/models/management_projects_create_request_body_users_item.py @@ -0,0 +1,92 @@ +# coding: utf-8 + +""" + Voucherify API + + Voucherify promotion engine REST API. Please see https://docs.voucherify.io/docs for more details. + + The version of the OpenAPI document: v2018-08-01 + Contact: support@voucherify.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class ManagementProjectsCreateRequestBodyUsersItem(BaseModel): + """ + Contains details about the users who will be assigned to the project. Only the `id` and `role` or `login` and `role` should be provided in the request. + """ # noqa: E501 + id: Optional[StrictStr] = Field(default=None, description="The unique identifier of the user who will be assigned to the project. It can be found in Team Settings > Team > Edit member. **Required** with the `role` string. Do **not** use with the `login` string.") + login: Optional[StrictStr] = Field(default=None, description="The login data of the user who will be assigned to the project. **Required** with the `role` string. Do **not** use with the `id` string.") + role: StrictStr = Field(description="The role of the user to be added. It can be one of the following predefined roles: `ADMIN`, `USER`, `VIEWER`, `MERCHANT` or an ID of a custom role.") + __properties: ClassVar[List[str]] = ["id", "login", "role"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ManagementProjectsCreateRequestBodyUsersItem from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ManagementProjectsCreateRequestBodyUsersItem from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id"), + "login": obj.get("login"), + "role": obj.get("role") + }) + return _obj + + diff --git a/voucherify/models/management_projects_create_request_body_webhooks_callout_notifications.py b/voucherify/models/management_projects_create_request_body_webhooks_callout_notifications.py new file mode 100644 index 00000000..eb00aa68 --- /dev/null +++ b/voucherify/models/management_projects_create_request_body_webhooks_callout_notifications.py @@ -0,0 +1,108 @@ +# coding: utf-8 + +""" + Voucherify API + + Voucherify promotion engine REST API. Please see https://docs.voucherify.io/docs for more details. + + The version of the OpenAPI document: v2018-08-01 + Contact: support@voucherify.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict +from typing import Any, ClassVar, Dict, List, Optional +from voucherify.models.management_projects_create_request_body_webhooks_callout_notifications_distributions import ManagementProjectsCreateRequestBodyWebhooksCalloutNotificationsDistributions +from voucherify.models.management_projects_create_request_body_webhooks_callout_notifications_webhooks import ManagementProjectsCreateRequestBodyWebhooksCalloutNotificationsWebhooks +from typing import Optional, Set +from typing_extensions import Self + +class ManagementProjectsCreateRequestBodyWebhooksCalloutNotifications(BaseModel): + """ + Determines the notification settings for webhook callouts configured in Distributions and Project settings. + """ # noqa: E501 + distributions: Optional[ManagementProjectsCreateRequestBodyWebhooksCalloutNotificationsDistributions] = None + webhooks: Optional[ManagementProjectsCreateRequestBodyWebhooksCalloutNotificationsWebhooks] = None + __properties: ClassVar[List[str]] = ["distributions", "webhooks"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ManagementProjectsCreateRequestBodyWebhooksCalloutNotifications from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of distributions + if self.distributions: + _dict['distributions'] = self.distributions.to_dict() + # override the default output from pydantic by calling `to_dict()` of webhooks + if self.webhooks: + _dict['webhooks'] = self.webhooks.to_dict() + # set to None if distributions (nullable) is None + # and model_fields_set contains the field + if self.distributions is None and "distributions" in self.model_fields_set: + _dict['distributions'] = None + + # set to None if webhooks (nullable) is None + # and model_fields_set contains the field + if self.webhooks is None and "webhooks" in self.model_fields_set: + _dict['webhooks'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ManagementProjectsCreateRequestBodyWebhooksCalloutNotifications from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "distributions": ManagementProjectsCreateRequestBodyWebhooksCalloutNotificationsDistributions.from_dict(obj["distributions"]) if obj.get("distributions") is not None else None, + "webhooks": ManagementProjectsCreateRequestBodyWebhooksCalloutNotificationsWebhooks.from_dict(obj["webhooks"]) if obj.get("webhooks") is not None else None + }) + return _obj + + diff --git a/voucherify/models/management_projects_create_request_body_webhooks_callout_notifications_distributions.py b/voucherify/models/management_projects_create_request_body_webhooks_callout_notifications_distributions.py new file mode 100644 index 00000000..f6e63adf --- /dev/null +++ b/voucherify/models/management_projects_create_request_body_webhooks_callout_notifications_distributions.py @@ -0,0 +1,107 @@ +# coding: utf-8 + +""" + Voucherify API + + Voucherify promotion engine REST API. Please see https://docs.voucherify.io/docs for more details. + + The version of the OpenAPI document: v2018-08-01 + Contact: support@voucherify.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class ManagementProjectsCreateRequestBodyWebhooksCalloutNotificationsDistributions(BaseModel): + """ + Determines the notification settings for webhooks sent through Distributions. + """ # noqa: E501 + email: Optional[StrictBool] = Field(default=None, description="Enables the notification through an email.") + in_app: Optional[StrictBool] = Field(default=None, description="Enables the notification through an email.") + emails: Optional[List[StrictStr]] = Field(default=None, description="An array of email addresses which will receive the notification.") + __properties: ClassVar[List[str]] = ["email", "in_app", "emails"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ManagementProjectsCreateRequestBodyWebhooksCalloutNotificationsDistributions from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if email (nullable) is None + # and model_fields_set contains the field + if self.email is None and "email" in self.model_fields_set: + _dict['email'] = None + + # set to None if in_app (nullable) is None + # and model_fields_set contains the field + if self.in_app is None and "in_app" in self.model_fields_set: + _dict['in_app'] = None + + # set to None if emails (nullable) is None + # and model_fields_set contains the field + if self.emails is None and "emails" in self.model_fields_set: + _dict['emails'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ManagementProjectsCreateRequestBodyWebhooksCalloutNotificationsDistributions from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "email": obj.get("email"), + "in_app": obj.get("in_app"), + "emails": obj.get("emails") + }) + return _obj + + diff --git a/voucherify/models/management_projects_create_request_body_webhooks_callout_notifications_webhooks.py b/voucherify/models/management_projects_create_request_body_webhooks_callout_notifications_webhooks.py new file mode 100644 index 00000000..608d07cf --- /dev/null +++ b/voucherify/models/management_projects_create_request_body_webhooks_callout_notifications_webhooks.py @@ -0,0 +1,107 @@ +# coding: utf-8 + +""" + Voucherify API + + Voucherify promotion engine REST API. Please see https://docs.voucherify.io/docs for more details. + + The version of the OpenAPI document: v2018-08-01 + Contact: support@voucherify.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class ManagementProjectsCreateRequestBodyWebhooksCalloutNotificationsWebhooks(BaseModel): + """ + Determines the notification settings for webhooks sent as set out in the Project settings. + """ # noqa: E501 + email: Optional[StrictBool] = Field(default=None, description="Enables the notification through an email.") + in_app: Optional[StrictBool] = Field(default=None, description="Enables the notification through an email.") + emails: Optional[List[StrictStr]] = Field(default=None, description="An array of email addresses which will receive the notification.") + __properties: ClassVar[List[str]] = ["email", "in_app", "emails"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ManagementProjectsCreateRequestBodyWebhooksCalloutNotificationsWebhooks from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if email (nullable) is None + # and model_fields_set contains the field + if self.email is None and "email" in self.model_fields_set: + _dict['email'] = None + + # set to None if in_app (nullable) is None + # and model_fields_set contains the field + if self.in_app is None and "in_app" in self.model_fields_set: + _dict['in_app'] = None + + # set to None if emails (nullable) is None + # and model_fields_set contains the field + if self.emails is None and "emails" in self.model_fields_set: + _dict['emails'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ManagementProjectsCreateRequestBodyWebhooksCalloutNotificationsWebhooks from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "email": obj.get("email"), + "in_app": obj.get("in_app"), + "emails": obj.get("emails") + }) + return _obj + + diff --git a/voucherify/models/management_projects_create_response_body.py b/voucherify/models/management_projects_create_response_body.py new file mode 100644 index 00000000..357a248e --- /dev/null +++ b/voucherify/models/management_projects_create_response_body.py @@ -0,0 +1,283 @@ +# coding: utf-8 + +""" + Voucherify API + + Voucherify promotion engine REST API. Please see https://docs.voucherify.io/docs for more details. + + The version of the OpenAPI document: v2018-08-01 + Contact: support@voucherify.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from voucherify.models.management_projects_create_response_body_api_usage_notifications import ManagementProjectsCreateResponseBodyApiUsageNotifications +from voucherify.models.management_projects_create_response_body_client_side_key import ManagementProjectsCreateResponseBodyClientSideKey +from voucherify.models.management_projects_create_response_body_server_side_key import ManagementProjectsCreateResponseBodyServerSideKey +from voucherify.models.management_projects_create_response_body_webhooks_callout_notifications import ManagementProjectsCreateResponseBodyWebhooksCalloutNotifications +from typing import Optional, Set +from typing_extensions import Self + +class ManagementProjectsCreateResponseBody(BaseModel): + """ + Response body schema for **POST** `management/v1/projects`. + """ # noqa: E501 + id: Optional[StrictStr] = Field(default=None, description="Unique identifier of the project.") + name: Optional[StrictStr] = Field(default=None, description="The name of the project.") + description: Optional[StrictStr] = Field(default=None, description="A user-defined description of the project, e.g. its purpose, scope, region.") + timezone: Optional[StrictStr] = Field(default=None, description="The time zone in which the project is established. It can be in the GMT format or in accordance with IANA time zone database.") + currency: Optional[StrictStr] = Field(default=None, description="The currency used in the project. It is equal to a 3-letter ISO 4217 code.") + dial_code: Optional[StrictStr] = Field(default=None, description="The country dial code for the project. It is equal to an ITU country code.") + webhook_version: Optional[StrictStr] = Field(default='v2024-01-01', description="The webhook version used in the project.") + client_trusted_domains: Optional[List[StrictStr]] = Field(default=None, description="An array of URL addresses that allow client requests.") + client_redeem_enabled: Optional[StrictBool] = Field(default=None, description="Enables client-side redemption.") + client_publish_enabled: Optional[StrictBool] = Field(default=None, description="Enables client-side publication.") + client_list_vouchers_enabled: Optional[StrictBool] = Field(default=None, description="Enables client-side listing of vouchers.") + client_create_customer_enabled: Optional[StrictBool] = Field(default=None, description="Enables client-side creation of customers.") + client_loyalty_events_enabled: Optional[StrictBool] = Field(default=None, description="Enables client-side events for loyalty and referral programs.") + client_set_voucher_expiration_date_enabled: Optional[StrictBool] = Field(default=None, description="Enables client-side setting of voucher expiration date.") + api_usage_notifications: Optional[ManagementProjectsCreateResponseBodyApiUsageNotifications] = None + webhooks_callout_notifications: Optional[ManagementProjectsCreateResponseBodyWebhooksCalloutNotifications] = None + cluster_id: Optional[StrictStr] = Field(default=None, description="The identifier of the cluster where the project will be created.") + case_sensitive_codes: Optional[StrictBool] = Field(default=None, description="Determines if the vouchers in the project will be: - case sensitive - if `true`, `C0dE-cfV` is **not** equal to `c0de-cfv`), - case insensitive - if `false`, `C0dE-cfV` is equal to `c0de-cfv`.") + api_version: Optional[StrictStr] = Field(default='v2018-08-01', description="The API version used in the project. Currently, the default and only value is `v2018-08-01`.") + is_sandbox: Optional[StrictBool] = Field(default=None, description="Determines if the project is a sandbox project.") + webhook_token: Optional[StrictStr] = Field(default=None, description="Webhook token used for authentication.") + server_side_key: Optional[ManagementProjectsCreateResponseBodyServerSideKey] = None + client_side_key: Optional[ManagementProjectsCreateResponseBodyClientSideKey] = None + __properties: ClassVar[List[str]] = ["id", "name", "description", "timezone", "currency", "dial_code", "webhook_version", "client_trusted_domains", "client_redeem_enabled", "client_publish_enabled", "client_list_vouchers_enabled", "client_create_customer_enabled", "client_loyalty_events_enabled", "client_set_voucher_expiration_date_enabled", "api_usage_notifications", "webhooks_callout_notifications", "cluster_id", "case_sensitive_codes", "api_version", "is_sandbox", "webhook_token", "server_side_key", "client_side_key"] + + @field_validator('webhook_version') + def webhook_version_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['v2024-01-01']): + raise ValueError("must be one of enum values ('v2024-01-01')") + return value + + @field_validator('api_version') + def api_version_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['v2018-08-01']): + raise ValueError("must be one of enum values ('v2018-08-01')") + return value + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ManagementProjectsCreateResponseBody from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of api_usage_notifications + if self.api_usage_notifications: + _dict['api_usage_notifications'] = self.api_usage_notifications.to_dict() + # override the default output from pydantic by calling `to_dict()` of webhooks_callout_notifications + if self.webhooks_callout_notifications: + _dict['webhooks_callout_notifications'] = self.webhooks_callout_notifications.to_dict() + # override the default output from pydantic by calling `to_dict()` of server_side_key + if self.server_side_key: + _dict['server_side_key'] = self.server_side_key.to_dict() + # override the default output from pydantic by calling `to_dict()` of client_side_key + if self.client_side_key: + _dict['client_side_key'] = self.client_side_key.to_dict() + # set to None if id (nullable) is None + # and model_fields_set contains the field + if self.id is None and "id" in self.model_fields_set: + _dict['id'] = None + + # set to None if name (nullable) is None + # and model_fields_set contains the field + if self.name is None and "name" in self.model_fields_set: + _dict['name'] = None + + # set to None if description (nullable) is None + # and model_fields_set contains the field + if self.description is None and "description" in self.model_fields_set: + _dict['description'] = None + + # set to None if timezone (nullable) is None + # and model_fields_set contains the field + if self.timezone is None and "timezone" in self.model_fields_set: + _dict['timezone'] = None + + # set to None if currency (nullable) is None + # and model_fields_set contains the field + if self.currency is None and "currency" in self.model_fields_set: + _dict['currency'] = None + + # set to None if dial_code (nullable) is None + # and model_fields_set contains the field + if self.dial_code is None and "dial_code" in self.model_fields_set: + _dict['dial_code'] = None + + # set to None if webhook_version (nullable) is None + # and model_fields_set contains the field + if self.webhook_version is None and "webhook_version" in self.model_fields_set: + _dict['webhook_version'] = None + + # set to None if client_trusted_domains (nullable) is None + # and model_fields_set contains the field + if self.client_trusted_domains is None and "client_trusted_domains" in self.model_fields_set: + _dict['client_trusted_domains'] = None + + # set to None if client_redeem_enabled (nullable) is None + # and model_fields_set contains the field + if self.client_redeem_enabled is None and "client_redeem_enabled" in self.model_fields_set: + _dict['client_redeem_enabled'] = None + + # set to None if client_publish_enabled (nullable) is None + # and model_fields_set contains the field + if self.client_publish_enabled is None and "client_publish_enabled" in self.model_fields_set: + _dict['client_publish_enabled'] = None + + # set to None if client_list_vouchers_enabled (nullable) is None + # and model_fields_set contains the field + if self.client_list_vouchers_enabled is None and "client_list_vouchers_enabled" in self.model_fields_set: + _dict['client_list_vouchers_enabled'] = None + + # set to None if client_create_customer_enabled (nullable) is None + # and model_fields_set contains the field + if self.client_create_customer_enabled is None and "client_create_customer_enabled" in self.model_fields_set: + _dict['client_create_customer_enabled'] = None + + # set to None if client_loyalty_events_enabled (nullable) is None + # and model_fields_set contains the field + if self.client_loyalty_events_enabled is None and "client_loyalty_events_enabled" in self.model_fields_set: + _dict['client_loyalty_events_enabled'] = None + + # set to None if client_set_voucher_expiration_date_enabled (nullable) is None + # and model_fields_set contains the field + if self.client_set_voucher_expiration_date_enabled is None and "client_set_voucher_expiration_date_enabled" in self.model_fields_set: + _dict['client_set_voucher_expiration_date_enabled'] = None + + # set to None if api_usage_notifications (nullable) is None + # and model_fields_set contains the field + if self.api_usage_notifications is None and "api_usage_notifications" in self.model_fields_set: + _dict['api_usage_notifications'] = None + + # set to None if webhooks_callout_notifications (nullable) is None + # and model_fields_set contains the field + if self.webhooks_callout_notifications is None and "webhooks_callout_notifications" in self.model_fields_set: + _dict['webhooks_callout_notifications'] = None + + # set to None if cluster_id (nullable) is None + # and model_fields_set contains the field + if self.cluster_id is None and "cluster_id" in self.model_fields_set: + _dict['cluster_id'] = None + + # set to None if case_sensitive_codes (nullable) is None + # and model_fields_set contains the field + if self.case_sensitive_codes is None and "case_sensitive_codes" in self.model_fields_set: + _dict['case_sensitive_codes'] = None + + # set to None if api_version (nullable) is None + # and model_fields_set contains the field + if self.api_version is None and "api_version" in self.model_fields_set: + _dict['api_version'] = None + + # set to None if is_sandbox (nullable) is None + # and model_fields_set contains the field + if self.is_sandbox is None and "is_sandbox" in self.model_fields_set: + _dict['is_sandbox'] = None + + # set to None if webhook_token (nullable) is None + # and model_fields_set contains the field + if self.webhook_token is None and "webhook_token" in self.model_fields_set: + _dict['webhook_token'] = None + + # set to None if server_side_key (nullable) is None + # and model_fields_set contains the field + if self.server_side_key is None and "server_side_key" in self.model_fields_set: + _dict['server_side_key'] = None + + # set to None if client_side_key (nullable) is None + # and model_fields_set contains the field + if self.client_side_key is None and "client_side_key" in self.model_fields_set: + _dict['client_side_key'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ManagementProjectsCreateResponseBody from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id"), + "name": obj.get("name"), + "description": obj.get("description"), + "timezone": obj.get("timezone"), + "currency": obj.get("currency"), + "dial_code": obj.get("dial_code"), + "webhook_version": obj.get("webhook_version") if obj.get("webhook_version") is not None else 'v2024-01-01', + "client_trusted_domains": obj.get("client_trusted_domains"), + "client_redeem_enabled": obj.get("client_redeem_enabled"), + "client_publish_enabled": obj.get("client_publish_enabled"), + "client_list_vouchers_enabled": obj.get("client_list_vouchers_enabled"), + "client_create_customer_enabled": obj.get("client_create_customer_enabled"), + "client_loyalty_events_enabled": obj.get("client_loyalty_events_enabled"), + "client_set_voucher_expiration_date_enabled": obj.get("client_set_voucher_expiration_date_enabled"), + "api_usage_notifications": ManagementProjectsCreateResponseBodyApiUsageNotifications.from_dict(obj["api_usage_notifications"]) if obj.get("api_usage_notifications") is not None else None, + "webhooks_callout_notifications": ManagementProjectsCreateResponseBodyWebhooksCalloutNotifications.from_dict(obj["webhooks_callout_notifications"]) if obj.get("webhooks_callout_notifications") is not None else None, + "cluster_id": obj.get("cluster_id"), + "case_sensitive_codes": obj.get("case_sensitive_codes"), + "api_version": obj.get("api_version") if obj.get("api_version") is not None else 'v2018-08-01', + "is_sandbox": obj.get("is_sandbox"), + "webhook_token": obj.get("webhook_token"), + "server_side_key": ManagementProjectsCreateResponseBodyServerSideKey.from_dict(obj["server_side_key"]) if obj.get("server_side_key") is not None else None, + "client_side_key": ManagementProjectsCreateResponseBodyClientSideKey.from_dict(obj["client_side_key"]) if obj.get("client_side_key") is not None else None + }) + return _obj + + diff --git a/voucherify/models/management_projects_create_response_body_api_usage_notifications.py b/voucherify/models/management_projects_create_response_body_api_usage_notifications.py new file mode 100644 index 00000000..ed31f9c7 --- /dev/null +++ b/voucherify/models/management_projects_create_response_body_api_usage_notifications.py @@ -0,0 +1,117 @@ +# coding: utf-8 + +""" + Voucherify API + + Voucherify promotion engine REST API. Please see https://docs.voucherify.io/docs for more details. + + The version of the OpenAPI document: v2018-08-01 + Contact: support@voucherify.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict +from typing import Any, ClassVar, Dict, List, Optional +from voucherify.models.usage_notifications import UsageNotifications +from typing import Optional, Set +from typing_extensions import Self + +class ManagementProjectsCreateResponseBodyApiUsageNotifications(BaseModel): + """ + Determines the notification settings. + """ # noqa: E501 + redemptions: Optional[UsageNotifications] = None + messages: Optional[UsageNotifications] = None + api_calls: Optional[UsageNotifications] = None + bulk_api_calls: Optional[UsageNotifications] = None + webhook_calls: Optional[UsageNotifications] = None + cycle_calls: Optional[UsageNotifications] = None + __properties: ClassVar[List[str]] = ["redemptions", "messages", "api_calls", "bulk_api_calls", "webhook_calls", "cycle_calls"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ManagementProjectsCreateResponseBodyApiUsageNotifications from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of redemptions + if self.redemptions: + _dict['redemptions'] = self.redemptions.to_dict() + # override the default output from pydantic by calling `to_dict()` of messages + if self.messages: + _dict['messages'] = self.messages.to_dict() + # override the default output from pydantic by calling `to_dict()` of api_calls + if self.api_calls: + _dict['api_calls'] = self.api_calls.to_dict() + # override the default output from pydantic by calling `to_dict()` of bulk_api_calls + if self.bulk_api_calls: + _dict['bulk_api_calls'] = self.bulk_api_calls.to_dict() + # override the default output from pydantic by calling `to_dict()` of webhook_calls + if self.webhook_calls: + _dict['webhook_calls'] = self.webhook_calls.to_dict() + # override the default output from pydantic by calling `to_dict()` of cycle_calls + if self.cycle_calls: + _dict['cycle_calls'] = self.cycle_calls.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ManagementProjectsCreateResponseBodyApiUsageNotifications from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "redemptions": UsageNotifications.from_dict(obj["redemptions"]) if obj.get("redemptions") is not None else None, + "messages": UsageNotifications.from_dict(obj["messages"]) if obj.get("messages") is not None else None, + "api_calls": UsageNotifications.from_dict(obj["api_calls"]) if obj.get("api_calls") is not None else None, + "bulk_api_calls": UsageNotifications.from_dict(obj["bulk_api_calls"]) if obj.get("bulk_api_calls") is not None else None, + "webhook_calls": UsageNotifications.from_dict(obj["webhook_calls"]) if obj.get("webhook_calls") is not None else None, + "cycle_calls": UsageNotifications.from_dict(obj["cycle_calls"]) if obj.get("cycle_calls") is not None else None + }) + return _obj + + diff --git a/voucherify/models/management_projects_create_response_body_client_side_key.py b/voucherify/models/management_projects_create_response_body_client_side_key.py new file mode 100644 index 00000000..34edd30e --- /dev/null +++ b/voucherify/models/management_projects_create_response_body_client_side_key.py @@ -0,0 +1,100 @@ +# coding: utf-8 + +""" + Voucherify API + + Voucherify promotion engine REST API. Please see https://docs.voucherify.io/docs for more details. + + The version of the OpenAPI document: v2018-08-01 + Contact: support@voucherify.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class ManagementProjectsCreateResponseBodyClientSideKey(BaseModel): + """ + Contains the `app_id` and `app_token` to authenticate client-side requests. + """ # noqa: E501 + app_id: Optional[StrictStr] = Field(default=None, description="Application ID to be used as `X-App-Id` header in every HTTP request.") + app_token: Optional[StrictStr] = Field(default=None, description="Application token to be used as `X-App-Token` header in every HTTP request. The application token (secret key) for the client-side authentication is visible in the Project Settings for 14 days when it is first generated in a newly-created project. Write your application token down and keep it in a safe place.") + __properties: ClassVar[List[str]] = ["app_id", "app_token"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ManagementProjectsCreateResponseBodyClientSideKey from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if app_id (nullable) is None + # and model_fields_set contains the field + if self.app_id is None and "app_id" in self.model_fields_set: + _dict['app_id'] = None + + # set to None if app_token (nullable) is None + # and model_fields_set contains the field + if self.app_token is None and "app_token" in self.model_fields_set: + _dict['app_token'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ManagementProjectsCreateResponseBodyClientSideKey from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "app_id": obj.get("app_id"), + "app_token": obj.get("app_token") + }) + return _obj + + diff --git a/voucherify/models/management_projects_create_response_body_server_side_key.py b/voucherify/models/management_projects_create_response_body_server_side_key.py new file mode 100644 index 00000000..0faa5103 --- /dev/null +++ b/voucherify/models/management_projects_create_response_body_server_side_key.py @@ -0,0 +1,100 @@ +# coding: utf-8 + +""" + Voucherify API + + Voucherify promotion engine REST API. Please see https://docs.voucherify.io/docs for more details. + + The version of the OpenAPI document: v2018-08-01 + Contact: support@voucherify.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class ManagementProjectsCreateResponseBodyServerSideKey(BaseModel): + """ + Contains the `app_id` and `app_token` to authenticate server-side requests. + """ # noqa: E501 + app_id: Optional[StrictStr] = Field(default=None, description="Application ID to be used as `X-App-Id` header in every HTTP request.") + app_token: Optional[StrictStr] = Field(default=None, description="Application token to be used as `X-App-Token` header in every HTTP request. The application token (secret key) for the server-side authentication is visible in the Project Settings for 14 days when it is first generated in a newly-created project. Write your application token down and keep it in a safe place.") + __properties: ClassVar[List[str]] = ["app_id", "app_token"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ManagementProjectsCreateResponseBodyServerSideKey from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if app_id (nullable) is None + # and model_fields_set contains the field + if self.app_id is None and "app_id" in self.model_fields_set: + _dict['app_id'] = None + + # set to None if app_token (nullable) is None + # and model_fields_set contains the field + if self.app_token is None and "app_token" in self.model_fields_set: + _dict['app_token'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ManagementProjectsCreateResponseBodyServerSideKey from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "app_id": obj.get("app_id"), + "app_token": obj.get("app_token") + }) + return _obj + + diff --git a/voucherify/models/management_projects_create_response_body_webhooks_callout_notifications.py b/voucherify/models/management_projects_create_response_body_webhooks_callout_notifications.py new file mode 100644 index 00000000..75d018d0 --- /dev/null +++ b/voucherify/models/management_projects_create_response_body_webhooks_callout_notifications.py @@ -0,0 +1,108 @@ +# coding: utf-8 + +""" + Voucherify API + + Voucherify promotion engine REST API. Please see https://docs.voucherify.io/docs for more details. + + The version of the OpenAPI document: v2018-08-01 + Contact: support@voucherify.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict +from typing import Any, ClassVar, Dict, List, Optional +from voucherify.models.management_projects_create_response_body_webhooks_callout_notifications_distributions import ManagementProjectsCreateResponseBodyWebhooksCalloutNotificationsDistributions +from voucherify.models.management_projects_create_response_body_webhooks_callout_notifications_webhooks import ManagementProjectsCreateResponseBodyWebhooksCalloutNotificationsWebhooks +from typing import Optional, Set +from typing_extensions import Self + +class ManagementProjectsCreateResponseBodyWebhooksCalloutNotifications(BaseModel): + """ + Determines the notification settings for webhook callouts configured in Distributions and Project settings. + """ # noqa: E501 + distributions: Optional[ManagementProjectsCreateResponseBodyWebhooksCalloutNotificationsDistributions] = None + webhooks: Optional[ManagementProjectsCreateResponseBodyWebhooksCalloutNotificationsWebhooks] = None + __properties: ClassVar[List[str]] = ["distributions", "webhooks"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ManagementProjectsCreateResponseBodyWebhooksCalloutNotifications from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of distributions + if self.distributions: + _dict['distributions'] = self.distributions.to_dict() + # override the default output from pydantic by calling `to_dict()` of webhooks + if self.webhooks: + _dict['webhooks'] = self.webhooks.to_dict() + # set to None if distributions (nullable) is None + # and model_fields_set contains the field + if self.distributions is None and "distributions" in self.model_fields_set: + _dict['distributions'] = None + + # set to None if webhooks (nullable) is None + # and model_fields_set contains the field + if self.webhooks is None and "webhooks" in self.model_fields_set: + _dict['webhooks'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ManagementProjectsCreateResponseBodyWebhooksCalloutNotifications from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "distributions": ManagementProjectsCreateResponseBodyWebhooksCalloutNotificationsDistributions.from_dict(obj["distributions"]) if obj.get("distributions") is not None else None, + "webhooks": ManagementProjectsCreateResponseBodyWebhooksCalloutNotificationsWebhooks.from_dict(obj["webhooks"]) if obj.get("webhooks") is not None else None + }) + return _obj + + diff --git a/voucherify/models/management_projects_create_response_body_webhooks_callout_notifications_distributions.py b/voucherify/models/management_projects_create_response_body_webhooks_callout_notifications_distributions.py new file mode 100644 index 00000000..e6745117 --- /dev/null +++ b/voucherify/models/management_projects_create_response_body_webhooks_callout_notifications_distributions.py @@ -0,0 +1,107 @@ +# coding: utf-8 + +""" + Voucherify API + + Voucherify promotion engine REST API. Please see https://docs.voucherify.io/docs for more details. + + The version of the OpenAPI document: v2018-08-01 + Contact: support@voucherify.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class ManagementProjectsCreateResponseBodyWebhooksCalloutNotificationsDistributions(BaseModel): + """ + Determines the notification settings for webhooks sent through Distributions. + """ # noqa: E501 + email: Optional[StrictBool] = Field(default=None, description="Enables the notification through an email.") + in_app: Optional[StrictBool] = Field(default=None, description="Enables the notification through an email.") + emails: Optional[List[StrictStr]] = Field(default=None, description="An array of email addresses which will receive the notification.") + __properties: ClassVar[List[str]] = ["email", "in_app", "emails"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ManagementProjectsCreateResponseBodyWebhooksCalloutNotificationsDistributions from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if email (nullable) is None + # and model_fields_set contains the field + if self.email is None and "email" in self.model_fields_set: + _dict['email'] = None + + # set to None if in_app (nullable) is None + # and model_fields_set contains the field + if self.in_app is None and "in_app" in self.model_fields_set: + _dict['in_app'] = None + + # set to None if emails (nullable) is None + # and model_fields_set contains the field + if self.emails is None and "emails" in self.model_fields_set: + _dict['emails'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ManagementProjectsCreateResponseBodyWebhooksCalloutNotificationsDistributions from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "email": obj.get("email"), + "in_app": obj.get("in_app"), + "emails": obj.get("emails") + }) + return _obj + + diff --git a/voucherify/models/management_projects_create_response_body_webhooks_callout_notifications_webhooks.py b/voucherify/models/management_projects_create_response_body_webhooks_callout_notifications_webhooks.py new file mode 100644 index 00000000..884e1388 --- /dev/null +++ b/voucherify/models/management_projects_create_response_body_webhooks_callout_notifications_webhooks.py @@ -0,0 +1,107 @@ +# coding: utf-8 + +""" + Voucherify API + + Voucherify promotion engine REST API. Please see https://docs.voucherify.io/docs for more details. + + The version of the OpenAPI document: v2018-08-01 + Contact: support@voucherify.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class ManagementProjectsCreateResponseBodyWebhooksCalloutNotificationsWebhooks(BaseModel): + """ + Determines the notification settings for webhooks sent as set out in the Project settings. + """ # noqa: E501 + email: Optional[StrictBool] = Field(default=None, description="Enables the notification through an email.") + in_app: Optional[StrictBool] = Field(default=None, description="Enables the notification through an email.") + emails: Optional[List[StrictStr]] = Field(default=None, description="An array of email addresses which will receive the notification.") + __properties: ClassVar[List[str]] = ["email", "in_app", "emails"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ManagementProjectsCreateResponseBodyWebhooksCalloutNotificationsWebhooks from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if email (nullable) is None + # and model_fields_set contains the field + if self.email is None and "email" in self.model_fields_set: + _dict['email'] = None + + # set to None if in_app (nullable) is None + # and model_fields_set contains the field + if self.in_app is None and "in_app" in self.model_fields_set: + _dict['in_app'] = None + + # set to None if emails (nullable) is None + # and model_fields_set contains the field + if self.emails is None and "emails" in self.model_fields_set: + _dict['emails'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ManagementProjectsCreateResponseBodyWebhooksCalloutNotificationsWebhooks from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "email": obj.get("email"), + "in_app": obj.get("in_app"), + "emails": obj.get("emails") + }) + return _obj + + diff --git a/voucherify/models/management_projects_custom_event_schema.py b/voucherify/models/management_projects_custom_event_schema.py new file mode 100644 index 00000000..10cb7cf1 --- /dev/null +++ b/voucherify/models/management_projects_custom_event_schema.py @@ -0,0 +1,143 @@ +# coding: utf-8 + +""" + Voucherify API + + Voucherify promotion engine REST API. Please see https://docs.voucherify.io/docs for more details. + + The version of the OpenAPI document: v2018-08-01 + Contact: support@voucherify.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from voucherify.models.management_projects_custom_event_schema_schema import ManagementProjectsCustomEventSchemaSchema +from typing import Optional, Set +from typing_extensions import Self + +class ManagementProjectsCustomEventSchema(BaseModel): + """ + Object containing the response to creating a custom event schema. + """ # noqa: E501 + id: Optional[StrictStr] = Field(default=None, description="Unique identifier of the custom event schema.") + name: Optional[StrictStr] = Field(default=None, description="User-defined name of the custom event. This is also shown in **Project Settings** > **Event Schema** in the Voucherify Dashboard.") + var_schema: Optional[ManagementProjectsCustomEventSchemaSchema] = Field(default=None, alias="schema") + created_at: Optional[datetime] = Field(default=None, description="Timestamp representing the date and time when the custom event schema was created. The value is shown in the ISO 8601 format.") + updated_at: Optional[datetime] = Field(default=None, description="Timestamp representing the date and time when the custom event schema was updated. The value is shown in the ISO 8601 format.") + object: Optional[StrictStr] = Field(default='custom-event-schema', description="The type of the object represented by JSON.") + __properties: ClassVar[List[str]] = ["id", "name", "schema", "created_at", "updated_at", "object"] + + @field_validator('object') + def object_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['custom-event-schema']): + raise ValueError("must be one of enum values ('custom-event-schema')") + return value + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ManagementProjectsCustomEventSchema from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of var_schema + if self.var_schema: + _dict['schema'] = self.var_schema.to_dict() + # set to None if id (nullable) is None + # and model_fields_set contains the field + if self.id is None and "id" in self.model_fields_set: + _dict['id'] = None + + # set to None if name (nullable) is None + # and model_fields_set contains the field + if self.name is None and "name" in self.model_fields_set: + _dict['name'] = None + + # set to None if var_schema (nullable) is None + # and model_fields_set contains the field + if self.var_schema is None and "var_schema" in self.model_fields_set: + _dict['schema'] = None + + # set to None if created_at (nullable) is None + # and model_fields_set contains the field + if self.created_at is None and "created_at" in self.model_fields_set: + _dict['created_at'] = None + + # set to None if updated_at (nullable) is None + # and model_fields_set contains the field + if self.updated_at is None and "updated_at" in self.model_fields_set: + _dict['updated_at'] = None + + # set to None if object (nullable) is None + # and model_fields_set contains the field + if self.object is None and "object" in self.model_fields_set: + _dict['object'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ManagementProjectsCustomEventSchema from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id"), + "name": obj.get("name"), + "schema": ManagementProjectsCustomEventSchemaSchema.from_dict(obj["schema"]) if obj.get("schema") is not None else None, + "created_at": obj.get("created_at"), + "updated_at": obj.get("updated_at"), + "object": obj.get("object") if obj.get("object") is not None else 'custom-event-schema' + }) + return _obj + + diff --git a/voucherify/models/management_projects_custom_event_schema_schema.py b/voucherify/models/management_projects_custom_event_schema_schema.py new file mode 100644 index 00000000..6f9c9e20 --- /dev/null +++ b/voucherify/models/management_projects_custom_event_schema_schema.py @@ -0,0 +1,93 @@ +# coding: utf-8 + +""" + Voucherify API + + Voucherify promotion engine REST API. Please see https://docs.voucherify.io/docs for more details. + + The version of the OpenAPI document: v2018-08-01 + Contact: support@voucherify.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class ManagementProjectsCustomEventSchemaSchema(BaseModel): + """ + Object containing custom event schema and its custom attributes (metadata). + """ # noqa: E501 + properties: Optional[Dict[str, Any]] = Field(default=None, description="Defines custom event custom attributes (metadata).") + __properties: ClassVar[List[str]] = ["properties"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ManagementProjectsCustomEventSchemaSchema from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if properties (nullable) is None + # and model_fields_set contains the field + if self.properties is None and "properties" in self.model_fields_set: + _dict['properties'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ManagementProjectsCustomEventSchemaSchema from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "properties": obj.get("properties") + }) + return _obj + + diff --git a/voucherify/models/management_projects_custom_event_schemas_create_request_body.py b/voucherify/models/management_projects_custom_event_schemas_create_request_body.py new file mode 100644 index 00000000..8d73f215 --- /dev/null +++ b/voucherify/models/management_projects_custom_event_schemas_create_request_body.py @@ -0,0 +1,104 @@ +# coding: utf-8 + +""" + Voucherify API + + Voucherify promotion engine REST API. Please see https://docs.voucherify.io/docs for more details. + + The version of the OpenAPI document: v2018-08-01 + Contact: support@voucherify.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from voucherify.models.management_projects_custom_event_schemas_create_request_body_schema import ManagementProjectsCustomEventSchemasCreateRequestBodySchema +from typing import Optional, Set +from typing_extensions import Self + +class ManagementProjectsCustomEventSchemasCreateRequestBody(BaseModel): + """ + Request body schema for **POST** `v1/management/v1/projects/{projectId}/custom-event-schema`. + """ # noqa: E501 + name: Optional[StrictStr] = Field(default=None, description="User-defined name of the custom event. This is also shown in **Project Settings** > **Event Schema** in the Voucherify Dashboard.") + var_schema: Optional[ManagementProjectsCustomEventSchemasCreateRequestBodySchema] = Field(default=None, alias="schema") + __properties: ClassVar[List[str]] = ["name", "schema"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ManagementProjectsCustomEventSchemasCreateRequestBody from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of var_schema + if self.var_schema: + _dict['schema'] = self.var_schema.to_dict() + # set to None if name (nullable) is None + # and model_fields_set contains the field + if self.name is None and "name" in self.model_fields_set: + _dict['name'] = None + + # set to None if var_schema (nullable) is None + # and model_fields_set contains the field + if self.var_schema is None and "var_schema" in self.model_fields_set: + _dict['schema'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ManagementProjectsCustomEventSchemasCreateRequestBody from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "name": obj.get("name"), + "schema": ManagementProjectsCustomEventSchemasCreateRequestBodySchema.from_dict(obj["schema"]) if obj.get("schema") is not None else None + }) + return _obj + + diff --git a/voucherify/models/management_projects_custom_event_schemas_create_request_body_schema.py b/voucherify/models/management_projects_custom_event_schemas_create_request_body_schema.py new file mode 100644 index 00000000..571e61dc --- /dev/null +++ b/voucherify/models/management_projects_custom_event_schemas_create_request_body_schema.py @@ -0,0 +1,93 @@ +# coding: utf-8 + +""" + Voucherify API + + Voucherify promotion engine REST API. Please see https://docs.voucherify.io/docs for more details. + + The version of the OpenAPI document: v2018-08-01 + Contact: support@voucherify.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class ManagementProjectsCustomEventSchemasCreateRequestBodySchema(BaseModel): + """ + Object containing custom event schema and its custom attributes (metadata). + """ # noqa: E501 + properties: Optional[Dict[str, Any]] = Field(default=None, description="Defines custom event custom attributes (metadata).") + __properties: ClassVar[List[str]] = ["properties"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ManagementProjectsCustomEventSchemasCreateRequestBodySchema from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if properties (nullable) is None + # and model_fields_set contains the field + if self.properties is None and "properties" in self.model_fields_set: + _dict['properties'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ManagementProjectsCustomEventSchemasCreateRequestBodySchema from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "properties": obj.get("properties") + }) + return _obj + + diff --git a/voucherify/models/management_projects_custom_event_schemas_create_response_body.py b/voucherify/models/management_projects_custom_event_schemas_create_response_body.py new file mode 100644 index 00000000..43ed42a5 --- /dev/null +++ b/voucherify/models/management_projects_custom_event_schemas_create_response_body.py @@ -0,0 +1,143 @@ +# coding: utf-8 + +""" + Voucherify API + + Voucherify promotion engine REST API. Please see https://docs.voucherify.io/docs for more details. + + The version of the OpenAPI document: v2018-08-01 + Contact: support@voucherify.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from voucherify.models.management_projects_custom_event_schemas_create_response_body_schema import ManagementProjectsCustomEventSchemasCreateResponseBodySchema +from typing import Optional, Set +from typing_extensions import Self + +class ManagementProjectsCustomEventSchemasCreateResponseBody(BaseModel): + """ + Response body schema for **POST** `v1/management/v1/projects/{projectId}/custom-event-schema`. + """ # noqa: E501 + id: Optional[StrictStr] = Field(default=None, description="Unique identifier of the custom event schema.") + name: Optional[StrictStr] = Field(default=None, description="User-defined name of the custom event. This is also shown in **Project Settings** > **Event Schema** in the Voucherify Dashboard.") + var_schema: Optional[ManagementProjectsCustomEventSchemasCreateResponseBodySchema] = Field(default=None, alias="schema") + created_at: Optional[datetime] = Field(default=None, description="Timestamp representing the date and time when the custom event schema was created. The value is shown in the ISO 8601 format.") + updated_at: Optional[datetime] = Field(default=None, description="Timestamp representing the date and time when the custom event schema was updated. The value is shown in the ISO 8601 format.") + object: Optional[StrictStr] = Field(default='custom-event-schema', description="The type of the object represented by JSON.") + __properties: ClassVar[List[str]] = ["id", "name", "schema", "created_at", "updated_at", "object"] + + @field_validator('object') + def object_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['custom-event-schema']): + raise ValueError("must be one of enum values ('custom-event-schema')") + return value + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ManagementProjectsCustomEventSchemasCreateResponseBody from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of var_schema + if self.var_schema: + _dict['schema'] = self.var_schema.to_dict() + # set to None if id (nullable) is None + # and model_fields_set contains the field + if self.id is None and "id" in self.model_fields_set: + _dict['id'] = None + + # set to None if name (nullable) is None + # and model_fields_set contains the field + if self.name is None and "name" in self.model_fields_set: + _dict['name'] = None + + # set to None if var_schema (nullable) is None + # and model_fields_set contains the field + if self.var_schema is None and "var_schema" in self.model_fields_set: + _dict['schema'] = None + + # set to None if created_at (nullable) is None + # and model_fields_set contains the field + if self.created_at is None and "created_at" in self.model_fields_set: + _dict['created_at'] = None + + # set to None if updated_at (nullable) is None + # and model_fields_set contains the field + if self.updated_at is None and "updated_at" in self.model_fields_set: + _dict['updated_at'] = None + + # set to None if object (nullable) is None + # and model_fields_set contains the field + if self.object is None and "object" in self.model_fields_set: + _dict['object'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ManagementProjectsCustomEventSchemasCreateResponseBody from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id"), + "name": obj.get("name"), + "schema": ManagementProjectsCustomEventSchemasCreateResponseBodySchema.from_dict(obj["schema"]) if obj.get("schema") is not None else None, + "created_at": obj.get("created_at"), + "updated_at": obj.get("updated_at"), + "object": obj.get("object") if obj.get("object") is not None else 'custom-event-schema' + }) + return _obj + + diff --git a/voucherify/models/management_projects_custom_event_schemas_create_response_body_schema.py b/voucherify/models/management_projects_custom_event_schemas_create_response_body_schema.py new file mode 100644 index 00000000..7d9fa44d --- /dev/null +++ b/voucherify/models/management_projects_custom_event_schemas_create_response_body_schema.py @@ -0,0 +1,93 @@ +# coding: utf-8 + +""" + Voucherify API + + Voucherify promotion engine REST API. Please see https://docs.voucherify.io/docs for more details. + + The version of the OpenAPI document: v2018-08-01 + Contact: support@voucherify.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class ManagementProjectsCustomEventSchemasCreateResponseBodySchema(BaseModel): + """ + Object containing custom event schema and its custom attributes (metadata). + """ # noqa: E501 + properties: Optional[Dict[str, Any]] = Field(default=None, description="Defines custom event custom attributes (metadata).") + __properties: ClassVar[List[str]] = ["properties"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ManagementProjectsCustomEventSchemasCreateResponseBodySchema from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if properties (nullable) is None + # and model_fields_set contains the field + if self.properties is None and "properties" in self.model_fields_set: + _dict['properties'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ManagementProjectsCustomEventSchemasCreateResponseBodySchema from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "properties": obj.get("properties") + }) + return _obj + + diff --git a/voucherify/models/management_projects_custom_event_schemas_get_response_body.py b/voucherify/models/management_projects_custom_event_schemas_get_response_body.py new file mode 100644 index 00000000..45b232af --- /dev/null +++ b/voucherify/models/management_projects_custom_event_schemas_get_response_body.py @@ -0,0 +1,143 @@ +# coding: utf-8 + +""" + Voucherify API + + Voucherify promotion engine REST API. Please see https://docs.voucherify.io/docs for more details. + + The version of the OpenAPI document: v2018-08-01 + Contact: support@voucherify.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from voucherify.models.management_projects_custom_event_schemas_get_response_body_schema import ManagementProjectsCustomEventSchemasGetResponseBodySchema +from typing import Optional, Set +from typing_extensions import Self + +class ManagementProjectsCustomEventSchemasGetResponseBody(BaseModel): + """ + Response body schema for **GET** `v1/management/v1/projects/{projectId}/custom-event-schema/{customEventSchemaId}`. + """ # noqa: E501 + id: Optional[StrictStr] = Field(default=None, description="Unique identifier of the custom event schema.") + name: Optional[StrictStr] = Field(default=None, description="User-defined name of the custom event. This is also shown in **Project Settings** > **Event Schema** in the Voucherify Dashboard.") + var_schema: Optional[ManagementProjectsCustomEventSchemasGetResponseBodySchema] = Field(default=None, alias="schema") + created_at: Optional[datetime] = Field(default=None, description="Timestamp representing the date and time when the custom event schema was created. The value is shown in the ISO 8601 format.") + updated_at: Optional[datetime] = Field(default=None, description="Timestamp representing the date and time when the custom event schema was updated. The value is shown in the ISO 8601 format.") + object: Optional[StrictStr] = Field(default='custom-event-schema', description="The type of the object represented by JSON.") + __properties: ClassVar[List[str]] = ["id", "name", "schema", "created_at", "updated_at", "object"] + + @field_validator('object') + def object_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['custom-event-schema']): + raise ValueError("must be one of enum values ('custom-event-schema')") + return value + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ManagementProjectsCustomEventSchemasGetResponseBody from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of var_schema + if self.var_schema: + _dict['schema'] = self.var_schema.to_dict() + # set to None if id (nullable) is None + # and model_fields_set contains the field + if self.id is None and "id" in self.model_fields_set: + _dict['id'] = None + + # set to None if name (nullable) is None + # and model_fields_set contains the field + if self.name is None and "name" in self.model_fields_set: + _dict['name'] = None + + # set to None if var_schema (nullable) is None + # and model_fields_set contains the field + if self.var_schema is None and "var_schema" in self.model_fields_set: + _dict['schema'] = None + + # set to None if created_at (nullable) is None + # and model_fields_set contains the field + if self.created_at is None and "created_at" in self.model_fields_set: + _dict['created_at'] = None + + # set to None if updated_at (nullable) is None + # and model_fields_set contains the field + if self.updated_at is None and "updated_at" in self.model_fields_set: + _dict['updated_at'] = None + + # set to None if object (nullable) is None + # and model_fields_set contains the field + if self.object is None and "object" in self.model_fields_set: + _dict['object'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ManagementProjectsCustomEventSchemasGetResponseBody from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id"), + "name": obj.get("name"), + "schema": ManagementProjectsCustomEventSchemasGetResponseBodySchema.from_dict(obj["schema"]) if obj.get("schema") is not None else None, + "created_at": obj.get("created_at"), + "updated_at": obj.get("updated_at"), + "object": obj.get("object") if obj.get("object") is not None else 'custom-event-schema' + }) + return _obj + + diff --git a/voucherify/models/management_projects_custom_event_schemas_get_response_body_schema.py b/voucherify/models/management_projects_custom_event_schemas_get_response_body_schema.py new file mode 100644 index 00000000..06cccac2 --- /dev/null +++ b/voucherify/models/management_projects_custom_event_schemas_get_response_body_schema.py @@ -0,0 +1,93 @@ +# coding: utf-8 + +""" + Voucherify API + + Voucherify promotion engine REST API. Please see https://docs.voucherify.io/docs for more details. + + The version of the OpenAPI document: v2018-08-01 + Contact: support@voucherify.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class ManagementProjectsCustomEventSchemasGetResponseBodySchema(BaseModel): + """ + Object containing custom event schema and its custom attributes (metadata). + """ # noqa: E501 + properties: Optional[Dict[str, Any]] = Field(default=None, description="Defines custom event custom attributes (metadata).") + __properties: ClassVar[List[str]] = ["properties"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ManagementProjectsCustomEventSchemasGetResponseBodySchema from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if properties (nullable) is None + # and model_fields_set contains the field + if self.properties is None and "properties" in self.model_fields_set: + _dict['properties'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ManagementProjectsCustomEventSchemasGetResponseBodySchema from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "properties": obj.get("properties") + }) + return _obj + + diff --git a/voucherify/models/management_projects_custom_event_schemas_list_response_body.py b/voucherify/models/management_projects_custom_event_schemas_list_response_body.py new file mode 100644 index 00000000..60786fb0 --- /dev/null +++ b/voucherify/models/management_projects_custom_event_schemas_list_response_body.py @@ -0,0 +1,142 @@ +# coding: utf-8 + +""" + Voucherify API + + Voucherify promotion engine REST API. Please see https://docs.voucherify.io/docs for more details. + + The version of the OpenAPI document: v2018-08-01 + Contact: support@voucherify.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from voucherify.models.management_projects_custom_event_schema import ManagementProjectsCustomEventSchema +from typing import Optional, Set +from typing_extensions import Self + +class ManagementProjectsCustomEventSchemasListResponseBody(BaseModel): + """ + Object containing a list of custom event schemas. + """ # noqa: E501 + object: Optional[StrictStr] = Field(default='list', description="The type of the object represented by JSON. This object stores information about the custom event schemas in a dictionary.") + data_ref: Optional[StrictStr] = Field(default='data', description="Identifies the name of the attribute that contains the array of custom event schema objects.") + data: Optional[List[ManagementProjectsCustomEventSchema]] = Field(default=None, description="Array of custom event schema objects.") + total: Optional[StrictInt] = Field(default=None, description="The total number of custom event schema objects.") + __properties: ClassVar[List[str]] = ["object", "data_ref", "data", "total"] + + @field_validator('object') + def object_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['list']): + raise ValueError("must be one of enum values ('list')") + return value + + @field_validator('data_ref') + def data_ref_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['data']): + raise ValueError("must be one of enum values ('data')") + return value + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ManagementProjectsCustomEventSchemasListResponseBody from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in data (list) + _items = [] + if self.data: + for _item_data in self.data: + if _item_data: + _items.append(_item_data.to_dict()) + _dict['data'] = _items + # set to None if object (nullable) is None + # and model_fields_set contains the field + if self.object is None and "object" in self.model_fields_set: + _dict['object'] = None + + # set to None if data_ref (nullable) is None + # and model_fields_set contains the field + if self.data_ref is None and "data_ref" in self.model_fields_set: + _dict['data_ref'] = None + + # set to None if data (nullable) is None + # and model_fields_set contains the field + if self.data is None and "data" in self.model_fields_set: + _dict['data'] = None + + # set to None if total (nullable) is None + # and model_fields_set contains the field + if self.total is None and "total" in self.model_fields_set: + _dict['total'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ManagementProjectsCustomEventSchemasListResponseBody from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "object": obj.get("object") if obj.get("object") is not None else 'list', + "data_ref": obj.get("data_ref") if obj.get("data_ref") is not None else 'data', + "data": [ManagementProjectsCustomEventSchema.from_dict(_item) for _item in obj["data"]] if obj.get("data") is not None else None, + "total": obj.get("total") + }) + return _obj + + diff --git a/voucherify/models/management_projects_custom_event_schemas_update_request_body.py b/voucherify/models/management_projects_custom_event_schemas_update_request_body.py new file mode 100644 index 00000000..cec63973 --- /dev/null +++ b/voucherify/models/management_projects_custom_event_schemas_update_request_body.py @@ -0,0 +1,97 @@ +# coding: utf-8 + +""" + Voucherify API + + Voucherify promotion engine REST API. Please see https://docs.voucherify.io/docs for more details. + + The version of the OpenAPI document: v2018-08-01 + Contact: support@voucherify.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List, Optional +from voucherify.models.management_projects_custom_event_schemas_update_request_body_schema import ManagementProjectsCustomEventSchemasUpdateRequestBodySchema +from typing import Optional, Set +from typing_extensions import Self + +class ManagementProjectsCustomEventSchemasUpdateRequestBody(BaseModel): + """ + Request body schema for **POST** `v1/management/v1/projects/{projectId}/custom-event-schema/{customEventSchemaId}`. + """ # noqa: E501 + var_schema: Optional[ManagementProjectsCustomEventSchemasUpdateRequestBodySchema] = Field(default=None, alias="schema") + __properties: ClassVar[List[str]] = ["schema"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ManagementProjectsCustomEventSchemasUpdateRequestBody from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of var_schema + if self.var_schema: + _dict['schema'] = self.var_schema.to_dict() + # set to None if var_schema (nullable) is None + # and model_fields_set contains the field + if self.var_schema is None and "var_schema" in self.model_fields_set: + _dict['schema'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ManagementProjectsCustomEventSchemasUpdateRequestBody from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "schema": ManagementProjectsCustomEventSchemasUpdateRequestBodySchema.from_dict(obj["schema"]) if obj.get("schema") is not None else None + }) + return _obj + + diff --git a/voucherify/models/management_projects_custom_event_schemas_update_request_body_schema.py b/voucherify/models/management_projects_custom_event_schemas_update_request_body_schema.py new file mode 100644 index 00000000..d4966118 --- /dev/null +++ b/voucherify/models/management_projects_custom_event_schemas_update_request_body_schema.py @@ -0,0 +1,93 @@ +# coding: utf-8 + +""" + Voucherify API + + Voucherify promotion engine REST API. Please see https://docs.voucherify.io/docs for more details. + + The version of the OpenAPI document: v2018-08-01 + Contact: support@voucherify.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class ManagementProjectsCustomEventSchemasUpdateRequestBodySchema(BaseModel): + """ + Object containing custom event schema and its custom attributes (metadata). + """ # noqa: E501 + properties: Optional[Dict[str, Any]] = Field(default=None, description="Defines custom event custom attributes (metadata).") + __properties: ClassVar[List[str]] = ["properties"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ManagementProjectsCustomEventSchemasUpdateRequestBodySchema from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if properties (nullable) is None + # and model_fields_set contains the field + if self.properties is None and "properties" in self.model_fields_set: + _dict['properties'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ManagementProjectsCustomEventSchemasUpdateRequestBodySchema from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "properties": obj.get("properties") + }) + return _obj + + diff --git a/voucherify/models/management_projects_custom_event_schemas_update_response_body.py b/voucherify/models/management_projects_custom_event_schemas_update_response_body.py new file mode 100644 index 00000000..00fdcab4 --- /dev/null +++ b/voucherify/models/management_projects_custom_event_schemas_update_response_body.py @@ -0,0 +1,143 @@ +# coding: utf-8 + +""" + Voucherify API + + Voucherify promotion engine REST API. Please see https://docs.voucherify.io/docs for more details. + + The version of the OpenAPI document: v2018-08-01 + Contact: support@voucherify.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from voucherify.models.management_projects_custom_event_schemas_update_response_body_schema import ManagementProjectsCustomEventSchemasUpdateResponseBodySchema +from typing import Optional, Set +from typing_extensions import Self + +class ManagementProjectsCustomEventSchemasUpdateResponseBody(BaseModel): + """ + Response body schema for **POST** `v1/management/v1/projects/{projectId}/custom-event-schema/{customEventSchemaId}`. + """ # noqa: E501 + id: Optional[StrictStr] = Field(default=None, description="Unique identifier of the custom event schema.") + name: Optional[StrictStr] = Field(default=None, description="User-defined name of the custom event. This is also shown in **Project Settings** > **Event Schema** in the Voucherify Dashboard.") + var_schema: Optional[ManagementProjectsCustomEventSchemasUpdateResponseBodySchema] = Field(default=None, alias="schema") + created_at: Optional[datetime] = Field(default=None, description="Timestamp representing the date and time when the custom event schema was created. The value is shown in the ISO 8601 format.") + updated_at: Optional[datetime] = Field(default=None, description="Timestamp representing the date and time when the custom event schema was updated. The value is shown in the ISO 8601 format.") + object: Optional[StrictStr] = Field(default='custom-event-schema', description="The type of the object represented by JSON.") + __properties: ClassVar[List[str]] = ["id", "name", "schema", "created_at", "updated_at", "object"] + + @field_validator('object') + def object_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['custom-event-schema']): + raise ValueError("must be one of enum values ('custom-event-schema')") + return value + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ManagementProjectsCustomEventSchemasUpdateResponseBody from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of var_schema + if self.var_schema: + _dict['schema'] = self.var_schema.to_dict() + # set to None if id (nullable) is None + # and model_fields_set contains the field + if self.id is None and "id" in self.model_fields_set: + _dict['id'] = None + + # set to None if name (nullable) is None + # and model_fields_set contains the field + if self.name is None and "name" in self.model_fields_set: + _dict['name'] = None + + # set to None if var_schema (nullable) is None + # and model_fields_set contains the field + if self.var_schema is None and "var_schema" in self.model_fields_set: + _dict['schema'] = None + + # set to None if created_at (nullable) is None + # and model_fields_set contains the field + if self.created_at is None and "created_at" in self.model_fields_set: + _dict['created_at'] = None + + # set to None if updated_at (nullable) is None + # and model_fields_set contains the field + if self.updated_at is None and "updated_at" in self.model_fields_set: + _dict['updated_at'] = None + + # set to None if object (nullable) is None + # and model_fields_set contains the field + if self.object is None and "object" in self.model_fields_set: + _dict['object'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ManagementProjectsCustomEventSchemasUpdateResponseBody from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id"), + "name": obj.get("name"), + "schema": ManagementProjectsCustomEventSchemasUpdateResponseBodySchema.from_dict(obj["schema"]) if obj.get("schema") is not None else None, + "created_at": obj.get("created_at"), + "updated_at": obj.get("updated_at"), + "object": obj.get("object") if obj.get("object") is not None else 'custom-event-schema' + }) + return _obj + + diff --git a/voucherify/models/management_projects_custom_event_schemas_update_response_body_schema.py b/voucherify/models/management_projects_custom_event_schemas_update_response_body_schema.py new file mode 100644 index 00000000..4b3cbf03 --- /dev/null +++ b/voucherify/models/management_projects_custom_event_schemas_update_response_body_schema.py @@ -0,0 +1,93 @@ +# coding: utf-8 + +""" + Voucherify API + + Voucherify promotion engine REST API. Please see https://docs.voucherify.io/docs for more details. + + The version of the OpenAPI document: v2018-08-01 + Contact: support@voucherify.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class ManagementProjectsCustomEventSchemasUpdateResponseBodySchema(BaseModel): + """ + Object containing custom event schema and its custom attributes (metadata). + """ # noqa: E501 + properties: Optional[Dict[str, Any]] = Field(default=None, description="Defines custom event custom attributes (metadata).") + __properties: ClassVar[List[str]] = ["properties"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ManagementProjectsCustomEventSchemasUpdateResponseBodySchema from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if properties (nullable) is None + # and model_fields_set contains the field + if self.properties is None and "properties" in self.model_fields_set: + _dict['properties'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ManagementProjectsCustomEventSchemasUpdateResponseBodySchema from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "properties": obj.get("properties") + }) + return _obj + + diff --git a/voucherify/models/management_projects_get_response_body.py b/voucherify/models/management_projects_get_response_body.py new file mode 100644 index 00000000..bba8344a --- /dev/null +++ b/voucherify/models/management_projects_get_response_body.py @@ -0,0 +1,283 @@ +# coding: utf-8 + +""" + Voucherify API + + Voucherify promotion engine REST API. Please see https://docs.voucherify.io/docs for more details. + + The version of the OpenAPI document: v2018-08-01 + Contact: support@voucherify.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from voucherify.models.management_projects_get_response_body_api_usage_notifications import ManagementProjectsGetResponseBodyApiUsageNotifications +from voucherify.models.management_projects_get_response_body_default_code_config import ManagementProjectsGetResponseBodyDefaultCodeConfig +from voucherify.models.management_projects_get_response_body_limits import ManagementProjectsGetResponseBodyLimits +from voucherify.models.management_projects_get_response_body_webhooks_callout_notifications import ManagementProjectsGetResponseBodyWebhooksCalloutNotifications +from typing import Optional, Set +from typing_extensions import Self + +class ManagementProjectsGetResponseBody(BaseModel): + """ + ManagementProjectsGetResponseBody + """ # noqa: E501 + id: Optional[StrictStr] = Field(default=None, description="Unique identifier of the project.") + name: Optional[StrictStr] = Field(default=None, description="The name of the project.") + description: Optional[StrictStr] = Field(default=None, description="A user-defined description of the project, e.g. its purpose, scope, region.") + timezone: Optional[StrictStr] = Field(default=None, description="The time zone in which the project is established. It can be in the GMT format or in accordance with IANA time zone database.") + currency: Optional[StrictStr] = Field(default=None, description="The currency used in the project. It is equal to a 3-letter ISO 4217 code.") + dial_code: Optional[StrictStr] = Field(default=None, description="The country dial code for the project. It is equal to an ITU country code.") + webhook_version: Optional[StrictStr] = Field(default='v2024-01-01', description="The webhook version used in the project.") + client_trusted_domains: Optional[List[StrictStr]] = Field(default=None, description="An array of URL addresses that allow client requests.") + client_redeem_enabled: Optional[StrictBool] = Field(default=None, description="Enables client-side redemption.") + client_publish_enabled: Optional[StrictBool] = Field(default=None, description="Enables client-side publication.") + client_list_vouchers_enabled: Optional[StrictBool] = Field(default=None, description="Enables client-side listing of vouchers.") + client_create_customer_enabled: Optional[StrictBool] = Field(default=None, description="Enables client-side creation of customers.") + client_loyalty_events_enabled: Optional[StrictBool] = Field(default=None, description="Enables client-side events for loyalty and referral programs.") + client_set_voucher_expiration_date_enabled: Optional[StrictBool] = Field(default=None, description="Enables client-side setting of voucher expiration date.") + api_usage_notifications: Optional[ManagementProjectsGetResponseBodyApiUsageNotifications] = None + webhooks_callout_notifications: Optional[ManagementProjectsGetResponseBodyWebhooksCalloutNotifications] = None + cluster_id: Optional[StrictStr] = Field(default=None, description="The identifier of the cluster where the project will be created.") + case_sensitive_codes: Optional[StrictBool] = Field(default=None, description="Determines if the vouchers in the project will be: - case sensitive - if `true`, `C0dE-cfV` is **not** equal to `c0de-cfv`), - case insensitive - if `false`, `C0dE-cfV` is equal to `c0de-cfv`.") + api_version: Optional[StrictStr] = Field(default='v2018-08-01', description="The API version used in the project. Currently, the default and only value is `v2018-08-01`.") + is_sandbox: Optional[StrictBool] = Field(default=None, description="Determines if the project is a sandbox project.") + webhook_token: Optional[StrictStr] = Field(default=None, description="Webhook token used for authentication.") + default_code_config: Optional[ManagementProjectsGetResponseBodyDefaultCodeConfig] = None + limits: Optional[ManagementProjectsGetResponseBodyLimits] = None + __properties: ClassVar[List[str]] = ["id", "name", "description", "timezone", "currency", "dial_code", "webhook_version", "client_trusted_domains", "client_redeem_enabled", "client_publish_enabled", "client_list_vouchers_enabled", "client_create_customer_enabled", "client_loyalty_events_enabled", "client_set_voucher_expiration_date_enabled", "api_usage_notifications", "webhooks_callout_notifications", "cluster_id", "case_sensitive_codes", "api_version", "is_sandbox", "webhook_token", "default_code_config", "limits"] + + @field_validator('webhook_version') + def webhook_version_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['v2024-01-01']): + raise ValueError("must be one of enum values ('v2024-01-01')") + return value + + @field_validator('api_version') + def api_version_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['v2018-08-01']): + raise ValueError("must be one of enum values ('v2018-08-01')") + return value + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ManagementProjectsGetResponseBody from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of api_usage_notifications + if self.api_usage_notifications: + _dict['api_usage_notifications'] = self.api_usage_notifications.to_dict() + # override the default output from pydantic by calling `to_dict()` of webhooks_callout_notifications + if self.webhooks_callout_notifications: + _dict['webhooks_callout_notifications'] = self.webhooks_callout_notifications.to_dict() + # override the default output from pydantic by calling `to_dict()` of default_code_config + if self.default_code_config: + _dict['default_code_config'] = self.default_code_config.to_dict() + # override the default output from pydantic by calling `to_dict()` of limits + if self.limits: + _dict['limits'] = self.limits.to_dict() + # set to None if id (nullable) is None + # and model_fields_set contains the field + if self.id is None and "id" in self.model_fields_set: + _dict['id'] = None + + # set to None if name (nullable) is None + # and model_fields_set contains the field + if self.name is None and "name" in self.model_fields_set: + _dict['name'] = None + + # set to None if description (nullable) is None + # and model_fields_set contains the field + if self.description is None and "description" in self.model_fields_set: + _dict['description'] = None + + # set to None if timezone (nullable) is None + # and model_fields_set contains the field + if self.timezone is None and "timezone" in self.model_fields_set: + _dict['timezone'] = None + + # set to None if currency (nullable) is None + # and model_fields_set contains the field + if self.currency is None and "currency" in self.model_fields_set: + _dict['currency'] = None + + # set to None if dial_code (nullable) is None + # and model_fields_set contains the field + if self.dial_code is None and "dial_code" in self.model_fields_set: + _dict['dial_code'] = None + + # set to None if webhook_version (nullable) is None + # and model_fields_set contains the field + if self.webhook_version is None and "webhook_version" in self.model_fields_set: + _dict['webhook_version'] = None + + # set to None if client_trusted_domains (nullable) is None + # and model_fields_set contains the field + if self.client_trusted_domains is None and "client_trusted_domains" in self.model_fields_set: + _dict['client_trusted_domains'] = None + + # set to None if client_redeem_enabled (nullable) is None + # and model_fields_set contains the field + if self.client_redeem_enabled is None and "client_redeem_enabled" in self.model_fields_set: + _dict['client_redeem_enabled'] = None + + # set to None if client_publish_enabled (nullable) is None + # and model_fields_set contains the field + if self.client_publish_enabled is None and "client_publish_enabled" in self.model_fields_set: + _dict['client_publish_enabled'] = None + + # set to None if client_list_vouchers_enabled (nullable) is None + # and model_fields_set contains the field + if self.client_list_vouchers_enabled is None and "client_list_vouchers_enabled" in self.model_fields_set: + _dict['client_list_vouchers_enabled'] = None + + # set to None if client_create_customer_enabled (nullable) is None + # and model_fields_set contains the field + if self.client_create_customer_enabled is None and "client_create_customer_enabled" in self.model_fields_set: + _dict['client_create_customer_enabled'] = None + + # set to None if client_loyalty_events_enabled (nullable) is None + # and model_fields_set contains the field + if self.client_loyalty_events_enabled is None and "client_loyalty_events_enabled" in self.model_fields_set: + _dict['client_loyalty_events_enabled'] = None + + # set to None if client_set_voucher_expiration_date_enabled (nullable) is None + # and model_fields_set contains the field + if self.client_set_voucher_expiration_date_enabled is None and "client_set_voucher_expiration_date_enabled" in self.model_fields_set: + _dict['client_set_voucher_expiration_date_enabled'] = None + + # set to None if api_usage_notifications (nullable) is None + # and model_fields_set contains the field + if self.api_usage_notifications is None and "api_usage_notifications" in self.model_fields_set: + _dict['api_usage_notifications'] = None + + # set to None if webhooks_callout_notifications (nullable) is None + # and model_fields_set contains the field + if self.webhooks_callout_notifications is None and "webhooks_callout_notifications" in self.model_fields_set: + _dict['webhooks_callout_notifications'] = None + + # set to None if cluster_id (nullable) is None + # and model_fields_set contains the field + if self.cluster_id is None and "cluster_id" in self.model_fields_set: + _dict['cluster_id'] = None + + # set to None if case_sensitive_codes (nullable) is None + # and model_fields_set contains the field + if self.case_sensitive_codes is None and "case_sensitive_codes" in self.model_fields_set: + _dict['case_sensitive_codes'] = None + + # set to None if api_version (nullable) is None + # and model_fields_set contains the field + if self.api_version is None and "api_version" in self.model_fields_set: + _dict['api_version'] = None + + # set to None if is_sandbox (nullable) is None + # and model_fields_set contains the field + if self.is_sandbox is None and "is_sandbox" in self.model_fields_set: + _dict['is_sandbox'] = None + + # set to None if webhook_token (nullable) is None + # and model_fields_set contains the field + if self.webhook_token is None and "webhook_token" in self.model_fields_set: + _dict['webhook_token'] = None + + # set to None if default_code_config (nullable) is None + # and model_fields_set contains the field + if self.default_code_config is None and "default_code_config" in self.model_fields_set: + _dict['default_code_config'] = None + + # set to None if limits (nullable) is None + # and model_fields_set contains the field + if self.limits is None and "limits" in self.model_fields_set: + _dict['limits'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ManagementProjectsGetResponseBody from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id"), + "name": obj.get("name"), + "description": obj.get("description"), + "timezone": obj.get("timezone"), + "currency": obj.get("currency"), + "dial_code": obj.get("dial_code"), + "webhook_version": obj.get("webhook_version") if obj.get("webhook_version") is not None else 'v2024-01-01', + "client_trusted_domains": obj.get("client_trusted_domains"), + "client_redeem_enabled": obj.get("client_redeem_enabled"), + "client_publish_enabled": obj.get("client_publish_enabled"), + "client_list_vouchers_enabled": obj.get("client_list_vouchers_enabled"), + "client_create_customer_enabled": obj.get("client_create_customer_enabled"), + "client_loyalty_events_enabled": obj.get("client_loyalty_events_enabled"), + "client_set_voucher_expiration_date_enabled": obj.get("client_set_voucher_expiration_date_enabled"), + "api_usage_notifications": ManagementProjectsGetResponseBodyApiUsageNotifications.from_dict(obj["api_usage_notifications"]) if obj.get("api_usage_notifications") is not None else None, + "webhooks_callout_notifications": ManagementProjectsGetResponseBodyWebhooksCalloutNotifications.from_dict(obj["webhooks_callout_notifications"]) if obj.get("webhooks_callout_notifications") is not None else None, + "cluster_id": obj.get("cluster_id"), + "case_sensitive_codes": obj.get("case_sensitive_codes"), + "api_version": obj.get("api_version") if obj.get("api_version") is not None else 'v2018-08-01', + "is_sandbox": obj.get("is_sandbox"), + "webhook_token": obj.get("webhook_token"), + "default_code_config": ManagementProjectsGetResponseBodyDefaultCodeConfig.from_dict(obj["default_code_config"]) if obj.get("default_code_config") is not None else None, + "limits": ManagementProjectsGetResponseBodyLimits.from_dict(obj["limits"]) if obj.get("limits") is not None else None + }) + return _obj + + diff --git a/voucherify/models/management_projects_get_response_body_api_usage_notifications.py b/voucherify/models/management_projects_get_response_body_api_usage_notifications.py new file mode 100644 index 00000000..dac628bb --- /dev/null +++ b/voucherify/models/management_projects_get_response_body_api_usage_notifications.py @@ -0,0 +1,117 @@ +# coding: utf-8 + +""" + Voucherify API + + Voucherify promotion engine REST API. Please see https://docs.voucherify.io/docs for more details. + + The version of the OpenAPI document: v2018-08-01 + Contact: support@voucherify.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict +from typing import Any, ClassVar, Dict, List, Optional +from voucherify.models.usage_notifications import UsageNotifications +from typing import Optional, Set +from typing_extensions import Self + +class ManagementProjectsGetResponseBodyApiUsageNotifications(BaseModel): + """ + Determines the notification settings. + """ # noqa: E501 + redemptions: Optional[UsageNotifications] = None + messages: Optional[UsageNotifications] = None + api_calls: Optional[UsageNotifications] = None + bulk_api_calls: Optional[UsageNotifications] = None + webhook_calls: Optional[UsageNotifications] = None + cycle_calls: Optional[UsageNotifications] = None + __properties: ClassVar[List[str]] = ["redemptions", "messages", "api_calls", "bulk_api_calls", "webhook_calls", "cycle_calls"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ManagementProjectsGetResponseBodyApiUsageNotifications from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of redemptions + if self.redemptions: + _dict['redemptions'] = self.redemptions.to_dict() + # override the default output from pydantic by calling `to_dict()` of messages + if self.messages: + _dict['messages'] = self.messages.to_dict() + # override the default output from pydantic by calling `to_dict()` of api_calls + if self.api_calls: + _dict['api_calls'] = self.api_calls.to_dict() + # override the default output from pydantic by calling `to_dict()` of bulk_api_calls + if self.bulk_api_calls: + _dict['bulk_api_calls'] = self.bulk_api_calls.to_dict() + # override the default output from pydantic by calling `to_dict()` of webhook_calls + if self.webhook_calls: + _dict['webhook_calls'] = self.webhook_calls.to_dict() + # override the default output from pydantic by calling `to_dict()` of cycle_calls + if self.cycle_calls: + _dict['cycle_calls'] = self.cycle_calls.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ManagementProjectsGetResponseBodyApiUsageNotifications from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "redemptions": UsageNotifications.from_dict(obj["redemptions"]) if obj.get("redemptions") is not None else None, + "messages": UsageNotifications.from_dict(obj["messages"]) if obj.get("messages") is not None else None, + "api_calls": UsageNotifications.from_dict(obj["api_calls"]) if obj.get("api_calls") is not None else None, + "bulk_api_calls": UsageNotifications.from_dict(obj["bulk_api_calls"]) if obj.get("bulk_api_calls") is not None else None, + "webhook_calls": UsageNotifications.from_dict(obj["webhook_calls"]) if obj.get("webhook_calls") is not None else None, + "cycle_calls": UsageNotifications.from_dict(obj["cycle_calls"]) if obj.get("cycle_calls") is not None else None + }) + return _obj + + diff --git a/voucherify/models/management_projects_get_response_body_default_code_config.py b/voucherify/models/management_projects_get_response_body_default_code_config.py new file mode 100644 index 00000000..7a7739df --- /dev/null +++ b/voucherify/models/management_projects_get_response_body_default_code_config.py @@ -0,0 +1,93 @@ +# coding: utf-8 + +""" + Voucherify API + + Voucherify promotion engine REST API. Please see https://docs.voucherify.io/docs for more details. + + The version of the OpenAPI document: v2018-08-01 + Contact: support@voucherify.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class ManagementProjectsGetResponseBodyDefaultCodeConfig(BaseModel): + """ + Determines the character set that is used as default for vouchers. It is affected by the `\"case_sensitive_codes\"` setting. + """ # noqa: E501 + charset: Optional[StrictStr] = Field(default=None, description="Lists all characters that are used as default for vouchers") + __properties: ClassVar[List[str]] = ["charset"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ManagementProjectsGetResponseBodyDefaultCodeConfig from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if charset (nullable) is None + # and model_fields_set contains the field + if self.charset is None and "charset" in self.model_fields_set: + _dict['charset'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ManagementProjectsGetResponseBodyDefaultCodeConfig from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "charset": obj.get("charset") + }) + return _obj + + diff --git a/voucherify/models/management_projects_get_response_body_limits.py b/voucherify/models/management_projects_get_response_body_limits.py new file mode 100644 index 00000000..365d99ab --- /dev/null +++ b/voucherify/models/management_projects_get_response_body_limits.py @@ -0,0 +1,116 @@ +# coding: utf-8 + +""" + Voucherify API + + Voucherify promotion engine REST API. Please see https://docs.voucherify.io/docs for more details. + + The version of the OpenAPI document: v2018-08-01 + Contact: support@voucherify.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict +from typing import Any, ClassVar, Dict, List, Optional +from voucherify.models.management_projects_get_response_body_limits_api_calls_item import ManagementProjectsGetResponseBodyLimitsApiCallsItem +from voucherify.models.management_projects_get_response_body_limits_bulk_api_calls_item import ManagementProjectsGetResponseBodyLimitsBulkApiCallsItem +from typing import Optional, Set +from typing_extensions import Self + +class ManagementProjectsGetResponseBodyLimits(BaseModel): + """ + Determines additional limits set on a given project, e.g. the Sandbox project. If no limits are returned, the limits set for the whole organization apply. + """ # noqa: E501 + api_calls: Optional[List[ManagementProjectsGetResponseBodyLimitsApiCallsItem]] = None + bulk_api_calls: Optional[List[ManagementProjectsGetResponseBodyLimitsBulkApiCallsItem]] = None + __properties: ClassVar[List[str]] = ["api_calls", "bulk_api_calls"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ManagementProjectsGetResponseBodyLimits from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in api_calls (list) + _items = [] + if self.api_calls: + for _item_api_calls in self.api_calls: + if _item_api_calls: + _items.append(_item_api_calls.to_dict()) + _dict['api_calls'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in bulk_api_calls (list) + _items = [] + if self.bulk_api_calls: + for _item_bulk_api_calls in self.bulk_api_calls: + if _item_bulk_api_calls: + _items.append(_item_bulk_api_calls.to_dict()) + _dict['bulk_api_calls'] = _items + # set to None if api_calls (nullable) is None + # and model_fields_set contains the field + if self.api_calls is None and "api_calls" in self.model_fields_set: + _dict['api_calls'] = None + + # set to None if bulk_api_calls (nullable) is None + # and model_fields_set contains the field + if self.bulk_api_calls is None and "bulk_api_calls" in self.model_fields_set: + _dict['bulk_api_calls'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ManagementProjectsGetResponseBodyLimits from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "api_calls": [ManagementProjectsGetResponseBodyLimitsApiCallsItem.from_dict(_item) for _item in obj["api_calls"]] if obj.get("api_calls") is not None else None, + "bulk_api_calls": [ManagementProjectsGetResponseBodyLimitsBulkApiCallsItem.from_dict(_item) for _item in obj["bulk_api_calls"]] if obj.get("bulk_api_calls") is not None else None + }) + return _obj + + diff --git a/voucherify/models/management_projects_get_response_body_limits_api_calls_item.py b/voucherify/models/management_projects_get_response_body_limits_api_calls_item.py new file mode 100644 index 00000000..15172a61 --- /dev/null +++ b/voucherify/models/management_projects_get_response_body_limits_api_calls_item.py @@ -0,0 +1,90 @@ +# coding: utf-8 + +""" + Voucherify API + + Voucherify promotion engine REST API. Please see https://docs.voucherify.io/docs for more details. + + The version of the OpenAPI document: v2018-08-01 + Contact: support@voucherify.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class ManagementProjectsGetResponseBodyLimitsApiCallsItem(BaseModel): + """ + Determines the limit of API calls per given unit time. + """ # noqa: E501 + value: Optional[StrictInt] = Field(default=None, description="Determines the maximum number of API calls per time set in `\"duration\"`.") + duration: Optional[StrictStr] = Field(default=None, description="Determines the amount of time during which the calls up to the number specified in the `value` can be made. The duration is presented in the ISO 8601 format, e.g. `PT1H` means one hour.") + __properties: ClassVar[List[str]] = ["value", "duration"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ManagementProjectsGetResponseBodyLimitsApiCallsItem from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ManagementProjectsGetResponseBodyLimitsApiCallsItem from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "value": obj.get("value"), + "duration": obj.get("duration") + }) + return _obj + + diff --git a/voucherify/models/management_projects_get_response_body_limits_bulk_api_calls_item.py b/voucherify/models/management_projects_get_response_body_limits_bulk_api_calls_item.py new file mode 100644 index 00000000..5ecea122 --- /dev/null +++ b/voucherify/models/management_projects_get_response_body_limits_bulk_api_calls_item.py @@ -0,0 +1,90 @@ +# coding: utf-8 + +""" + Voucherify API + + Voucherify promotion engine REST API. Please see https://docs.voucherify.io/docs for more details. + + The version of the OpenAPI document: v2018-08-01 + Contact: support@voucherify.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class ManagementProjectsGetResponseBodyLimitsBulkApiCallsItem(BaseModel): + """ + + """ # noqa: E501 + value: Optional[StrictInt] = Field(default=None, description="Determines the maximum number of API calls per time set in `\"duration\"`.") + duration: Optional[StrictStr] = Field(default=None, description="Determines the amount of time during which the calls up to the number specified in the `value` can be made. The duration is presented in the ISO 8601 format, e.g. `PT1H` means one hour.") + __properties: ClassVar[List[str]] = ["value", "duration"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ManagementProjectsGetResponseBodyLimitsBulkApiCallsItem from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ManagementProjectsGetResponseBodyLimitsBulkApiCallsItem from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "value": obj.get("value"), + "duration": obj.get("duration") + }) + return _obj + + diff --git a/voucherify/models/management_projects_get_response_body_webhooks_callout_notifications.py b/voucherify/models/management_projects_get_response_body_webhooks_callout_notifications.py new file mode 100644 index 00000000..d2f06b61 --- /dev/null +++ b/voucherify/models/management_projects_get_response_body_webhooks_callout_notifications.py @@ -0,0 +1,108 @@ +# coding: utf-8 + +""" + Voucherify API + + Voucherify promotion engine REST API. Please see https://docs.voucherify.io/docs for more details. + + The version of the OpenAPI document: v2018-08-01 + Contact: support@voucherify.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict +from typing import Any, ClassVar, Dict, List, Optional +from voucherify.models.management_projects_get_response_body_webhooks_callout_notifications_distributions import ManagementProjectsGetResponseBodyWebhooksCalloutNotificationsDistributions +from voucherify.models.management_projects_get_response_body_webhooks_callout_notifications_webhooks import ManagementProjectsGetResponseBodyWebhooksCalloutNotificationsWebhooks +from typing import Optional, Set +from typing_extensions import Self + +class ManagementProjectsGetResponseBodyWebhooksCalloutNotifications(BaseModel): + """ + Determines the notification settings for webhook callouts configured in Distributions and Project settings. + """ # noqa: E501 + distributions: Optional[ManagementProjectsGetResponseBodyWebhooksCalloutNotificationsDistributions] = None + webhooks: Optional[ManagementProjectsGetResponseBodyWebhooksCalloutNotificationsWebhooks] = None + __properties: ClassVar[List[str]] = ["distributions", "webhooks"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ManagementProjectsGetResponseBodyWebhooksCalloutNotifications from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of distributions + if self.distributions: + _dict['distributions'] = self.distributions.to_dict() + # override the default output from pydantic by calling `to_dict()` of webhooks + if self.webhooks: + _dict['webhooks'] = self.webhooks.to_dict() + # set to None if distributions (nullable) is None + # and model_fields_set contains the field + if self.distributions is None and "distributions" in self.model_fields_set: + _dict['distributions'] = None + + # set to None if webhooks (nullable) is None + # and model_fields_set contains the field + if self.webhooks is None and "webhooks" in self.model_fields_set: + _dict['webhooks'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ManagementProjectsGetResponseBodyWebhooksCalloutNotifications from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "distributions": ManagementProjectsGetResponseBodyWebhooksCalloutNotificationsDistributions.from_dict(obj["distributions"]) if obj.get("distributions") is not None else None, + "webhooks": ManagementProjectsGetResponseBodyWebhooksCalloutNotificationsWebhooks.from_dict(obj["webhooks"]) if obj.get("webhooks") is not None else None + }) + return _obj + + diff --git a/voucherify/models/management_projects_get_response_body_webhooks_callout_notifications_distributions.py b/voucherify/models/management_projects_get_response_body_webhooks_callout_notifications_distributions.py new file mode 100644 index 00000000..d830a9ef --- /dev/null +++ b/voucherify/models/management_projects_get_response_body_webhooks_callout_notifications_distributions.py @@ -0,0 +1,107 @@ +# coding: utf-8 + +""" + Voucherify API + + Voucherify promotion engine REST API. Please see https://docs.voucherify.io/docs for more details. + + The version of the OpenAPI document: v2018-08-01 + Contact: support@voucherify.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class ManagementProjectsGetResponseBodyWebhooksCalloutNotificationsDistributions(BaseModel): + """ + Determines the notification settings for webhooks sent through Distributions. + """ # noqa: E501 + email: Optional[StrictBool] = Field(default=None, description="Enables the notification through an email.") + in_app: Optional[StrictBool] = Field(default=None, description="Enables the notification through an email.") + emails: Optional[List[StrictStr]] = Field(default=None, description="An array of email addresses which will receive the notification.") + __properties: ClassVar[List[str]] = ["email", "in_app", "emails"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ManagementProjectsGetResponseBodyWebhooksCalloutNotificationsDistributions from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if email (nullable) is None + # and model_fields_set contains the field + if self.email is None and "email" in self.model_fields_set: + _dict['email'] = None + + # set to None if in_app (nullable) is None + # and model_fields_set contains the field + if self.in_app is None and "in_app" in self.model_fields_set: + _dict['in_app'] = None + + # set to None if emails (nullable) is None + # and model_fields_set contains the field + if self.emails is None and "emails" in self.model_fields_set: + _dict['emails'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ManagementProjectsGetResponseBodyWebhooksCalloutNotificationsDistributions from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "email": obj.get("email"), + "in_app": obj.get("in_app"), + "emails": obj.get("emails") + }) + return _obj + + diff --git a/voucherify/models/management_projects_get_response_body_webhooks_callout_notifications_webhooks.py b/voucherify/models/management_projects_get_response_body_webhooks_callout_notifications_webhooks.py new file mode 100644 index 00000000..9d15393d --- /dev/null +++ b/voucherify/models/management_projects_get_response_body_webhooks_callout_notifications_webhooks.py @@ -0,0 +1,107 @@ +# coding: utf-8 + +""" + Voucherify API + + Voucherify promotion engine REST API. Please see https://docs.voucherify.io/docs for more details. + + The version of the OpenAPI document: v2018-08-01 + Contact: support@voucherify.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class ManagementProjectsGetResponseBodyWebhooksCalloutNotificationsWebhooks(BaseModel): + """ + Determines the notification settings for webhooks sent as set out in the Project settings. + """ # noqa: E501 + email: Optional[StrictBool] = Field(default=None, description="Enables the notification through an email.") + in_app: Optional[StrictBool] = Field(default=None, description="Enables the notification through an email.") + emails: Optional[List[StrictStr]] = Field(default=None, description="An array of email addresses which will receive the notification.") + __properties: ClassVar[List[str]] = ["email", "in_app", "emails"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ManagementProjectsGetResponseBodyWebhooksCalloutNotificationsWebhooks from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if email (nullable) is None + # and model_fields_set contains the field + if self.email is None and "email" in self.model_fields_set: + _dict['email'] = None + + # set to None if in_app (nullable) is None + # and model_fields_set contains the field + if self.in_app is None and "in_app" in self.model_fields_set: + _dict['in_app'] = None + + # set to None if emails (nullable) is None + # and model_fields_set contains the field + if self.emails is None and "emails" in self.model_fields_set: + _dict['emails'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ManagementProjectsGetResponseBodyWebhooksCalloutNotificationsWebhooks from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "email": obj.get("email"), + "in_app": obj.get("in_app"), + "emails": obj.get("emails") + }) + return _obj + + diff --git a/voucherify/models/management_projects_list_response_body.py b/voucherify/models/management_projects_list_response_body.py new file mode 100644 index 00000000..19ca9d17 --- /dev/null +++ b/voucherify/models/management_projects_list_response_body.py @@ -0,0 +1,142 @@ +# coding: utf-8 + +""" + Voucherify API + + Voucherify promotion engine REST API. Please see https://docs.voucherify.io/docs for more details. + + The version of the OpenAPI document: v2018-08-01 + Contact: support@voucherify.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from voucherify.models.management_project import ManagementProject +from typing import Optional, Set +from typing_extensions import Self + +class ManagementProjectsListResponseBody(BaseModel): + """ + Schema model for **GET** `managment/v1/projects`. + """ # noqa: E501 + object: Optional[StrictStr] = Field(default='list', description="The type of the object represented by JSON. This object stores information about the projects in a dictionary.") + data_ref: Optional[StrictStr] = Field(default='data', description="Identifies the name of the attribute that contains the array of project objects.") + data: Optional[List[ManagementProject]] = Field(default=None, description="Array of project objects.") + total: Optional[StrictInt] = Field(default=None, description="The total number of projects.") + __properties: ClassVar[List[str]] = ["object", "data_ref", "data", "total"] + + @field_validator('object') + def object_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['list']): + raise ValueError("must be one of enum values ('list')") + return value + + @field_validator('data_ref') + def data_ref_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['data']): + raise ValueError("must be one of enum values ('data')") + return value + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ManagementProjectsListResponseBody from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in data (list) + _items = [] + if self.data: + for _item_data in self.data: + if _item_data: + _items.append(_item_data.to_dict()) + _dict['data'] = _items + # set to None if object (nullable) is None + # and model_fields_set contains the field + if self.object is None and "object" in self.model_fields_set: + _dict['object'] = None + + # set to None if data_ref (nullable) is None + # and model_fields_set contains the field + if self.data_ref is None and "data_ref" in self.model_fields_set: + _dict['data_ref'] = None + + # set to None if data (nullable) is None + # and model_fields_set contains the field + if self.data is None and "data" in self.model_fields_set: + _dict['data'] = None + + # set to None if total (nullable) is None + # and model_fields_set contains the field + if self.total is None and "total" in self.model_fields_set: + _dict['total'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ManagementProjectsListResponseBody from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "object": obj.get("object") if obj.get("object") is not None else 'list', + "data_ref": obj.get("data_ref") if obj.get("data_ref") is not None else 'data', + "data": [ManagementProject.from_dict(_item) for _item in obj["data"]] if obj.get("data") is not None else None, + "total": obj.get("total") + }) + return _obj + + diff --git a/voucherify/models/management_projects_metadata_schema.py b/voucherify/models/management_projects_metadata_schema.py new file mode 100644 index 00000000..ab754eb7 --- /dev/null +++ b/voucherify/models/management_projects_metadata_schema.py @@ -0,0 +1,136 @@ +# coding: utf-8 + +""" + Voucherify API + + Voucherify promotion engine REST API. Please see https://docs.voucherify.io/docs for more details. + + The version of the OpenAPI document: v2018-08-01 + Contact: support@voucherify.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class ManagementProjectsMetadataSchema(BaseModel): + """ + Object representing a metadata schema. + """ # noqa: E501 + id: Optional[StrictStr] = Field(default=None, description="Unique identifier of the metadata schema.") + related_object: Optional[StrictStr] = Field(default=None, description="The resource type. You can define custom metadata schemas, which have a custom `\"related_object\"` resource type. The standard metadata schemas are: `\"campaign\"`, `\"customer\"`, `\"earning_rule\"`, `\"loyalty_tier\"`, `\"order\"`, `\"order_item\"`, `\"product\"`, `\"promotion_tier\"`, `\"publication\"`, `\"redemption\"`, `\"reward\"`, `\"voucher\"`.") + properties: Optional[Dict[str, Any]] = Field(default=None, description="Contains metadata definitions.") + allow_defined_only: Optional[StrictBool] = Field(default=None, description="Restricts the creation of metadata fields when set to `true`. It indicates whether or not you can create new metadata definitions, e.g. in the campaign or publication manager. If set to `true`, then only the defined fields are available for assigning values.") + created_at: Optional[datetime] = Field(default=None, description="Timestamp representing the date and time when the metadata schema was created. The value for this parameter is shown in the ISO 8601 format.") + updated_at: Optional[datetime] = Field(default=None, description="Timestamp representing the date and time when the metadata schema was updated. The value for this parameter is shown in the ISO 8601 format.") + object: Optional[StrictStr] = Field(default='metadata_schema', description="The type of the object represented by the JSON. This object stores information about the metadata schema.") + __properties: ClassVar[List[str]] = ["id", "related_object", "properties", "allow_defined_only", "created_at", "updated_at", "object"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ManagementProjectsMetadataSchema from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if id (nullable) is None + # and model_fields_set contains the field + if self.id is None and "id" in self.model_fields_set: + _dict['id'] = None + + # set to None if related_object (nullable) is None + # and model_fields_set contains the field + if self.related_object is None and "related_object" in self.model_fields_set: + _dict['related_object'] = None + + # set to None if properties (nullable) is None + # and model_fields_set contains the field + if self.properties is None and "properties" in self.model_fields_set: + _dict['properties'] = None + + # set to None if allow_defined_only (nullable) is None + # and model_fields_set contains the field + if self.allow_defined_only is None and "allow_defined_only" in self.model_fields_set: + _dict['allow_defined_only'] = None + + # set to None if created_at (nullable) is None + # and model_fields_set contains the field + if self.created_at is None and "created_at" in self.model_fields_set: + _dict['created_at'] = None + + # set to None if updated_at (nullable) is None + # and model_fields_set contains the field + if self.updated_at is None and "updated_at" in self.model_fields_set: + _dict['updated_at'] = None + + # set to None if object (nullable) is None + # and model_fields_set contains the field + if self.object is None and "object" in self.model_fields_set: + _dict['object'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ManagementProjectsMetadataSchema from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id"), + "related_object": obj.get("related_object"), + "properties": obj.get("properties"), + "allow_defined_only": obj.get("allow_defined_only"), + "created_at": obj.get("created_at"), + "updated_at": obj.get("updated_at"), + "object": obj.get("object") if obj.get("object") is not None else 'metadata_schema' + }) + return _obj + + diff --git a/voucherify/models/management_projects_metadata_schemas_create_request_body.py b/voucherify/models/management_projects_metadata_schemas_create_request_body.py new file mode 100644 index 00000000..4d0b968c --- /dev/null +++ b/voucherify/models/management_projects_metadata_schemas_create_request_body.py @@ -0,0 +1,107 @@ +# coding: utf-8 + +""" + Voucherify API + + Voucherify promotion engine REST API. Please see https://docs.voucherify.io/docs for more details. + + The version of the OpenAPI document: v2018-08-01 + Contact: support@voucherify.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class ManagementProjectsMetadataSchemasCreateRequestBody(BaseModel): + """ + + """ # noqa: E501 + related_object: Optional[StrictStr] = Field(default=None, description="The resource type. You can define custom metadata schemas, which have a custom `\"related_object\"` resource type, or you can use standard resource types: `\"campaign\"`, `\"customer\"`, `\"earning_rule\"`, `\"loyalty_tier\"`, `\"order\"`, `\"order_item\"`, `\"product\"`, `\"promotion_tier\"`, `\"publication\"`, `\"redemption\"`, `\"reward\"`, `\"voucher\"`.") + allow_defined_only: Optional[StrictBool] = Field(default=False, description="Restricts the creation of metadata fields when set to `true`. In other words, it indicates whether or not you are allowed to create new metadata definitions; for example, in the campaign manager or publication manager. If it is set to true, then only the defined fields will be available for assigning values. ") + properties: Optional[Dict[str, Any]] = Field(default=None, description="Contains metadata definitions. There can be many properties within this object. Only the properties sent in the request will be created.") + __properties: ClassVar[List[str]] = ["related_object", "allow_defined_only", "properties"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ManagementProjectsMetadataSchemasCreateRequestBody from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if related_object (nullable) is None + # and model_fields_set contains the field + if self.related_object is None and "related_object" in self.model_fields_set: + _dict['related_object'] = None + + # set to None if allow_defined_only (nullable) is None + # and model_fields_set contains the field + if self.allow_defined_only is None and "allow_defined_only" in self.model_fields_set: + _dict['allow_defined_only'] = None + + # set to None if properties (nullable) is None + # and model_fields_set contains the field + if self.properties is None and "properties" in self.model_fields_set: + _dict['properties'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ManagementProjectsMetadataSchemasCreateRequestBody from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "related_object": obj.get("related_object"), + "allow_defined_only": obj.get("allow_defined_only") if obj.get("allow_defined_only") is not None else False, + "properties": obj.get("properties") + }) + return _obj + + diff --git a/voucherify/models/management_projects_metadata_schemas_create_response_body.py b/voucherify/models/management_projects_metadata_schemas_create_response_body.py new file mode 100644 index 00000000..d09d7724 --- /dev/null +++ b/voucherify/models/management_projects_metadata_schemas_create_response_body.py @@ -0,0 +1,136 @@ +# coding: utf-8 + +""" + Voucherify API + + Voucherify promotion engine REST API. Please see https://docs.voucherify.io/docs for more details. + + The version of the OpenAPI document: v2018-08-01 + Contact: support@voucherify.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class ManagementProjectsMetadataSchemasCreateResponseBody(BaseModel): + """ + Response body schema for **POST** `management/v1/projects/{projectId}/metadata-schemas`. + """ # noqa: E501 + id: Optional[StrictStr] = Field(default=None, description="Unique identifier of the metadata schema.") + related_object: Optional[StrictStr] = Field(default=None, description="The resource type. You can define custom metadata schemas, which have a custom `\"related_object\"` resource type. The standard metadata schemas are: `\"campaign\"`, `\"customer\"`, `\"earning_rule\"`, `\"loyalty_tier\"`, `\"order\"`, `\"order_item\"`, `\"product\"`, `\"promotion_tier\"`, `\"publication\"`, `\"redemption\"`, `\"reward\"`, `\"voucher\"`.") + properties: Optional[Dict[str, Any]] = Field(default=None, description="Contains metadata definitions.") + allow_defined_only: Optional[StrictBool] = Field(default=None, description="Restricts the creation of metadata fields when set to `true`. It indicates whether or not you can create new metadata definitions, e.g. in the campaign or publication manager. If set to `true`, then only the defined fields are available for assigning values.") + created_at: Optional[datetime] = Field(default=None, description="Timestamp representing the date and time when the metadata schema was created. The value for this parameter is shown in the ISO 8601 format.") + updated_at: Optional[datetime] = Field(default=None, description="Timestamp representing the date and time when the metadata schema was updated. The value for this parameter is shown in the ISO 8601 format.") + object: Optional[StrictStr] = Field(default='metadata_schema', description="The type of the object represented by the JSON. This object stores information about the metadata schema.") + __properties: ClassVar[List[str]] = ["id", "related_object", "properties", "allow_defined_only", "created_at", "updated_at", "object"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ManagementProjectsMetadataSchemasCreateResponseBody from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if id (nullable) is None + # and model_fields_set contains the field + if self.id is None and "id" in self.model_fields_set: + _dict['id'] = None + + # set to None if related_object (nullable) is None + # and model_fields_set contains the field + if self.related_object is None and "related_object" in self.model_fields_set: + _dict['related_object'] = None + + # set to None if properties (nullable) is None + # and model_fields_set contains the field + if self.properties is None and "properties" in self.model_fields_set: + _dict['properties'] = None + + # set to None if allow_defined_only (nullable) is None + # and model_fields_set contains the field + if self.allow_defined_only is None and "allow_defined_only" in self.model_fields_set: + _dict['allow_defined_only'] = None + + # set to None if created_at (nullable) is None + # and model_fields_set contains the field + if self.created_at is None and "created_at" in self.model_fields_set: + _dict['created_at'] = None + + # set to None if updated_at (nullable) is None + # and model_fields_set contains the field + if self.updated_at is None and "updated_at" in self.model_fields_set: + _dict['updated_at'] = None + + # set to None if object (nullable) is None + # and model_fields_set contains the field + if self.object is None and "object" in self.model_fields_set: + _dict['object'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ManagementProjectsMetadataSchemasCreateResponseBody from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id"), + "related_object": obj.get("related_object"), + "properties": obj.get("properties"), + "allow_defined_only": obj.get("allow_defined_only"), + "created_at": obj.get("created_at"), + "updated_at": obj.get("updated_at"), + "object": obj.get("object") if obj.get("object") is not None else 'metadata_schema' + }) + return _obj + + diff --git a/voucherify/models/management_projects_metadata_schemas_get_response_body.py b/voucherify/models/management_projects_metadata_schemas_get_response_body.py new file mode 100644 index 00000000..4d4972c6 --- /dev/null +++ b/voucherify/models/management_projects_metadata_schemas_get_response_body.py @@ -0,0 +1,136 @@ +# coding: utf-8 + +""" + Voucherify API + + Voucherify promotion engine REST API. Please see https://docs.voucherify.io/docs for more details. + + The version of the OpenAPI document: v2018-08-01 + Contact: support@voucherify.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class ManagementProjectsMetadataSchemasGetResponseBody(BaseModel): + """ + Response body schema for **POST** `management/v1/projects/{projectId}/metadata-schemas/{metadataSchemaId}`. + """ # noqa: E501 + id: Optional[StrictStr] = Field(default=None, description="Unique identifier of the metadata schema.") + related_object: Optional[StrictStr] = Field(default=None, description="The resource type. You can define custom metadata schemas, which have a custom `\"related_object\"` resource type. The standard metadata schemas are: `\"campaign\"`, `\"customer\"`, `\"earning_rule\"`, `\"loyalty_tier\"`, `\"order\"`, `\"order_item\"`, `\"product\"`, `\"promotion_tier\"`, `\"publication\"`, `\"redemption\"`, `\"reward\"`, `\"voucher\"`.") + properties: Optional[Dict[str, Any]] = Field(default=None, description="Contains metadata definitions.") + allow_defined_only: Optional[StrictBool] = Field(default=None, description="Restricts the creation of metadata fields when set to `true`. It indicates whether or not you can create new metadata definitions, e.g. in the campaign or publication manager. If set to `true`, then only the defined fields are available for assigning values.") + created_at: Optional[datetime] = Field(default=None, description="Timestamp representing the date and time when the metadata schema was created. The value for this parameter is shown in the ISO 8601 format.") + updated_at: Optional[datetime] = Field(default=None, description="Timestamp representing the date and time when the metadata schema was updated. The value for this parameter is shown in the ISO 8601 format.") + object: Optional[StrictStr] = Field(default='metadata_schema', description="The type of the object represented by the JSON. This object stores information about the metadata schema.") + __properties: ClassVar[List[str]] = ["id", "related_object", "properties", "allow_defined_only", "created_at", "updated_at", "object"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ManagementProjectsMetadataSchemasGetResponseBody from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if id (nullable) is None + # and model_fields_set contains the field + if self.id is None and "id" in self.model_fields_set: + _dict['id'] = None + + # set to None if related_object (nullable) is None + # and model_fields_set contains the field + if self.related_object is None and "related_object" in self.model_fields_set: + _dict['related_object'] = None + + # set to None if properties (nullable) is None + # and model_fields_set contains the field + if self.properties is None and "properties" in self.model_fields_set: + _dict['properties'] = None + + # set to None if allow_defined_only (nullable) is None + # and model_fields_set contains the field + if self.allow_defined_only is None and "allow_defined_only" in self.model_fields_set: + _dict['allow_defined_only'] = None + + # set to None if created_at (nullable) is None + # and model_fields_set contains the field + if self.created_at is None and "created_at" in self.model_fields_set: + _dict['created_at'] = None + + # set to None if updated_at (nullable) is None + # and model_fields_set contains the field + if self.updated_at is None and "updated_at" in self.model_fields_set: + _dict['updated_at'] = None + + # set to None if object (nullable) is None + # and model_fields_set contains the field + if self.object is None and "object" in self.model_fields_set: + _dict['object'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ManagementProjectsMetadataSchemasGetResponseBody from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id"), + "related_object": obj.get("related_object"), + "properties": obj.get("properties"), + "allow_defined_only": obj.get("allow_defined_only"), + "created_at": obj.get("created_at"), + "updated_at": obj.get("updated_at"), + "object": obj.get("object") if obj.get("object") is not None else 'metadata_schema' + }) + return _obj + + diff --git a/voucherify/models/management_projects_metadata_schemas_list_response_body.py b/voucherify/models/management_projects_metadata_schemas_list_response_body.py new file mode 100644 index 00000000..30890387 --- /dev/null +++ b/voucherify/models/management_projects_metadata_schemas_list_response_body.py @@ -0,0 +1,142 @@ +# coding: utf-8 + +""" + Voucherify API + + Voucherify promotion engine REST API. Please see https://docs.voucherify.io/docs for more details. + + The version of the OpenAPI document: v2018-08-01 + Contact: support@voucherify.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from voucherify.models.management_projects_metadata_schema import ManagementProjectsMetadataSchema +from typing import Optional, Set +from typing_extensions import Self + +class ManagementProjectsMetadataSchemasListResponseBody(BaseModel): + """ + Object containing a list of metadata schemas. + """ # noqa: E501 + object: Optional[StrictStr] = Field(default='list', description="The type of the object represented by JSON. This object stores information about the metadata schemas in a dictionary.") + data_ref: Optional[StrictStr] = Field(default='data', description="Identifies the name of the attribute that contains the array of metadata schema objects.") + data: Optional[List[ManagementProjectsMetadataSchema]] = Field(default=None, description="Array of metadata schema objects. The metadata schemas are listed by related object properties.") + total: Optional[StrictInt] = Field(default=None, description="The total number of metadata schema objects.") + __properties: ClassVar[List[str]] = ["object", "data_ref", "data", "total"] + + @field_validator('object') + def object_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['list']): + raise ValueError("must be one of enum values ('list')") + return value + + @field_validator('data_ref') + def data_ref_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['data']): + raise ValueError("must be one of enum values ('data')") + return value + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ManagementProjectsMetadataSchemasListResponseBody from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in data (list) + _items = [] + if self.data: + for _item_data in self.data: + if _item_data: + _items.append(_item_data.to_dict()) + _dict['data'] = _items + # set to None if object (nullable) is None + # and model_fields_set contains the field + if self.object is None and "object" in self.model_fields_set: + _dict['object'] = None + + # set to None if data_ref (nullable) is None + # and model_fields_set contains the field + if self.data_ref is None and "data_ref" in self.model_fields_set: + _dict['data_ref'] = None + + # set to None if data (nullable) is None + # and model_fields_set contains the field + if self.data is None and "data" in self.model_fields_set: + _dict['data'] = None + + # set to None if total (nullable) is None + # and model_fields_set contains the field + if self.total is None and "total" in self.model_fields_set: + _dict['total'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ManagementProjectsMetadataSchemasListResponseBody from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "object": obj.get("object") if obj.get("object") is not None else 'list', + "data_ref": obj.get("data_ref") if obj.get("data_ref") is not None else 'data', + "data": [ManagementProjectsMetadataSchema.from_dict(_item) for _item in obj["data"]] if obj.get("data") is not None else None, + "total": obj.get("total") + }) + return _obj + + diff --git a/voucherify/models/management_projects_metadata_schemas_update_request_body.py b/voucherify/models/management_projects_metadata_schemas_update_request_body.py new file mode 100644 index 00000000..a1088202 --- /dev/null +++ b/voucherify/models/management_projects_metadata_schemas_update_request_body.py @@ -0,0 +1,100 @@ +# coding: utf-8 + +""" + Voucherify API + + Voucherify promotion engine REST API. Please see https://docs.voucherify.io/docs for more details. + + The version of the OpenAPI document: v2018-08-01 + Contact: support@voucherify.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictBool +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class ManagementProjectsMetadataSchemasUpdateRequestBody(BaseModel): + """ + + """ # noqa: E501 + allow_defined_only: Optional[StrictBool] = Field(default=None, description="Restricts the creation of metadata fields when set to `true`. In other words, it indicates whether or not you are allowed to create new metadata definitions; for example, in the campaign manager or publication manager. If it is set to true, then only the defined fields will be available for assigning values. ") + properties: Optional[Dict[str, Any]] = Field(default=None, description="Contains metadata definitions. There can be many properties within this object. Only the properties sent in the request will be updated. However, if you send a property, all its key-value pairs must be provided - otherwise, they will be overwritten to new values. You cannot change the `\"type\"` property. However, it is required, so you need to add it to the request.") + __properties: ClassVar[List[str]] = ["allow_defined_only", "properties"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ManagementProjectsMetadataSchemasUpdateRequestBody from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if allow_defined_only (nullable) is None + # and model_fields_set contains the field + if self.allow_defined_only is None and "allow_defined_only" in self.model_fields_set: + _dict['allow_defined_only'] = None + + # set to None if properties (nullable) is None + # and model_fields_set contains the field + if self.properties is None and "properties" in self.model_fields_set: + _dict['properties'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ManagementProjectsMetadataSchemasUpdateRequestBody from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "allow_defined_only": obj.get("allow_defined_only"), + "properties": obj.get("properties") + }) + return _obj + + diff --git a/voucherify/models/management_projects_metadata_schemas_update_response_body.py b/voucherify/models/management_projects_metadata_schemas_update_response_body.py new file mode 100644 index 00000000..9ec54f75 --- /dev/null +++ b/voucherify/models/management_projects_metadata_schemas_update_response_body.py @@ -0,0 +1,136 @@ +# coding: utf-8 + +""" + Voucherify API + + Voucherify promotion engine REST API. Please see https://docs.voucherify.io/docs for more details. + + The version of the OpenAPI document: v2018-08-01 + Contact: support@voucherify.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class ManagementProjectsMetadataSchemasUpdateResponseBody(BaseModel): + """ + Response body schema for **PUT** `management/v1/projects/{projectId}/metadata-schemas/{metadataSchemaId}`. + """ # noqa: E501 + id: Optional[StrictStr] = Field(default=None, description="Unique identifier of the metadata schema.") + related_object: Optional[StrictStr] = Field(default=None, description="The resource type. You can define custom metadata schemas, which have a custom `\"related_object\"` resource type. The standard metadata schemas are: `\"campaign\"`, `\"customer\"`, `\"earning_rule\"`, `\"loyalty_tier\"`, `\"order\"`, `\"order_item\"`, `\"product\"`, `\"promotion_tier\"`, `\"publication\"`, `\"redemption\"`, `\"reward\"`, `\"voucher\"`.") + properties: Optional[Dict[str, Any]] = Field(default=None, description="Contains metadata definitions.") + allow_defined_only: Optional[StrictBool] = Field(default=None, description="Restricts the creation of metadata fields when set to `true`. It indicates whether or not you can create new metadata definitions, e.g. in the campaign or publication manager. If set to `true`, then only the defined fields are available for assigning values.") + created_at: Optional[datetime] = Field(default=None, description="Timestamp representing the date and time when the metadata schema was created. The value for this parameter is shown in the ISO 8601 format.") + updated_at: Optional[datetime] = Field(default=None, description="Timestamp representing the date and time when the metadata schema was updated. The value for this parameter is shown in the ISO 8601 format.") + object: Optional[StrictStr] = Field(default='metadata_schema', description="The type of the object represented by the JSON. This object stores information about the metadata schema.") + __properties: ClassVar[List[str]] = ["id", "related_object", "properties", "allow_defined_only", "created_at", "updated_at", "object"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ManagementProjectsMetadataSchemasUpdateResponseBody from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if id (nullable) is None + # and model_fields_set contains the field + if self.id is None and "id" in self.model_fields_set: + _dict['id'] = None + + # set to None if related_object (nullable) is None + # and model_fields_set contains the field + if self.related_object is None and "related_object" in self.model_fields_set: + _dict['related_object'] = None + + # set to None if properties (nullable) is None + # and model_fields_set contains the field + if self.properties is None and "properties" in self.model_fields_set: + _dict['properties'] = None + + # set to None if allow_defined_only (nullable) is None + # and model_fields_set contains the field + if self.allow_defined_only is None and "allow_defined_only" in self.model_fields_set: + _dict['allow_defined_only'] = None + + # set to None if created_at (nullable) is None + # and model_fields_set contains the field + if self.created_at is None and "created_at" in self.model_fields_set: + _dict['created_at'] = None + + # set to None if updated_at (nullable) is None + # and model_fields_set contains the field + if self.updated_at is None and "updated_at" in self.model_fields_set: + _dict['updated_at'] = None + + # set to None if object (nullable) is None + # and model_fields_set contains the field + if self.object is None and "object" in self.model_fields_set: + _dict['object'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ManagementProjectsMetadataSchemasUpdateResponseBody from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id"), + "related_object": obj.get("related_object"), + "properties": obj.get("properties"), + "allow_defined_only": obj.get("allow_defined_only"), + "created_at": obj.get("created_at"), + "updated_at": obj.get("updated_at"), + "object": obj.get("object") if obj.get("object") is not None else 'metadata_schema' + }) + return _obj + + diff --git a/voucherify/models/management_projects_stacking_rules.py b/voucherify/models/management_projects_stacking_rules.py new file mode 100644 index 00000000..07936ca9 --- /dev/null +++ b/voucherify/models/management_projects_stacking_rules.py @@ -0,0 +1,223 @@ +# coding: utf-8 + +""" + Voucherify API + + Voucherify promotion engine REST API. Please see https://docs.voucherify.io/docs for more details. + + The version of the OpenAPI document: v2018-08-01 + Contact: support@voucherify.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self + +class ManagementProjectsStackingRules(BaseModel): + """ + Object representing the details of the stacking rules. + """ # noqa: E501 + id: Optional[StrictStr] = Field(default=None, description="The unique identifier of the stacking rules.") + exclusive_categories: Optional[List[StrictStr]] = Field(default=None, description="Lists the IDs of the categories that are exclusive.") + joint_categories: Optional[List[StrictStr]] = Field(default=None, description="Lists the IDs of the categories that are joint.") + redeemables_limit: Optional[Annotated[int, Field(le=30, strict=True, ge=1)]] = Field(default=None, description="Defines how many redeemables can be sent to Voucherify for validation at the same time.") + applicable_redeemables_limit: Optional[Annotated[int, Field(strict=True, ge=1)]] = Field(default=None, description="Defines how many redeemables can be applied at the same time. The number must be less than or equal to `\"redeemables_limit\"`.") + applicable_redeemables_per_category_limit: Optional[StrictInt] = Field(default=None, description="Defines how many redeemables with the same category can be applied at the same time. The number must be less than or equal to `\"applicable_redeemables_limit\"`.") + applicable_exclusive_redeemables_limit: Optional[Annotated[int, Field(le=5, strict=True, ge=1)]] = Field(default=None, description="Defines how many redeemables with an assigned exclusive category can be applied at the same time.") + applicable_exclusive_redeemables_per_category_limit: Optional[StrictInt] = Field(default=None, description="Defines how many exclusive redeemables with the same category can be applied at the same time. The number must be less than or equal to `\"applicable_exclusive_redeemables_limit\"`.") + discount_calculation_mode: Optional[StrictStr] = Field(default=None, description="Defines if the discounts are applied by taking into account the initial order amount or the discounted order amount.") + initial_amount_mode_categories: Optional[List[StrictStr]] = Field(default=None, description="Lists the IDs of the categories that apply a discount based on the initial amount.") + discounted_amount_mode_categories: Optional[List[StrictStr]] = Field(default=None, description="Lists the IDs of the categories that apply a discount based on the discounted amount.") + redeemables_application_mode: Optional[StrictStr] = Field(default=None, description="Defines the application mode for redeemables. `\"ALL\"` means that all redeemables must be validated for the redemption to be successful. `\"PARTIAL\"` means that only those redeemables that can be validated will be redeemed. The redeemables that fail validaton will be skipped.") + redeemables_sorting_rule: Optional[StrictStr] = Field(default=None, description="Defines the sorting rule for redeemables. `\"CATEGORY_HIERARCHY\"` means that redeemables are applied with the order established by the hierarchy of the categories. `\"REQUESTED_ORDER\"` means that redeemables are applied with the order established in the request.") + created_at: Optional[datetime] = Field(default=None, description="Timestamp representing the date and time when the stacking rules were created. The value for this parameter is shown in the ISO 8601 format.") + updated_at: Optional[datetime] = Field(default=None, description="Timestamp representing the date and time when the stacking rules were updated. The value for this parameter is shown in the ISO 8601 format.") + __properties: ClassVar[List[str]] = ["id", "exclusive_categories", "joint_categories", "redeemables_limit", "applicable_redeemables_limit", "applicable_redeemables_per_category_limit", "applicable_exclusive_redeemables_limit", "applicable_exclusive_redeemables_per_category_limit", "discount_calculation_mode", "initial_amount_mode_categories", "discounted_amount_mode_categories", "redeemables_application_mode", "redeemables_sorting_rule", "created_at", "updated_at"] + + @field_validator('discount_calculation_mode') + def discount_calculation_mode_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['INITIAL_AMOUNT', 'DISCOUNTED_AMOUNT']): + raise ValueError("must be one of enum values ('INITIAL_AMOUNT', 'DISCOUNTED_AMOUNT')") + return value + + @field_validator('redeemables_application_mode') + def redeemables_application_mode_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['ALL', 'PARTIAL']): + raise ValueError("must be one of enum values ('ALL', 'PARTIAL')") + return value + + @field_validator('redeemables_sorting_rule') + def redeemables_sorting_rule_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['CATEGORY_HIERARCHY', 'REQUESTED_ORDER']): + raise ValueError("must be one of enum values ('CATEGORY_HIERARCHY', 'REQUESTED_ORDER')") + return value + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ManagementProjectsStackingRules from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if id (nullable) is None + # and model_fields_set contains the field + if self.id is None and "id" in self.model_fields_set: + _dict['id'] = None + + # set to None if exclusive_categories (nullable) is None + # and model_fields_set contains the field + if self.exclusive_categories is None and "exclusive_categories" in self.model_fields_set: + _dict['exclusive_categories'] = None + + # set to None if joint_categories (nullable) is None + # and model_fields_set contains the field + if self.joint_categories is None and "joint_categories" in self.model_fields_set: + _dict['joint_categories'] = None + + # set to None if redeemables_limit (nullable) is None + # and model_fields_set contains the field + if self.redeemables_limit is None and "redeemables_limit" in self.model_fields_set: + _dict['redeemables_limit'] = None + + # set to None if applicable_redeemables_limit (nullable) is None + # and model_fields_set contains the field + if self.applicable_redeemables_limit is None and "applicable_redeemables_limit" in self.model_fields_set: + _dict['applicable_redeemables_limit'] = None + + # set to None if applicable_redeemables_per_category_limit (nullable) is None + # and model_fields_set contains the field + if self.applicable_redeemables_per_category_limit is None and "applicable_redeemables_per_category_limit" in self.model_fields_set: + _dict['applicable_redeemables_per_category_limit'] = None + + # set to None if applicable_exclusive_redeemables_limit (nullable) is None + # and model_fields_set contains the field + if self.applicable_exclusive_redeemables_limit is None and "applicable_exclusive_redeemables_limit" in self.model_fields_set: + _dict['applicable_exclusive_redeemables_limit'] = None + + # set to None if applicable_exclusive_redeemables_per_category_limit (nullable) is None + # and model_fields_set contains the field + if self.applicable_exclusive_redeemables_per_category_limit is None and "applicable_exclusive_redeemables_per_category_limit" in self.model_fields_set: + _dict['applicable_exclusive_redeemables_per_category_limit'] = None + + # set to None if discount_calculation_mode (nullable) is None + # and model_fields_set contains the field + if self.discount_calculation_mode is None and "discount_calculation_mode" in self.model_fields_set: + _dict['discount_calculation_mode'] = None + + # set to None if initial_amount_mode_categories (nullable) is None + # and model_fields_set contains the field + if self.initial_amount_mode_categories is None and "initial_amount_mode_categories" in self.model_fields_set: + _dict['initial_amount_mode_categories'] = None + + # set to None if discounted_amount_mode_categories (nullable) is None + # and model_fields_set contains the field + if self.discounted_amount_mode_categories is None and "discounted_amount_mode_categories" in self.model_fields_set: + _dict['discounted_amount_mode_categories'] = None + + # set to None if redeemables_application_mode (nullable) is None + # and model_fields_set contains the field + if self.redeemables_application_mode is None and "redeemables_application_mode" in self.model_fields_set: + _dict['redeemables_application_mode'] = None + + # set to None if redeemables_sorting_rule (nullable) is None + # and model_fields_set contains the field + if self.redeemables_sorting_rule is None and "redeemables_sorting_rule" in self.model_fields_set: + _dict['redeemables_sorting_rule'] = None + + # set to None if created_at (nullable) is None + # and model_fields_set contains the field + if self.created_at is None and "created_at" in self.model_fields_set: + _dict['created_at'] = None + + # set to None if updated_at (nullable) is None + # and model_fields_set contains the field + if self.updated_at is None and "updated_at" in self.model_fields_set: + _dict['updated_at'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ManagementProjectsStackingRules from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id"), + "exclusive_categories": obj.get("exclusive_categories"), + "joint_categories": obj.get("joint_categories"), + "redeemables_limit": obj.get("redeemables_limit"), + "applicable_redeemables_limit": obj.get("applicable_redeemables_limit"), + "applicable_redeemables_per_category_limit": obj.get("applicable_redeemables_per_category_limit"), + "applicable_exclusive_redeemables_limit": obj.get("applicable_exclusive_redeemables_limit"), + "applicable_exclusive_redeemables_per_category_limit": obj.get("applicable_exclusive_redeemables_per_category_limit"), + "discount_calculation_mode": obj.get("discount_calculation_mode"), + "initial_amount_mode_categories": obj.get("initial_amount_mode_categories"), + "discounted_amount_mode_categories": obj.get("discounted_amount_mode_categories"), + "redeemables_application_mode": obj.get("redeemables_application_mode"), + "redeemables_sorting_rule": obj.get("redeemables_sorting_rule"), + "created_at": obj.get("created_at"), + "updated_at": obj.get("updated_at") + }) + return _obj + + diff --git a/voucherify/models/management_projects_stacking_rules_create_request_body.py b/voucherify/models/management_projects_stacking_rules_create_request_body.py new file mode 100644 index 00000000..ba93d380 --- /dev/null +++ b/voucherify/models/management_projects_stacking_rules_create_request_body.py @@ -0,0 +1,201 @@ +# coding: utf-8 + +""" + Voucherify API + + Voucherify promotion engine REST API. Please see https://docs.voucherify.io/docs for more details. + + The version of the OpenAPI document: v2018-08-01 + Contact: support@voucherify.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self + +class ManagementProjectsStackingRulesCreateRequestBody(BaseModel): + """ + Request body schema for **POST** `/management/v1/projects/{projectId}/stacking-rules`. + """ # noqa: E501 + exclusive_categories: Optional[List[StrictStr]] = Field(default=None, description="Lists the IDs of the categories that are exclusive.") + joint_categories: Optional[List[StrictStr]] = Field(default=None, description="Lists the IDs of the categories that are joint.") + redeemables_limit: Optional[Annotated[int, Field(le=30, strict=True, ge=1)]] = Field(default=None, description="Defines how many redeemables can be sent to Voucherify for validation at the same time.") + applicable_redeemables_limit: Optional[Annotated[int, Field(strict=True, ge=1)]] = Field(default=None, description="Defines how many redeemables can be applied at the same time. The number must be less than or equal to `\"redeemables_limit\"`.") + applicable_redeemables_per_category_limit: Optional[StrictInt] = Field(default=None, description="Defines how many redeemables with the same category can be applied at the same time. The number must be less than or equal to `\"applicable_redeemables_limit\"`.") + applicable_exclusive_redeemables_limit: Optional[Annotated[int, Field(le=5, strict=True, ge=1)]] = Field(default=None, description="Defines how many redeemables with an assigned exclusive category can be applied at the same time.") + applicable_exclusive_redeemables_per_category_limit: Optional[StrictInt] = Field(default=None, description="Defines how many exclusive redeemables with the same category can be applied at the same time. The number must be less than or equal to `\"applicable_exclusive_redeemables_limit\"`.") + discount_calculation_mode: Optional[StrictStr] = Field(default=None, description="Defines if the discounts are applied by taking into account the initial order amount or the discounted order amount.") + initial_amount_mode_categories: Optional[List[StrictStr]] = Field(default=None, description="Lists the IDs of the categories that apply a discount based on the initial amount.") + discounted_amount_mode_categories: Optional[List[StrictStr]] = Field(default=None, description="Lists the IDs of the categories that apply a discount based on the discounted amount.") + redeemables_application_mode: Optional[StrictStr] = Field(default=None, description="Defines the application mode for redeemables. `\"ALL\"` means that all redeemables must be validated for the redemption to be successful. `\"PARTIAL\"` means that only those redeemables that can be validated will be redeemed. The redeemables that fail validaton will be skipped.") + redeemables_sorting_rule: Optional[StrictStr] = Field(default=None, description="Defines the sorting rule for redeemables. `\"CATEGORY_HIERARCHY\"` means that redeemables are applied with the order established by the hierarchy of the categories. `\"REQUESTED_ORDER\"` means that redeemables are applied with the order established in the request.") + __properties: ClassVar[List[str]] = ["exclusive_categories", "joint_categories", "redeemables_limit", "applicable_redeemables_limit", "applicable_redeemables_per_category_limit", "applicable_exclusive_redeemables_limit", "applicable_exclusive_redeemables_per_category_limit", "discount_calculation_mode", "initial_amount_mode_categories", "discounted_amount_mode_categories", "redeemables_application_mode", "redeemables_sorting_rule"] + + @field_validator('discount_calculation_mode') + def discount_calculation_mode_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['INITIAL_AMOUNT', 'DISCOUNTED_AMOUNT']): + raise ValueError("must be one of enum values ('INITIAL_AMOUNT', 'DISCOUNTED_AMOUNT')") + return value + + @field_validator('redeemables_application_mode') + def redeemables_application_mode_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['ALL', 'PARTIAL']): + raise ValueError("must be one of enum values ('ALL', 'PARTIAL')") + return value + + @field_validator('redeemables_sorting_rule') + def redeemables_sorting_rule_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['CATEGORY_HIERARCHY', 'REQUESTED_ORDER']): + raise ValueError("must be one of enum values ('CATEGORY_HIERARCHY', 'REQUESTED_ORDER')") + return value + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ManagementProjectsStackingRulesCreateRequestBody from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if exclusive_categories (nullable) is None + # and model_fields_set contains the field + if self.exclusive_categories is None and "exclusive_categories" in self.model_fields_set: + _dict['exclusive_categories'] = None + + # set to None if joint_categories (nullable) is None + # and model_fields_set contains the field + if self.joint_categories is None and "joint_categories" in self.model_fields_set: + _dict['joint_categories'] = None + + # set to None if redeemables_limit (nullable) is None + # and model_fields_set contains the field + if self.redeemables_limit is None and "redeemables_limit" in self.model_fields_set: + _dict['redeemables_limit'] = None + + # set to None if applicable_redeemables_limit (nullable) is None + # and model_fields_set contains the field + if self.applicable_redeemables_limit is None and "applicable_redeemables_limit" in self.model_fields_set: + _dict['applicable_redeemables_limit'] = None + + # set to None if applicable_redeemables_per_category_limit (nullable) is None + # and model_fields_set contains the field + if self.applicable_redeemables_per_category_limit is None and "applicable_redeemables_per_category_limit" in self.model_fields_set: + _dict['applicable_redeemables_per_category_limit'] = None + + # set to None if applicable_exclusive_redeemables_limit (nullable) is None + # and model_fields_set contains the field + if self.applicable_exclusive_redeemables_limit is None and "applicable_exclusive_redeemables_limit" in self.model_fields_set: + _dict['applicable_exclusive_redeemables_limit'] = None + + # set to None if applicable_exclusive_redeemables_per_category_limit (nullable) is None + # and model_fields_set contains the field + if self.applicable_exclusive_redeemables_per_category_limit is None and "applicable_exclusive_redeemables_per_category_limit" in self.model_fields_set: + _dict['applicable_exclusive_redeemables_per_category_limit'] = None + + # set to None if discount_calculation_mode (nullable) is None + # and model_fields_set contains the field + if self.discount_calculation_mode is None and "discount_calculation_mode" in self.model_fields_set: + _dict['discount_calculation_mode'] = None + + # set to None if initial_amount_mode_categories (nullable) is None + # and model_fields_set contains the field + if self.initial_amount_mode_categories is None and "initial_amount_mode_categories" in self.model_fields_set: + _dict['initial_amount_mode_categories'] = None + + # set to None if discounted_amount_mode_categories (nullable) is None + # and model_fields_set contains the field + if self.discounted_amount_mode_categories is None and "discounted_amount_mode_categories" in self.model_fields_set: + _dict['discounted_amount_mode_categories'] = None + + # set to None if redeemables_application_mode (nullable) is None + # and model_fields_set contains the field + if self.redeemables_application_mode is None and "redeemables_application_mode" in self.model_fields_set: + _dict['redeemables_application_mode'] = None + + # set to None if redeemables_sorting_rule (nullable) is None + # and model_fields_set contains the field + if self.redeemables_sorting_rule is None and "redeemables_sorting_rule" in self.model_fields_set: + _dict['redeemables_sorting_rule'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ManagementProjectsStackingRulesCreateRequestBody from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "exclusive_categories": obj.get("exclusive_categories"), + "joint_categories": obj.get("joint_categories"), + "redeemables_limit": obj.get("redeemables_limit"), + "applicable_redeemables_limit": obj.get("applicable_redeemables_limit"), + "applicable_redeemables_per_category_limit": obj.get("applicable_redeemables_per_category_limit"), + "applicable_exclusive_redeemables_limit": obj.get("applicable_exclusive_redeemables_limit"), + "applicable_exclusive_redeemables_per_category_limit": obj.get("applicable_exclusive_redeemables_per_category_limit"), + "discount_calculation_mode": obj.get("discount_calculation_mode"), + "initial_amount_mode_categories": obj.get("initial_amount_mode_categories"), + "discounted_amount_mode_categories": obj.get("discounted_amount_mode_categories"), + "redeemables_application_mode": obj.get("redeemables_application_mode"), + "redeemables_sorting_rule": obj.get("redeemables_sorting_rule") + }) + return _obj + + diff --git a/voucherify/models/management_projects_stacking_rules_create_response_body.py b/voucherify/models/management_projects_stacking_rules_create_response_body.py new file mode 100644 index 00000000..636a5643 --- /dev/null +++ b/voucherify/models/management_projects_stacking_rules_create_response_body.py @@ -0,0 +1,223 @@ +# coding: utf-8 + +""" + Voucherify API + + Voucherify promotion engine REST API. Please see https://docs.voucherify.io/docs for more details. + + The version of the OpenAPI document: v2018-08-01 + Contact: support@voucherify.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self + +class ManagementProjectsStackingRulesCreateResponseBody(BaseModel): + """ + Response body schema for **POST** `/management/v1/projects/{projectId}/stacking-rules`. + """ # noqa: E501 + id: Optional[StrictStr] = Field(default=None, description="The unique identifier of the stacking rules.") + exclusive_categories: Optional[List[StrictStr]] = Field(default=None, description="Lists the IDs of the categories that are exclusive.") + joint_categories: Optional[List[StrictStr]] = Field(default=None, description="Lists the IDs of the categories that are joint.") + redeemables_limit: Optional[Annotated[int, Field(le=30, strict=True, ge=1)]] = Field(default=None, description="Defines how many redeemables can be sent to Voucherify for validation at the same time.") + applicable_redeemables_limit: Optional[Annotated[int, Field(strict=True, ge=1)]] = Field(default=None, description="Defines how many redeemables can be applied at the same time. The number must be less than or equal to `\"redeemables_limit\"`.") + applicable_redeemables_per_category_limit: Optional[StrictInt] = Field(default=None, description="Defines how many redeemables with the same category can be applied at the same time. The number must be less than or equal to `\"applicable_redeemables_limit\"`.") + applicable_exclusive_redeemables_limit: Optional[Annotated[int, Field(le=5, strict=True, ge=1)]] = Field(default=None, description="Defines how many redeemables with an assigned exclusive category can be applied at the same time.") + applicable_exclusive_redeemables_per_category_limit: Optional[StrictInt] = Field(default=None, description="Defines how many exclusive redeemables with the same category can be applied at the same time. The number must be less than or equal to `\"applicable_exclusive_redeemables_limit\"`.") + discount_calculation_mode: Optional[StrictStr] = Field(default=None, description="Defines if the discounts are applied by taking into account the initial order amount or the discounted order amount.") + initial_amount_mode_categories: Optional[List[StrictStr]] = Field(default=None, description="Lists the IDs of the categories that apply a discount based on the initial amount.") + discounted_amount_mode_categories: Optional[List[StrictStr]] = Field(default=None, description="Lists the IDs of the categories that apply a discount based on the discounted amount.") + redeemables_application_mode: Optional[StrictStr] = Field(default=None, description="Defines the application mode for redeemables. `\"ALL\"` means that all redeemables must be validated for the redemption to be successful. `\"PARTIAL\"` means that only those redeemables that can be validated will be redeemed. The redeemables that fail validaton will be skipped.") + redeemables_sorting_rule: Optional[StrictStr] = Field(default=None, description="Defines the sorting rule for redeemables. `\"CATEGORY_HIERARCHY\"` means that redeemables are applied with the order established by the hierarchy of the categories. `\"REQUESTED_ORDER\"` means that redeemables are applied with the order established in the request.") + created_at: Optional[datetime] = Field(default=None, description="Timestamp representing the date and time when the stacking rules were created. The value for this parameter is shown in the ISO 8601 format.") + updated_at: Optional[datetime] = Field(default=None, description="Timestamp representing the date and time when the stacking rules were updated. The value for this parameter is shown in the ISO 8601 format.") + __properties: ClassVar[List[str]] = ["id", "exclusive_categories", "joint_categories", "redeemables_limit", "applicable_redeemables_limit", "applicable_redeemables_per_category_limit", "applicable_exclusive_redeemables_limit", "applicable_exclusive_redeemables_per_category_limit", "discount_calculation_mode", "initial_amount_mode_categories", "discounted_amount_mode_categories", "redeemables_application_mode", "redeemables_sorting_rule", "created_at", "updated_at"] + + @field_validator('discount_calculation_mode') + def discount_calculation_mode_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['INITIAL_AMOUNT', 'DISCOUNTED_AMOUNT']): + raise ValueError("must be one of enum values ('INITIAL_AMOUNT', 'DISCOUNTED_AMOUNT')") + return value + + @field_validator('redeemables_application_mode') + def redeemables_application_mode_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['ALL', 'PARTIAL']): + raise ValueError("must be one of enum values ('ALL', 'PARTIAL')") + return value + + @field_validator('redeemables_sorting_rule') + def redeemables_sorting_rule_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['CATEGORY_HIERARCHY', 'REQUESTED_ORDER']): + raise ValueError("must be one of enum values ('CATEGORY_HIERARCHY', 'REQUESTED_ORDER')") + return value + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ManagementProjectsStackingRulesCreateResponseBody from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if id (nullable) is None + # and model_fields_set contains the field + if self.id is None and "id" in self.model_fields_set: + _dict['id'] = None + + # set to None if exclusive_categories (nullable) is None + # and model_fields_set contains the field + if self.exclusive_categories is None and "exclusive_categories" in self.model_fields_set: + _dict['exclusive_categories'] = None + + # set to None if joint_categories (nullable) is None + # and model_fields_set contains the field + if self.joint_categories is None and "joint_categories" in self.model_fields_set: + _dict['joint_categories'] = None + + # set to None if redeemables_limit (nullable) is None + # and model_fields_set contains the field + if self.redeemables_limit is None and "redeemables_limit" in self.model_fields_set: + _dict['redeemables_limit'] = None + + # set to None if applicable_redeemables_limit (nullable) is None + # and model_fields_set contains the field + if self.applicable_redeemables_limit is None and "applicable_redeemables_limit" in self.model_fields_set: + _dict['applicable_redeemables_limit'] = None + + # set to None if applicable_redeemables_per_category_limit (nullable) is None + # and model_fields_set contains the field + if self.applicable_redeemables_per_category_limit is None and "applicable_redeemables_per_category_limit" in self.model_fields_set: + _dict['applicable_redeemables_per_category_limit'] = None + + # set to None if applicable_exclusive_redeemables_limit (nullable) is None + # and model_fields_set contains the field + if self.applicable_exclusive_redeemables_limit is None and "applicable_exclusive_redeemables_limit" in self.model_fields_set: + _dict['applicable_exclusive_redeemables_limit'] = None + + # set to None if applicable_exclusive_redeemables_per_category_limit (nullable) is None + # and model_fields_set contains the field + if self.applicable_exclusive_redeemables_per_category_limit is None and "applicable_exclusive_redeemables_per_category_limit" in self.model_fields_set: + _dict['applicable_exclusive_redeemables_per_category_limit'] = None + + # set to None if discount_calculation_mode (nullable) is None + # and model_fields_set contains the field + if self.discount_calculation_mode is None and "discount_calculation_mode" in self.model_fields_set: + _dict['discount_calculation_mode'] = None + + # set to None if initial_amount_mode_categories (nullable) is None + # and model_fields_set contains the field + if self.initial_amount_mode_categories is None and "initial_amount_mode_categories" in self.model_fields_set: + _dict['initial_amount_mode_categories'] = None + + # set to None if discounted_amount_mode_categories (nullable) is None + # and model_fields_set contains the field + if self.discounted_amount_mode_categories is None and "discounted_amount_mode_categories" in self.model_fields_set: + _dict['discounted_amount_mode_categories'] = None + + # set to None if redeemables_application_mode (nullable) is None + # and model_fields_set contains the field + if self.redeemables_application_mode is None and "redeemables_application_mode" in self.model_fields_set: + _dict['redeemables_application_mode'] = None + + # set to None if redeemables_sorting_rule (nullable) is None + # and model_fields_set contains the field + if self.redeemables_sorting_rule is None and "redeemables_sorting_rule" in self.model_fields_set: + _dict['redeemables_sorting_rule'] = None + + # set to None if created_at (nullable) is None + # and model_fields_set contains the field + if self.created_at is None and "created_at" in self.model_fields_set: + _dict['created_at'] = None + + # set to None if updated_at (nullable) is None + # and model_fields_set contains the field + if self.updated_at is None and "updated_at" in self.model_fields_set: + _dict['updated_at'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ManagementProjectsStackingRulesCreateResponseBody from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id"), + "exclusive_categories": obj.get("exclusive_categories"), + "joint_categories": obj.get("joint_categories"), + "redeemables_limit": obj.get("redeemables_limit"), + "applicable_redeemables_limit": obj.get("applicable_redeemables_limit"), + "applicable_redeemables_per_category_limit": obj.get("applicable_redeemables_per_category_limit"), + "applicable_exclusive_redeemables_limit": obj.get("applicable_exclusive_redeemables_limit"), + "applicable_exclusive_redeemables_per_category_limit": obj.get("applicable_exclusive_redeemables_per_category_limit"), + "discount_calculation_mode": obj.get("discount_calculation_mode"), + "initial_amount_mode_categories": obj.get("initial_amount_mode_categories"), + "discounted_amount_mode_categories": obj.get("discounted_amount_mode_categories"), + "redeemables_application_mode": obj.get("redeemables_application_mode"), + "redeemables_sorting_rule": obj.get("redeemables_sorting_rule"), + "created_at": obj.get("created_at"), + "updated_at": obj.get("updated_at") + }) + return _obj + + diff --git a/voucherify/models/management_projects_stacking_rules_get_response_body.py b/voucherify/models/management_projects_stacking_rules_get_response_body.py new file mode 100644 index 00000000..d89f98d5 --- /dev/null +++ b/voucherify/models/management_projects_stacking_rules_get_response_body.py @@ -0,0 +1,223 @@ +# coding: utf-8 + +""" + Voucherify API + + Voucherify promotion engine REST API. Please see https://docs.voucherify.io/docs for more details. + + The version of the OpenAPI document: v2018-08-01 + Contact: support@voucherify.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self + +class ManagementProjectsStackingRulesGetResponseBody(BaseModel): + """ + Response body schema for **GET** `/management/v1/projects/{projectId}/stacking-rules/{stackingRulesId}`. + """ # noqa: E501 + id: Optional[StrictStr] = Field(default=None, description="The unique identifier of the stacking rules.") + exclusive_categories: Optional[List[StrictStr]] = Field(default=None, description="Lists the IDs of the categories that are exclusive.") + joint_categories: Optional[List[StrictStr]] = Field(default=None, description="Lists the IDs of the categories that are joint.") + redeemables_limit: Optional[Annotated[int, Field(le=30, strict=True, ge=1)]] = Field(default=None, description="Defines how many redeemables can be sent to Voucherify for validation at the same time.") + applicable_redeemables_limit: Optional[Annotated[int, Field(strict=True, ge=1)]] = Field(default=None, description="Defines how many redeemables can be applied at the same time. The number must be less than or equal to `\"redeemables_limit\"`.") + applicable_redeemables_per_category_limit: Optional[StrictInt] = Field(default=None, description="Defines how many redeemables with the same category can be applied at the same time. The number must be less than or equal to `\"applicable_redeemables_limit\"`.") + applicable_exclusive_redeemables_limit: Optional[Annotated[int, Field(le=5, strict=True, ge=1)]] = Field(default=None, description="Defines how many redeemables with an assigned exclusive category can be applied at the same time.") + applicable_exclusive_redeemables_per_category_limit: Optional[StrictInt] = Field(default=None, description="Defines how many exclusive redeemables with the same category can be applied at the same time. The number must be less than or equal to `\"applicable_exclusive_redeemables_limit\"`.") + discount_calculation_mode: Optional[StrictStr] = Field(default=None, description="Defines if the discounts are applied by taking into account the initial order amount or the discounted order amount.") + initial_amount_mode_categories: Optional[List[StrictStr]] = Field(default=None, description="Lists the IDs of the categories that apply a discount based on the initial amount.") + discounted_amount_mode_categories: Optional[List[StrictStr]] = Field(default=None, description="Lists the IDs of the categories that apply a discount based on the discounted amount.") + redeemables_application_mode: Optional[StrictStr] = Field(default=None, description="Defines the application mode for redeemables. `\"ALL\"` means that all redeemables must be validated for the redemption to be successful. `\"PARTIAL\"` means that only those redeemables that can be validated will be redeemed. The redeemables that fail validaton will be skipped.") + redeemables_sorting_rule: Optional[StrictStr] = Field(default=None, description="Defines the sorting rule for redeemables. `\"CATEGORY_HIERARCHY\"` means that redeemables are applied with the order established by the hierarchy of the categories. `\"REQUESTED_ORDER\"` means that redeemables are applied with the order established in the request.") + created_at: Optional[datetime] = Field(default=None, description="Timestamp representing the date and time when the stacking rules were created. The value for this parameter is shown in the ISO 8601 format.") + updated_at: Optional[datetime] = Field(default=None, description="Timestamp representing the date and time when the stacking rules were updated. The value for this parameter is shown in the ISO 8601 format.") + __properties: ClassVar[List[str]] = ["id", "exclusive_categories", "joint_categories", "redeemables_limit", "applicable_redeemables_limit", "applicable_redeemables_per_category_limit", "applicable_exclusive_redeemables_limit", "applicable_exclusive_redeemables_per_category_limit", "discount_calculation_mode", "initial_amount_mode_categories", "discounted_amount_mode_categories", "redeemables_application_mode", "redeemables_sorting_rule", "created_at", "updated_at"] + + @field_validator('discount_calculation_mode') + def discount_calculation_mode_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['INITIAL_AMOUNT', 'DISCOUNTED_AMOUNT']): + raise ValueError("must be one of enum values ('INITIAL_AMOUNT', 'DISCOUNTED_AMOUNT')") + return value + + @field_validator('redeemables_application_mode') + def redeemables_application_mode_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['ALL', 'PARTIAL']): + raise ValueError("must be one of enum values ('ALL', 'PARTIAL')") + return value + + @field_validator('redeemables_sorting_rule') + def redeemables_sorting_rule_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['CATEGORY_HIERARCHY', 'REQUESTED_ORDER']): + raise ValueError("must be one of enum values ('CATEGORY_HIERARCHY', 'REQUESTED_ORDER')") + return value + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ManagementProjectsStackingRulesGetResponseBody from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if id (nullable) is None + # and model_fields_set contains the field + if self.id is None and "id" in self.model_fields_set: + _dict['id'] = None + + # set to None if exclusive_categories (nullable) is None + # and model_fields_set contains the field + if self.exclusive_categories is None and "exclusive_categories" in self.model_fields_set: + _dict['exclusive_categories'] = None + + # set to None if joint_categories (nullable) is None + # and model_fields_set contains the field + if self.joint_categories is None and "joint_categories" in self.model_fields_set: + _dict['joint_categories'] = None + + # set to None if redeemables_limit (nullable) is None + # and model_fields_set contains the field + if self.redeemables_limit is None and "redeemables_limit" in self.model_fields_set: + _dict['redeemables_limit'] = None + + # set to None if applicable_redeemables_limit (nullable) is None + # and model_fields_set contains the field + if self.applicable_redeemables_limit is None and "applicable_redeemables_limit" in self.model_fields_set: + _dict['applicable_redeemables_limit'] = None + + # set to None if applicable_redeemables_per_category_limit (nullable) is None + # and model_fields_set contains the field + if self.applicable_redeemables_per_category_limit is None and "applicable_redeemables_per_category_limit" in self.model_fields_set: + _dict['applicable_redeemables_per_category_limit'] = None + + # set to None if applicable_exclusive_redeemables_limit (nullable) is None + # and model_fields_set contains the field + if self.applicable_exclusive_redeemables_limit is None and "applicable_exclusive_redeemables_limit" in self.model_fields_set: + _dict['applicable_exclusive_redeemables_limit'] = None + + # set to None if applicable_exclusive_redeemables_per_category_limit (nullable) is None + # and model_fields_set contains the field + if self.applicable_exclusive_redeemables_per_category_limit is None and "applicable_exclusive_redeemables_per_category_limit" in self.model_fields_set: + _dict['applicable_exclusive_redeemables_per_category_limit'] = None + + # set to None if discount_calculation_mode (nullable) is None + # and model_fields_set contains the field + if self.discount_calculation_mode is None and "discount_calculation_mode" in self.model_fields_set: + _dict['discount_calculation_mode'] = None + + # set to None if initial_amount_mode_categories (nullable) is None + # and model_fields_set contains the field + if self.initial_amount_mode_categories is None and "initial_amount_mode_categories" in self.model_fields_set: + _dict['initial_amount_mode_categories'] = None + + # set to None if discounted_amount_mode_categories (nullable) is None + # and model_fields_set contains the field + if self.discounted_amount_mode_categories is None and "discounted_amount_mode_categories" in self.model_fields_set: + _dict['discounted_amount_mode_categories'] = None + + # set to None if redeemables_application_mode (nullable) is None + # and model_fields_set contains the field + if self.redeemables_application_mode is None and "redeemables_application_mode" in self.model_fields_set: + _dict['redeemables_application_mode'] = None + + # set to None if redeemables_sorting_rule (nullable) is None + # and model_fields_set contains the field + if self.redeemables_sorting_rule is None and "redeemables_sorting_rule" in self.model_fields_set: + _dict['redeemables_sorting_rule'] = None + + # set to None if created_at (nullable) is None + # and model_fields_set contains the field + if self.created_at is None and "created_at" in self.model_fields_set: + _dict['created_at'] = None + + # set to None if updated_at (nullable) is None + # and model_fields_set contains the field + if self.updated_at is None and "updated_at" in self.model_fields_set: + _dict['updated_at'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ManagementProjectsStackingRulesGetResponseBody from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id"), + "exclusive_categories": obj.get("exclusive_categories"), + "joint_categories": obj.get("joint_categories"), + "redeemables_limit": obj.get("redeemables_limit"), + "applicable_redeemables_limit": obj.get("applicable_redeemables_limit"), + "applicable_redeemables_per_category_limit": obj.get("applicable_redeemables_per_category_limit"), + "applicable_exclusive_redeemables_limit": obj.get("applicable_exclusive_redeemables_limit"), + "applicable_exclusive_redeemables_per_category_limit": obj.get("applicable_exclusive_redeemables_per_category_limit"), + "discount_calculation_mode": obj.get("discount_calculation_mode"), + "initial_amount_mode_categories": obj.get("initial_amount_mode_categories"), + "discounted_amount_mode_categories": obj.get("discounted_amount_mode_categories"), + "redeemables_application_mode": obj.get("redeemables_application_mode"), + "redeemables_sorting_rule": obj.get("redeemables_sorting_rule"), + "created_at": obj.get("created_at"), + "updated_at": obj.get("updated_at") + }) + return _obj + + diff --git a/voucherify/models/management_projects_stacking_rules_list_response_body.py b/voucherify/models/management_projects_stacking_rules_list_response_body.py new file mode 100644 index 00000000..03e9d6f2 --- /dev/null +++ b/voucherify/models/management_projects_stacking_rules_list_response_body.py @@ -0,0 +1,142 @@ +# coding: utf-8 + +""" + Voucherify API + + Voucherify promotion engine REST API. Please see https://docs.voucherify.io/docs for more details. + + The version of the OpenAPI document: v2018-08-01 + Contact: support@voucherify.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from voucherify.models.management_projects_stacking_rules import ManagementProjectsStackingRules +from typing import Optional, Set +from typing_extensions import Self + +class ManagementProjectsStackingRulesListResponseBody(BaseModel): + """ + Response body schema for **GET** `/management/v1/projects/{projectId}/stacking-rules`. + """ # noqa: E501 + object: Optional[StrictStr] = Field(default='list', description="The type of the object represented by JSON. This object stores information about the stacking rules in a dictionary.") + data_ref: Optional[StrictStr] = Field(default='data', description="Identifies the name of the attribute that contains the array of stacking rule objects.") + data: Optional[List[ManagementProjectsStackingRules]] = Field(default=None, description="Array of only one stacking rule object.") + total: Optional[StrictInt] = Field(default=None, description="The total number of stacking rule objects. It is always 1.") + __properties: ClassVar[List[str]] = ["object", "data_ref", "data", "total"] + + @field_validator('object') + def object_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['list']): + raise ValueError("must be one of enum values ('list')") + return value + + @field_validator('data_ref') + def data_ref_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['data']): + raise ValueError("must be one of enum values ('data')") + return value + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ManagementProjectsStackingRulesListResponseBody from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in data (list) + _items = [] + if self.data: + for _item_data in self.data: + if _item_data: + _items.append(_item_data.to_dict()) + _dict['data'] = _items + # set to None if object (nullable) is None + # and model_fields_set contains the field + if self.object is None and "object" in self.model_fields_set: + _dict['object'] = None + + # set to None if data_ref (nullable) is None + # and model_fields_set contains the field + if self.data_ref is None and "data_ref" in self.model_fields_set: + _dict['data_ref'] = None + + # set to None if data (nullable) is None + # and model_fields_set contains the field + if self.data is None and "data" in self.model_fields_set: + _dict['data'] = None + + # set to None if total (nullable) is None + # and model_fields_set contains the field + if self.total is None and "total" in self.model_fields_set: + _dict['total'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ManagementProjectsStackingRulesListResponseBody from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "object": obj.get("object") if obj.get("object") is not None else 'list', + "data_ref": obj.get("data_ref") if obj.get("data_ref") is not None else 'data', + "data": [ManagementProjectsStackingRules.from_dict(_item) for _item in obj["data"]] if obj.get("data") is not None else None, + "total": obj.get("total") + }) + return _obj + + diff --git a/voucherify/models/management_projects_stacking_rules_update_request_body.py b/voucherify/models/management_projects_stacking_rules_update_request_body.py new file mode 100644 index 00000000..50eb562c --- /dev/null +++ b/voucherify/models/management_projects_stacking_rules_update_request_body.py @@ -0,0 +1,201 @@ +# coding: utf-8 + +""" + Voucherify API + + Voucherify promotion engine REST API. Please see https://docs.voucherify.io/docs for more details. + + The version of the OpenAPI document: v2018-08-01 + Contact: support@voucherify.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self + +class ManagementProjectsStackingRulesUpdateRequestBody(BaseModel): + """ + Request body schema for **PUT** `/management/v1/projects/{projectId}/stacking-rules/{stackingRulesId}`. + """ # noqa: E501 + exclusive_categories: Optional[List[StrictStr]] = Field(default=None, description="Lists the IDs of the categories that are exclusive.") + joint_categories: Optional[List[StrictStr]] = Field(default=None, description="Lists the IDs of the categories that are joint.") + redeemables_limit: Optional[Annotated[int, Field(le=30, strict=True, ge=1)]] = Field(default=None, description="Defines how many redeemables can be sent to Voucherify for validation at the same time.") + applicable_redeemables_limit: Optional[Annotated[int, Field(strict=True, ge=1)]] = Field(default=None, description="Defines how many redeemables can be applied at the same time. The number must be less than or equal to `\"redeemables_limit\"`.") + applicable_redeemables_per_category_limit: Optional[StrictInt] = Field(default=None, description="Defines how many redeemables with the same category can be applied at the same time. The number must be less than or equal to `\"applicable_redeemables_limit\"`.") + applicable_exclusive_redeemables_limit: Optional[Annotated[int, Field(le=5, strict=True, ge=1)]] = Field(default=None, description="Defines how many redeemables with an assigned exclusive category can be applied at the same time.") + applicable_exclusive_redeemables_per_category_limit: Optional[StrictInt] = Field(default=None, description="Defines how many exclusive redeemables with the same category can be applied at the same time. The number must be less than or equal to `\"applicable_exclusive_redeemables_limit\"`.") + discount_calculation_mode: Optional[StrictStr] = Field(default=None, description="Defines if the discounts are applied by taking into account the initial order amount or the discounted order amount.") + initial_amount_mode_categories: Optional[List[StrictStr]] = Field(default=None, description="Lists the IDs of the categories that apply a discount based on the initial amount.") + discounted_amount_mode_categories: Optional[List[StrictStr]] = Field(default=None, description="Lists the IDs of the categories that apply a discount based on the discounted amount.") + redeemables_application_mode: Optional[StrictStr] = Field(default=None, description="Defines the application mode for redeemables. `\"ALL\"` means that all redeemables must be validated for the redemption to be successful. `\"PARTIAL\"` means that only those redeemables that can be validated will be redeemed. The redeemables that fail validaton will be skipped.") + redeemables_sorting_rule: Optional[StrictStr] = Field(default=None, description="Defines the sorting rule for redeemables. `\"CATEGORY_HIERARCHY\"` means that redeemables are applied with the order established by the hierarchy of the categories. `\"REQUESTED_ORDER\"` means that redeemables are applied with the order established in the request.") + __properties: ClassVar[List[str]] = ["exclusive_categories", "joint_categories", "redeemables_limit", "applicable_redeemables_limit", "applicable_redeemables_per_category_limit", "applicable_exclusive_redeemables_limit", "applicable_exclusive_redeemables_per_category_limit", "discount_calculation_mode", "initial_amount_mode_categories", "discounted_amount_mode_categories", "redeemables_application_mode", "redeemables_sorting_rule"] + + @field_validator('discount_calculation_mode') + def discount_calculation_mode_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['INITIAL_AMOUNT', 'DISCOUNTED_AMOUNT']): + raise ValueError("must be one of enum values ('INITIAL_AMOUNT', 'DISCOUNTED_AMOUNT')") + return value + + @field_validator('redeemables_application_mode') + def redeemables_application_mode_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['ALL', 'PARTIAL']): + raise ValueError("must be one of enum values ('ALL', 'PARTIAL')") + return value + + @field_validator('redeemables_sorting_rule') + def redeemables_sorting_rule_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['CATEGORY_HIERARCHY', 'REQUESTED_ORDER']): + raise ValueError("must be one of enum values ('CATEGORY_HIERARCHY', 'REQUESTED_ORDER')") + return value + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ManagementProjectsStackingRulesUpdateRequestBody from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if exclusive_categories (nullable) is None + # and model_fields_set contains the field + if self.exclusive_categories is None and "exclusive_categories" in self.model_fields_set: + _dict['exclusive_categories'] = None + + # set to None if joint_categories (nullable) is None + # and model_fields_set contains the field + if self.joint_categories is None and "joint_categories" in self.model_fields_set: + _dict['joint_categories'] = None + + # set to None if redeemables_limit (nullable) is None + # and model_fields_set contains the field + if self.redeemables_limit is None and "redeemables_limit" in self.model_fields_set: + _dict['redeemables_limit'] = None + + # set to None if applicable_redeemables_limit (nullable) is None + # and model_fields_set contains the field + if self.applicable_redeemables_limit is None and "applicable_redeemables_limit" in self.model_fields_set: + _dict['applicable_redeemables_limit'] = None + + # set to None if applicable_redeemables_per_category_limit (nullable) is None + # and model_fields_set contains the field + if self.applicable_redeemables_per_category_limit is None and "applicable_redeemables_per_category_limit" in self.model_fields_set: + _dict['applicable_redeemables_per_category_limit'] = None + + # set to None if applicable_exclusive_redeemables_limit (nullable) is None + # and model_fields_set contains the field + if self.applicable_exclusive_redeemables_limit is None and "applicable_exclusive_redeemables_limit" in self.model_fields_set: + _dict['applicable_exclusive_redeemables_limit'] = None + + # set to None if applicable_exclusive_redeemables_per_category_limit (nullable) is None + # and model_fields_set contains the field + if self.applicable_exclusive_redeemables_per_category_limit is None and "applicable_exclusive_redeemables_per_category_limit" in self.model_fields_set: + _dict['applicable_exclusive_redeemables_per_category_limit'] = None + + # set to None if discount_calculation_mode (nullable) is None + # and model_fields_set contains the field + if self.discount_calculation_mode is None and "discount_calculation_mode" in self.model_fields_set: + _dict['discount_calculation_mode'] = None + + # set to None if initial_amount_mode_categories (nullable) is None + # and model_fields_set contains the field + if self.initial_amount_mode_categories is None and "initial_amount_mode_categories" in self.model_fields_set: + _dict['initial_amount_mode_categories'] = None + + # set to None if discounted_amount_mode_categories (nullable) is None + # and model_fields_set contains the field + if self.discounted_amount_mode_categories is None and "discounted_amount_mode_categories" in self.model_fields_set: + _dict['discounted_amount_mode_categories'] = None + + # set to None if redeemables_application_mode (nullable) is None + # and model_fields_set contains the field + if self.redeemables_application_mode is None and "redeemables_application_mode" in self.model_fields_set: + _dict['redeemables_application_mode'] = None + + # set to None if redeemables_sorting_rule (nullable) is None + # and model_fields_set contains the field + if self.redeemables_sorting_rule is None and "redeemables_sorting_rule" in self.model_fields_set: + _dict['redeemables_sorting_rule'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ManagementProjectsStackingRulesUpdateRequestBody from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "exclusive_categories": obj.get("exclusive_categories"), + "joint_categories": obj.get("joint_categories"), + "redeemables_limit": obj.get("redeemables_limit"), + "applicable_redeemables_limit": obj.get("applicable_redeemables_limit"), + "applicable_redeemables_per_category_limit": obj.get("applicable_redeemables_per_category_limit"), + "applicable_exclusive_redeemables_limit": obj.get("applicable_exclusive_redeemables_limit"), + "applicable_exclusive_redeemables_per_category_limit": obj.get("applicable_exclusive_redeemables_per_category_limit"), + "discount_calculation_mode": obj.get("discount_calculation_mode"), + "initial_amount_mode_categories": obj.get("initial_amount_mode_categories"), + "discounted_amount_mode_categories": obj.get("discounted_amount_mode_categories"), + "redeemables_application_mode": obj.get("redeemables_application_mode"), + "redeemables_sorting_rule": obj.get("redeemables_sorting_rule") + }) + return _obj + + diff --git a/voucherify/models/management_projects_stacking_rules_update_response_body.py b/voucherify/models/management_projects_stacking_rules_update_response_body.py new file mode 100644 index 00000000..9e2e25b5 --- /dev/null +++ b/voucherify/models/management_projects_stacking_rules_update_response_body.py @@ -0,0 +1,223 @@ +# coding: utf-8 + +""" + Voucherify API + + Voucherify promotion engine REST API. Please see https://docs.voucherify.io/docs for more details. + + The version of the OpenAPI document: v2018-08-01 + Contact: support@voucherify.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self + +class ManagementProjectsStackingRulesUpdateResponseBody(BaseModel): + """ + Response body schema for **PUT** `/management/v1/projects/{projectId}/stacking-rules/{stackingRulesId}`. + """ # noqa: E501 + id: Optional[StrictStr] = Field(default=None, description="The unique identifier of the stacking rules.") + exclusive_categories: Optional[List[StrictStr]] = Field(default=None, description="Lists the IDs of the categories that are exclusive.") + joint_categories: Optional[List[StrictStr]] = Field(default=None, description="Lists the IDs of the categories that are joint.") + redeemables_limit: Optional[Annotated[int, Field(le=30, strict=True, ge=1)]] = Field(default=None, description="Defines how many redeemables can be sent to Voucherify for validation at the same time.") + applicable_redeemables_limit: Optional[Annotated[int, Field(strict=True, ge=1)]] = Field(default=None, description="Defines how many redeemables can be applied at the same time. The number must be less than or equal to `\"redeemables_limit\"`.") + applicable_redeemables_per_category_limit: Optional[StrictInt] = Field(default=None, description="Defines how many redeemables with the same category can be applied at the same time. The number must be less than or equal to `\"applicable_redeemables_limit\"`.") + applicable_exclusive_redeemables_limit: Optional[Annotated[int, Field(le=5, strict=True, ge=1)]] = Field(default=None, description="Defines how many redeemables with an assigned exclusive category can be applied at the same time.") + applicable_exclusive_redeemables_per_category_limit: Optional[StrictInt] = Field(default=None, description="Defines how many exclusive redeemables with the same category can be applied at the same time. The number must be less than or equal to `\"applicable_exclusive_redeemables_limit\"`.") + discount_calculation_mode: Optional[StrictStr] = Field(default=None, description="Defines if the discounts are applied by taking into account the initial order amount or the discounted order amount.") + initial_amount_mode_categories: Optional[List[StrictStr]] = Field(default=None, description="Lists the IDs of the categories that apply a discount based on the initial amount.") + discounted_amount_mode_categories: Optional[List[StrictStr]] = Field(default=None, description="Lists the IDs of the categories that apply a discount based on the discounted amount.") + redeemables_application_mode: Optional[StrictStr] = Field(default=None, description="Defines the application mode for redeemables. `\"ALL\"` means that all redeemables must be validated for the redemption to be successful. `\"PARTIAL\"` means that only those redeemables that can be validated will be redeemed. The redeemables that fail validaton will be skipped.") + redeemables_sorting_rule: Optional[StrictStr] = Field(default=None, description="Defines the sorting rule for redeemables. `\"CATEGORY_HIERARCHY\"` means that redeemables are applied with the order established by the hierarchy of the categories. `\"REQUESTED_ORDER\"` means that redeemables are applied with the order established in the request.") + created_at: Optional[datetime] = Field(default=None, description="Timestamp representing the date and time when the stacking rules were created. The value for this parameter is shown in the ISO 8601 format.") + updated_at: Optional[datetime] = Field(default=None, description="Timestamp representing the date and time when the stacking rules were updated. The value for this parameter is shown in the ISO 8601 format.") + __properties: ClassVar[List[str]] = ["id", "exclusive_categories", "joint_categories", "redeemables_limit", "applicable_redeemables_limit", "applicable_redeemables_per_category_limit", "applicable_exclusive_redeemables_limit", "applicable_exclusive_redeemables_per_category_limit", "discount_calculation_mode", "initial_amount_mode_categories", "discounted_amount_mode_categories", "redeemables_application_mode", "redeemables_sorting_rule", "created_at", "updated_at"] + + @field_validator('discount_calculation_mode') + def discount_calculation_mode_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['INITIAL_AMOUNT', 'DISCOUNTED_AMOUNT']): + raise ValueError("must be one of enum values ('INITIAL_AMOUNT', 'DISCOUNTED_AMOUNT')") + return value + + @field_validator('redeemables_application_mode') + def redeemables_application_mode_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['ALL', 'PARTIAL']): + raise ValueError("must be one of enum values ('ALL', 'PARTIAL')") + return value + + @field_validator('redeemables_sorting_rule') + def redeemables_sorting_rule_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['CATEGORY_HIERARCHY', 'REQUESTED_ORDER']): + raise ValueError("must be one of enum values ('CATEGORY_HIERARCHY', 'REQUESTED_ORDER')") + return value + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ManagementProjectsStackingRulesUpdateResponseBody from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if id (nullable) is None + # and model_fields_set contains the field + if self.id is None and "id" in self.model_fields_set: + _dict['id'] = None + + # set to None if exclusive_categories (nullable) is None + # and model_fields_set contains the field + if self.exclusive_categories is None and "exclusive_categories" in self.model_fields_set: + _dict['exclusive_categories'] = None + + # set to None if joint_categories (nullable) is None + # and model_fields_set contains the field + if self.joint_categories is None and "joint_categories" in self.model_fields_set: + _dict['joint_categories'] = None + + # set to None if redeemables_limit (nullable) is None + # and model_fields_set contains the field + if self.redeemables_limit is None and "redeemables_limit" in self.model_fields_set: + _dict['redeemables_limit'] = None + + # set to None if applicable_redeemables_limit (nullable) is None + # and model_fields_set contains the field + if self.applicable_redeemables_limit is None and "applicable_redeemables_limit" in self.model_fields_set: + _dict['applicable_redeemables_limit'] = None + + # set to None if applicable_redeemables_per_category_limit (nullable) is None + # and model_fields_set contains the field + if self.applicable_redeemables_per_category_limit is None and "applicable_redeemables_per_category_limit" in self.model_fields_set: + _dict['applicable_redeemables_per_category_limit'] = None + + # set to None if applicable_exclusive_redeemables_limit (nullable) is None + # and model_fields_set contains the field + if self.applicable_exclusive_redeemables_limit is None and "applicable_exclusive_redeemables_limit" in self.model_fields_set: + _dict['applicable_exclusive_redeemables_limit'] = None + + # set to None if applicable_exclusive_redeemables_per_category_limit (nullable) is None + # and model_fields_set contains the field + if self.applicable_exclusive_redeemables_per_category_limit is None and "applicable_exclusive_redeemables_per_category_limit" in self.model_fields_set: + _dict['applicable_exclusive_redeemables_per_category_limit'] = None + + # set to None if discount_calculation_mode (nullable) is None + # and model_fields_set contains the field + if self.discount_calculation_mode is None and "discount_calculation_mode" in self.model_fields_set: + _dict['discount_calculation_mode'] = None + + # set to None if initial_amount_mode_categories (nullable) is None + # and model_fields_set contains the field + if self.initial_amount_mode_categories is None and "initial_amount_mode_categories" in self.model_fields_set: + _dict['initial_amount_mode_categories'] = None + + # set to None if discounted_amount_mode_categories (nullable) is None + # and model_fields_set contains the field + if self.discounted_amount_mode_categories is None and "discounted_amount_mode_categories" in self.model_fields_set: + _dict['discounted_amount_mode_categories'] = None + + # set to None if redeemables_application_mode (nullable) is None + # and model_fields_set contains the field + if self.redeemables_application_mode is None and "redeemables_application_mode" in self.model_fields_set: + _dict['redeemables_application_mode'] = None + + # set to None if redeemables_sorting_rule (nullable) is None + # and model_fields_set contains the field + if self.redeemables_sorting_rule is None and "redeemables_sorting_rule" in self.model_fields_set: + _dict['redeemables_sorting_rule'] = None + + # set to None if created_at (nullable) is None + # and model_fields_set contains the field + if self.created_at is None and "created_at" in self.model_fields_set: + _dict['created_at'] = None + + # set to None if updated_at (nullable) is None + # and model_fields_set contains the field + if self.updated_at is None and "updated_at" in self.model_fields_set: + _dict['updated_at'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ManagementProjectsStackingRulesUpdateResponseBody from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id"), + "exclusive_categories": obj.get("exclusive_categories"), + "joint_categories": obj.get("joint_categories"), + "redeemables_limit": obj.get("redeemables_limit"), + "applicable_redeemables_limit": obj.get("applicable_redeemables_limit"), + "applicable_redeemables_per_category_limit": obj.get("applicable_redeemables_per_category_limit"), + "applicable_exclusive_redeemables_limit": obj.get("applicable_exclusive_redeemables_limit"), + "applicable_exclusive_redeemables_per_category_limit": obj.get("applicable_exclusive_redeemables_per_category_limit"), + "discount_calculation_mode": obj.get("discount_calculation_mode"), + "initial_amount_mode_categories": obj.get("initial_amount_mode_categories"), + "discounted_amount_mode_categories": obj.get("discounted_amount_mode_categories"), + "redeemables_application_mode": obj.get("redeemables_application_mode"), + "redeemables_sorting_rule": obj.get("redeemables_sorting_rule"), + "created_at": obj.get("created_at"), + "updated_at": obj.get("updated_at") + }) + return _obj + + diff --git a/voucherify/models/management_projects_update_request_body.py b/voucherify/models/management_projects_update_request_body.py new file mode 100644 index 00000000..6cee9eae --- /dev/null +++ b/voucherify/models/management_projects_update_request_body.py @@ -0,0 +1,220 @@ +# coding: utf-8 + +""" + Voucherify API + + Voucherify promotion engine REST API. Please see https://docs.voucherify.io/docs for more details. + + The version of the OpenAPI document: v2018-08-01 + Contact: support@voucherify.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from voucherify.models.management_projects_update_request_body_api_usage_notifications import ManagementProjectsUpdateRequestBodyApiUsageNotifications +from voucherify.models.management_projects_update_request_body_default_code_config import ManagementProjectsUpdateRequestBodyDefaultCodeConfig +from voucherify.models.management_projects_update_request_body_webhooks_callout_notifications import ManagementProjectsUpdateRequestBodyWebhooksCalloutNotifications +from typing import Optional, Set +from typing_extensions import Self + +class ManagementProjectsUpdateRequestBody(BaseModel): + """ + Request body schema for **PUT** `v1/management/v1/projects/{projectId}`. + """ # noqa: E501 + name: Optional[StrictStr] = Field(default=None, description="The name of the project.") + description: Optional[StrictStr] = Field(default=None, description="A user-defined description of the project, e.g. its purpose, scope, region.") + timezone: Optional[StrictStr] = Field(default=None, description="The time zone in which the project is established. It can be in the GMT format or in accordance with IANA time zone database.") + currency: Optional[StrictStr] = Field(default=None, description="The currency used in the project. It is equal to a 3-letter ISO 4217 code.") + dial_code: Optional[StrictStr] = Field(default=None, description="The country dial code for the project. It is equal to an ITU country code.") + webhook_version: Optional[StrictStr] = Field(default='v2024-01-01', description="The webhook version used in the project.") + client_trusted_domains: Optional[List[StrictStr]] = Field(default=None, description="An array of URL addresses that allow client requests.") + client_redeem_enabled: Optional[StrictBool] = Field(default=None, description="Enables client-side redemption.") + client_publish_enabled: Optional[StrictBool] = Field(default=None, description="Enables client-side publication.") + client_list_vouchers_enabled: Optional[StrictBool] = Field(default=None, description="Enables client-side listing of vouchers.") + client_create_customer_enabled: Optional[StrictBool] = Field(default=None, description="Enables client-side creation of customers.") + client_loyalty_events_enabled: Optional[StrictBool] = Field(default=None, description="Enables client-side events for loyalty and referral programs.") + client_set_voucher_expiration_date_enabled: Optional[StrictBool] = Field(default=None, description="Enables client-side setting of voucher expiration date.") + api_usage_notifications: Optional[ManagementProjectsUpdateRequestBodyApiUsageNotifications] = None + webhooks_callout_notifications: Optional[ManagementProjectsUpdateRequestBodyWebhooksCalloutNotifications] = None + default_code_config: Optional[ManagementProjectsUpdateRequestBodyDefaultCodeConfig] = None + __properties: ClassVar[List[str]] = ["name", "description", "timezone", "currency", "dial_code", "webhook_version", "client_trusted_domains", "client_redeem_enabled", "client_publish_enabled", "client_list_vouchers_enabled", "client_create_customer_enabled", "client_loyalty_events_enabled", "client_set_voucher_expiration_date_enabled", "api_usage_notifications", "webhooks_callout_notifications", "default_code_config"] + + @field_validator('webhook_version') + def webhook_version_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['v2024-01-01']): + raise ValueError("must be one of enum values ('v2024-01-01')") + return value + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ManagementProjectsUpdateRequestBody from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of api_usage_notifications + if self.api_usage_notifications: + _dict['api_usage_notifications'] = self.api_usage_notifications.to_dict() + # override the default output from pydantic by calling `to_dict()` of webhooks_callout_notifications + if self.webhooks_callout_notifications: + _dict['webhooks_callout_notifications'] = self.webhooks_callout_notifications.to_dict() + # override the default output from pydantic by calling `to_dict()` of default_code_config + if self.default_code_config: + _dict['default_code_config'] = self.default_code_config.to_dict() + # set to None if name (nullable) is None + # and model_fields_set contains the field + if self.name is None and "name" in self.model_fields_set: + _dict['name'] = None + + # set to None if description (nullable) is None + # and model_fields_set contains the field + if self.description is None and "description" in self.model_fields_set: + _dict['description'] = None + + # set to None if timezone (nullable) is None + # and model_fields_set contains the field + if self.timezone is None and "timezone" in self.model_fields_set: + _dict['timezone'] = None + + # set to None if currency (nullable) is None + # and model_fields_set contains the field + if self.currency is None and "currency" in self.model_fields_set: + _dict['currency'] = None + + # set to None if dial_code (nullable) is None + # and model_fields_set contains the field + if self.dial_code is None and "dial_code" in self.model_fields_set: + _dict['dial_code'] = None + + # set to None if webhook_version (nullable) is None + # and model_fields_set contains the field + if self.webhook_version is None and "webhook_version" in self.model_fields_set: + _dict['webhook_version'] = None + + # set to None if client_trusted_domains (nullable) is None + # and model_fields_set contains the field + if self.client_trusted_domains is None and "client_trusted_domains" in self.model_fields_set: + _dict['client_trusted_domains'] = None + + # set to None if client_redeem_enabled (nullable) is None + # and model_fields_set contains the field + if self.client_redeem_enabled is None and "client_redeem_enabled" in self.model_fields_set: + _dict['client_redeem_enabled'] = None + + # set to None if client_publish_enabled (nullable) is None + # and model_fields_set contains the field + if self.client_publish_enabled is None and "client_publish_enabled" in self.model_fields_set: + _dict['client_publish_enabled'] = None + + # set to None if client_list_vouchers_enabled (nullable) is None + # and model_fields_set contains the field + if self.client_list_vouchers_enabled is None and "client_list_vouchers_enabled" in self.model_fields_set: + _dict['client_list_vouchers_enabled'] = None + + # set to None if client_create_customer_enabled (nullable) is None + # and model_fields_set contains the field + if self.client_create_customer_enabled is None and "client_create_customer_enabled" in self.model_fields_set: + _dict['client_create_customer_enabled'] = None + + # set to None if client_loyalty_events_enabled (nullable) is None + # and model_fields_set contains the field + if self.client_loyalty_events_enabled is None and "client_loyalty_events_enabled" in self.model_fields_set: + _dict['client_loyalty_events_enabled'] = None + + # set to None if client_set_voucher_expiration_date_enabled (nullable) is None + # and model_fields_set contains the field + if self.client_set_voucher_expiration_date_enabled is None and "client_set_voucher_expiration_date_enabled" in self.model_fields_set: + _dict['client_set_voucher_expiration_date_enabled'] = None + + # set to None if api_usage_notifications (nullable) is None + # and model_fields_set contains the field + if self.api_usage_notifications is None and "api_usage_notifications" in self.model_fields_set: + _dict['api_usage_notifications'] = None + + # set to None if webhooks_callout_notifications (nullable) is None + # and model_fields_set contains the field + if self.webhooks_callout_notifications is None and "webhooks_callout_notifications" in self.model_fields_set: + _dict['webhooks_callout_notifications'] = None + + # set to None if default_code_config (nullable) is None + # and model_fields_set contains the field + if self.default_code_config is None and "default_code_config" in self.model_fields_set: + _dict['default_code_config'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ManagementProjectsUpdateRequestBody from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "name": obj.get("name"), + "description": obj.get("description"), + "timezone": obj.get("timezone"), + "currency": obj.get("currency"), + "dial_code": obj.get("dial_code"), + "webhook_version": obj.get("webhook_version") if obj.get("webhook_version") is not None else 'v2024-01-01', + "client_trusted_domains": obj.get("client_trusted_domains"), + "client_redeem_enabled": obj.get("client_redeem_enabled"), + "client_publish_enabled": obj.get("client_publish_enabled"), + "client_list_vouchers_enabled": obj.get("client_list_vouchers_enabled"), + "client_create_customer_enabled": obj.get("client_create_customer_enabled"), + "client_loyalty_events_enabled": obj.get("client_loyalty_events_enabled"), + "client_set_voucher_expiration_date_enabled": obj.get("client_set_voucher_expiration_date_enabled"), + "api_usage_notifications": ManagementProjectsUpdateRequestBodyApiUsageNotifications.from_dict(obj["api_usage_notifications"]) if obj.get("api_usage_notifications") is not None else None, + "webhooks_callout_notifications": ManagementProjectsUpdateRequestBodyWebhooksCalloutNotifications.from_dict(obj["webhooks_callout_notifications"]) if obj.get("webhooks_callout_notifications") is not None else None, + "default_code_config": ManagementProjectsUpdateRequestBodyDefaultCodeConfig.from_dict(obj["default_code_config"]) if obj.get("default_code_config") is not None else None + }) + return _obj + + diff --git a/voucherify/models/management_projects_update_request_body_api_usage_notifications.py b/voucherify/models/management_projects_update_request_body_api_usage_notifications.py new file mode 100644 index 00000000..19f2ef17 --- /dev/null +++ b/voucherify/models/management_projects_update_request_body_api_usage_notifications.py @@ -0,0 +1,117 @@ +# coding: utf-8 + +""" + Voucherify API + + Voucherify promotion engine REST API. Please see https://docs.voucherify.io/docs for more details. + + The version of the OpenAPI document: v2018-08-01 + Contact: support@voucherify.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict +from typing import Any, ClassVar, Dict, List, Optional +from voucherify.models.usage_notifications import UsageNotifications +from typing import Optional, Set +from typing_extensions import Self + +class ManagementProjectsUpdateRequestBodyApiUsageNotifications(BaseModel): + """ + Determines the notification settings. + """ # noqa: E501 + redemptions: Optional[UsageNotifications] = None + messages: Optional[UsageNotifications] = None + api_calls: Optional[UsageNotifications] = None + bulk_api_calls: Optional[UsageNotifications] = None + webhook_calls: Optional[UsageNotifications] = None + cycle_calls: Optional[UsageNotifications] = None + __properties: ClassVar[List[str]] = ["redemptions", "messages", "api_calls", "bulk_api_calls", "webhook_calls", "cycle_calls"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ManagementProjectsUpdateRequestBodyApiUsageNotifications from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of redemptions + if self.redemptions: + _dict['redemptions'] = self.redemptions.to_dict() + # override the default output from pydantic by calling `to_dict()` of messages + if self.messages: + _dict['messages'] = self.messages.to_dict() + # override the default output from pydantic by calling `to_dict()` of api_calls + if self.api_calls: + _dict['api_calls'] = self.api_calls.to_dict() + # override the default output from pydantic by calling `to_dict()` of bulk_api_calls + if self.bulk_api_calls: + _dict['bulk_api_calls'] = self.bulk_api_calls.to_dict() + # override the default output from pydantic by calling `to_dict()` of webhook_calls + if self.webhook_calls: + _dict['webhook_calls'] = self.webhook_calls.to_dict() + # override the default output from pydantic by calling `to_dict()` of cycle_calls + if self.cycle_calls: + _dict['cycle_calls'] = self.cycle_calls.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ManagementProjectsUpdateRequestBodyApiUsageNotifications from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "redemptions": UsageNotifications.from_dict(obj["redemptions"]) if obj.get("redemptions") is not None else None, + "messages": UsageNotifications.from_dict(obj["messages"]) if obj.get("messages") is not None else None, + "api_calls": UsageNotifications.from_dict(obj["api_calls"]) if obj.get("api_calls") is not None else None, + "bulk_api_calls": UsageNotifications.from_dict(obj["bulk_api_calls"]) if obj.get("bulk_api_calls") is not None else None, + "webhook_calls": UsageNotifications.from_dict(obj["webhook_calls"]) if obj.get("webhook_calls") is not None else None, + "cycle_calls": UsageNotifications.from_dict(obj["cycle_calls"]) if obj.get("cycle_calls") is not None else None + }) + return _obj + + diff --git a/voucherify/models/management_projects_update_request_body_default_code_config.py b/voucherify/models/management_projects_update_request_body_default_code_config.py new file mode 100644 index 00000000..0150789c --- /dev/null +++ b/voucherify/models/management_projects_update_request_body_default_code_config.py @@ -0,0 +1,93 @@ +# coding: utf-8 + +""" + Voucherify API + + Voucherify promotion engine REST API. Please see https://docs.voucherify.io/docs for more details. + + The version of the OpenAPI document: v2018-08-01 + Contact: support@voucherify.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class ManagementProjectsUpdateRequestBodyDefaultCodeConfig(BaseModel): + """ + Determines the character set that is used as default for vouchers. It is affected by the `\"case_sensitive_codes\"` setting. + """ # noqa: E501 + charset: Optional[StrictStr] = Field(default=None, description="Lists all characters that are used as default for vouchers") + __properties: ClassVar[List[str]] = ["charset"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ManagementProjectsUpdateRequestBodyDefaultCodeConfig from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if charset (nullable) is None + # and model_fields_set contains the field + if self.charset is None and "charset" in self.model_fields_set: + _dict['charset'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ManagementProjectsUpdateRequestBodyDefaultCodeConfig from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "charset": obj.get("charset") + }) + return _obj + + diff --git a/voucherify/models/management_projects_update_request_body_webhooks_callout_notifications.py b/voucherify/models/management_projects_update_request_body_webhooks_callout_notifications.py new file mode 100644 index 00000000..d926c785 --- /dev/null +++ b/voucherify/models/management_projects_update_request_body_webhooks_callout_notifications.py @@ -0,0 +1,108 @@ +# coding: utf-8 + +""" + Voucherify API + + Voucherify promotion engine REST API. Please see https://docs.voucherify.io/docs for more details. + + The version of the OpenAPI document: v2018-08-01 + Contact: support@voucherify.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict +from typing import Any, ClassVar, Dict, List, Optional +from voucherify.models.management_projects_update_request_body_webhooks_callout_notifications_distributions import ManagementProjectsUpdateRequestBodyWebhooksCalloutNotificationsDistributions +from voucherify.models.management_projects_update_request_body_webhooks_callout_notifications_webhooks import ManagementProjectsUpdateRequestBodyWebhooksCalloutNotificationsWebhooks +from typing import Optional, Set +from typing_extensions import Self + +class ManagementProjectsUpdateRequestBodyWebhooksCalloutNotifications(BaseModel): + """ + Determines the notification settings for webhook callouts configured in Distributions and Project settings. + """ # noqa: E501 + distributions: Optional[ManagementProjectsUpdateRequestBodyWebhooksCalloutNotificationsDistributions] = None + webhooks: Optional[ManagementProjectsUpdateRequestBodyWebhooksCalloutNotificationsWebhooks] = None + __properties: ClassVar[List[str]] = ["distributions", "webhooks"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ManagementProjectsUpdateRequestBodyWebhooksCalloutNotifications from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of distributions + if self.distributions: + _dict['distributions'] = self.distributions.to_dict() + # override the default output from pydantic by calling `to_dict()` of webhooks + if self.webhooks: + _dict['webhooks'] = self.webhooks.to_dict() + # set to None if distributions (nullable) is None + # and model_fields_set contains the field + if self.distributions is None and "distributions" in self.model_fields_set: + _dict['distributions'] = None + + # set to None if webhooks (nullable) is None + # and model_fields_set contains the field + if self.webhooks is None and "webhooks" in self.model_fields_set: + _dict['webhooks'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ManagementProjectsUpdateRequestBodyWebhooksCalloutNotifications from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "distributions": ManagementProjectsUpdateRequestBodyWebhooksCalloutNotificationsDistributions.from_dict(obj["distributions"]) if obj.get("distributions") is not None else None, + "webhooks": ManagementProjectsUpdateRequestBodyWebhooksCalloutNotificationsWebhooks.from_dict(obj["webhooks"]) if obj.get("webhooks") is not None else None + }) + return _obj + + diff --git a/voucherify/models/management_projects_update_request_body_webhooks_callout_notifications_distributions.py b/voucherify/models/management_projects_update_request_body_webhooks_callout_notifications_distributions.py new file mode 100644 index 00000000..e5596d0d --- /dev/null +++ b/voucherify/models/management_projects_update_request_body_webhooks_callout_notifications_distributions.py @@ -0,0 +1,107 @@ +# coding: utf-8 + +""" + Voucherify API + + Voucherify promotion engine REST API. Please see https://docs.voucherify.io/docs for more details. + + The version of the OpenAPI document: v2018-08-01 + Contact: support@voucherify.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class ManagementProjectsUpdateRequestBodyWebhooksCalloutNotificationsDistributions(BaseModel): + """ + Determines the notification settings for webhooks sent through Distributions. + """ # noqa: E501 + email: Optional[StrictBool] = Field(default=None, description="Enables the notification through an email.") + in_app: Optional[StrictBool] = Field(default=None, description="Enables the notification through an email.") + emails: Optional[List[StrictStr]] = Field(default=None, description="An array of email addresses which will receive the notification.") + __properties: ClassVar[List[str]] = ["email", "in_app", "emails"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ManagementProjectsUpdateRequestBodyWebhooksCalloutNotificationsDistributions from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if email (nullable) is None + # and model_fields_set contains the field + if self.email is None and "email" in self.model_fields_set: + _dict['email'] = None + + # set to None if in_app (nullable) is None + # and model_fields_set contains the field + if self.in_app is None and "in_app" in self.model_fields_set: + _dict['in_app'] = None + + # set to None if emails (nullable) is None + # and model_fields_set contains the field + if self.emails is None and "emails" in self.model_fields_set: + _dict['emails'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ManagementProjectsUpdateRequestBodyWebhooksCalloutNotificationsDistributions from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "email": obj.get("email"), + "in_app": obj.get("in_app"), + "emails": obj.get("emails") + }) + return _obj + + diff --git a/voucherify/models/management_projects_update_request_body_webhooks_callout_notifications_webhooks.py b/voucherify/models/management_projects_update_request_body_webhooks_callout_notifications_webhooks.py new file mode 100644 index 00000000..bf2721e6 --- /dev/null +++ b/voucherify/models/management_projects_update_request_body_webhooks_callout_notifications_webhooks.py @@ -0,0 +1,107 @@ +# coding: utf-8 + +""" + Voucherify API + + Voucherify promotion engine REST API. Please see https://docs.voucherify.io/docs for more details. + + The version of the OpenAPI document: v2018-08-01 + Contact: support@voucherify.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class ManagementProjectsUpdateRequestBodyWebhooksCalloutNotificationsWebhooks(BaseModel): + """ + Determines the notification settings for webhooks sent as set out in the Project settings. + """ # noqa: E501 + email: Optional[StrictBool] = Field(default=None, description="Enables the notification through an email.") + in_app: Optional[StrictBool] = Field(default=None, description="Enables the notification through an email.") + emails: Optional[List[StrictStr]] = Field(default=None, description="An array of email addresses which will receive the notification.") + __properties: ClassVar[List[str]] = ["email", "in_app", "emails"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ManagementProjectsUpdateRequestBodyWebhooksCalloutNotificationsWebhooks from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if email (nullable) is None + # and model_fields_set contains the field + if self.email is None and "email" in self.model_fields_set: + _dict['email'] = None + + # set to None if in_app (nullable) is None + # and model_fields_set contains the field + if self.in_app is None and "in_app" in self.model_fields_set: + _dict['in_app'] = None + + # set to None if emails (nullable) is None + # and model_fields_set contains the field + if self.emails is None and "emails" in self.model_fields_set: + _dict['emails'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ManagementProjectsUpdateRequestBodyWebhooksCalloutNotificationsWebhooks from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "email": obj.get("email"), + "in_app": obj.get("in_app"), + "emails": obj.get("emails") + }) + return _obj + + diff --git a/voucherify/models/management_projects_update_response_body.py b/voucherify/models/management_projects_update_response_body.py new file mode 100644 index 00000000..da75ccb8 --- /dev/null +++ b/voucherify/models/management_projects_update_response_body.py @@ -0,0 +1,283 @@ +# coding: utf-8 + +""" + Voucherify API + + Voucherify promotion engine REST API. Please see https://docs.voucherify.io/docs for more details. + + The version of the OpenAPI document: v2018-08-01 + Contact: support@voucherify.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from voucherify.models.management_projects_update_response_body_api_usage_notifications import ManagementProjectsUpdateResponseBodyApiUsageNotifications +from voucherify.models.management_projects_update_response_body_default_code_config import ManagementProjectsUpdateResponseBodyDefaultCodeConfig +from voucherify.models.management_projects_update_response_body_limits import ManagementProjectsUpdateResponseBodyLimits +from voucherify.models.management_projects_update_response_body_webhooks_callout_notifications import ManagementProjectsUpdateResponseBodyWebhooksCalloutNotifications +from typing import Optional, Set +from typing_extensions import Self + +class ManagementProjectsUpdateResponseBody(BaseModel): + """ + ManagementProjectsUpdateResponseBody + """ # noqa: E501 + id: Optional[StrictStr] = Field(default=None, description="Unique identifier of the project.") + name: Optional[StrictStr] = Field(default=None, description="The name of the project.") + description: Optional[StrictStr] = Field(default=None, description="A user-defined description of the project, e.g. its purpose, scope, region.") + timezone: Optional[StrictStr] = Field(default=None, description="The time zone in which the project is established. It can be in the GMT format or in accordance with IANA time zone database.") + currency: Optional[StrictStr] = Field(default=None, description="The currency used in the project. It is equal to a 3-letter ISO 4217 code.") + dial_code: Optional[StrictStr] = Field(default=None, description="The country dial code for the project. It is equal to an ITU country code.") + webhook_version: Optional[StrictStr] = Field(default='v2024-01-01', description="The webhook version used in the project.") + client_trusted_domains: Optional[List[StrictStr]] = Field(default=None, description="An array of URL addresses that allow client requests.") + client_redeem_enabled: Optional[StrictBool] = Field(default=None, description="Enables client-side redemption.") + client_publish_enabled: Optional[StrictBool] = Field(default=None, description="Enables client-side publication.") + client_list_vouchers_enabled: Optional[StrictBool] = Field(default=None, description="Enables client-side listing of vouchers.") + client_create_customer_enabled: Optional[StrictBool] = Field(default=None, description="Enables client-side creation of customers.") + client_loyalty_events_enabled: Optional[StrictBool] = Field(default=None, description="Enables client-side events for loyalty and referral programs.") + client_set_voucher_expiration_date_enabled: Optional[StrictBool] = Field(default=None, description="Enables client-side setting of voucher expiration date.") + api_usage_notifications: Optional[ManagementProjectsUpdateResponseBodyApiUsageNotifications] = None + webhooks_callout_notifications: Optional[ManagementProjectsUpdateResponseBodyWebhooksCalloutNotifications] = None + cluster_id: Optional[StrictStr] = Field(default=None, description="The identifier of the cluster where the project will be created.") + case_sensitive_codes: Optional[StrictBool] = Field(default=None, description="Determines if the vouchers in the project will be: - case sensitive - if `true`, `C0dE-cfV` is **not** equal to `c0de-cfv`), - case insensitive - if `false`, `C0dE-cfV` is equal to `c0de-cfv`.") + api_version: Optional[StrictStr] = Field(default='v2018-08-01', description="The API version used in the project. Currently, the default and only value is `v2018-08-01`.") + is_sandbox: Optional[StrictBool] = Field(default=None, description="Determines if the project is a sandbox project.") + webhook_token: Optional[StrictStr] = Field(default=None, description="Webhook token used for authentication.") + default_code_config: Optional[ManagementProjectsUpdateResponseBodyDefaultCodeConfig] = None + limits: Optional[ManagementProjectsUpdateResponseBodyLimits] = None + __properties: ClassVar[List[str]] = ["id", "name", "description", "timezone", "currency", "dial_code", "webhook_version", "client_trusted_domains", "client_redeem_enabled", "client_publish_enabled", "client_list_vouchers_enabled", "client_create_customer_enabled", "client_loyalty_events_enabled", "client_set_voucher_expiration_date_enabled", "api_usage_notifications", "webhooks_callout_notifications", "cluster_id", "case_sensitive_codes", "api_version", "is_sandbox", "webhook_token", "default_code_config", "limits"] + + @field_validator('webhook_version') + def webhook_version_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['v2024-01-01']): + raise ValueError("must be one of enum values ('v2024-01-01')") + return value + + @field_validator('api_version') + def api_version_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['v2018-08-01']): + raise ValueError("must be one of enum values ('v2018-08-01')") + return value + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ManagementProjectsUpdateResponseBody from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of api_usage_notifications + if self.api_usage_notifications: + _dict['api_usage_notifications'] = self.api_usage_notifications.to_dict() + # override the default output from pydantic by calling `to_dict()` of webhooks_callout_notifications + if self.webhooks_callout_notifications: + _dict['webhooks_callout_notifications'] = self.webhooks_callout_notifications.to_dict() + # override the default output from pydantic by calling `to_dict()` of default_code_config + if self.default_code_config: + _dict['default_code_config'] = self.default_code_config.to_dict() + # override the default output from pydantic by calling `to_dict()` of limits + if self.limits: + _dict['limits'] = self.limits.to_dict() + # set to None if id (nullable) is None + # and model_fields_set contains the field + if self.id is None and "id" in self.model_fields_set: + _dict['id'] = None + + # set to None if name (nullable) is None + # and model_fields_set contains the field + if self.name is None and "name" in self.model_fields_set: + _dict['name'] = None + + # set to None if description (nullable) is None + # and model_fields_set contains the field + if self.description is None and "description" in self.model_fields_set: + _dict['description'] = None + + # set to None if timezone (nullable) is None + # and model_fields_set contains the field + if self.timezone is None and "timezone" in self.model_fields_set: + _dict['timezone'] = None + + # set to None if currency (nullable) is None + # and model_fields_set contains the field + if self.currency is None and "currency" in self.model_fields_set: + _dict['currency'] = None + + # set to None if dial_code (nullable) is None + # and model_fields_set contains the field + if self.dial_code is None and "dial_code" in self.model_fields_set: + _dict['dial_code'] = None + + # set to None if webhook_version (nullable) is None + # and model_fields_set contains the field + if self.webhook_version is None and "webhook_version" in self.model_fields_set: + _dict['webhook_version'] = None + + # set to None if client_trusted_domains (nullable) is None + # and model_fields_set contains the field + if self.client_trusted_domains is None and "client_trusted_domains" in self.model_fields_set: + _dict['client_trusted_domains'] = None + + # set to None if client_redeem_enabled (nullable) is None + # and model_fields_set contains the field + if self.client_redeem_enabled is None and "client_redeem_enabled" in self.model_fields_set: + _dict['client_redeem_enabled'] = None + + # set to None if client_publish_enabled (nullable) is None + # and model_fields_set contains the field + if self.client_publish_enabled is None and "client_publish_enabled" in self.model_fields_set: + _dict['client_publish_enabled'] = None + + # set to None if client_list_vouchers_enabled (nullable) is None + # and model_fields_set contains the field + if self.client_list_vouchers_enabled is None and "client_list_vouchers_enabled" in self.model_fields_set: + _dict['client_list_vouchers_enabled'] = None + + # set to None if client_create_customer_enabled (nullable) is None + # and model_fields_set contains the field + if self.client_create_customer_enabled is None and "client_create_customer_enabled" in self.model_fields_set: + _dict['client_create_customer_enabled'] = None + + # set to None if client_loyalty_events_enabled (nullable) is None + # and model_fields_set contains the field + if self.client_loyalty_events_enabled is None and "client_loyalty_events_enabled" in self.model_fields_set: + _dict['client_loyalty_events_enabled'] = None + + # set to None if client_set_voucher_expiration_date_enabled (nullable) is None + # and model_fields_set contains the field + if self.client_set_voucher_expiration_date_enabled is None and "client_set_voucher_expiration_date_enabled" in self.model_fields_set: + _dict['client_set_voucher_expiration_date_enabled'] = None + + # set to None if api_usage_notifications (nullable) is None + # and model_fields_set contains the field + if self.api_usage_notifications is None and "api_usage_notifications" in self.model_fields_set: + _dict['api_usage_notifications'] = None + + # set to None if webhooks_callout_notifications (nullable) is None + # and model_fields_set contains the field + if self.webhooks_callout_notifications is None and "webhooks_callout_notifications" in self.model_fields_set: + _dict['webhooks_callout_notifications'] = None + + # set to None if cluster_id (nullable) is None + # and model_fields_set contains the field + if self.cluster_id is None and "cluster_id" in self.model_fields_set: + _dict['cluster_id'] = None + + # set to None if case_sensitive_codes (nullable) is None + # and model_fields_set contains the field + if self.case_sensitive_codes is None and "case_sensitive_codes" in self.model_fields_set: + _dict['case_sensitive_codes'] = None + + # set to None if api_version (nullable) is None + # and model_fields_set contains the field + if self.api_version is None and "api_version" in self.model_fields_set: + _dict['api_version'] = None + + # set to None if is_sandbox (nullable) is None + # and model_fields_set contains the field + if self.is_sandbox is None and "is_sandbox" in self.model_fields_set: + _dict['is_sandbox'] = None + + # set to None if webhook_token (nullable) is None + # and model_fields_set contains the field + if self.webhook_token is None and "webhook_token" in self.model_fields_set: + _dict['webhook_token'] = None + + # set to None if default_code_config (nullable) is None + # and model_fields_set contains the field + if self.default_code_config is None and "default_code_config" in self.model_fields_set: + _dict['default_code_config'] = None + + # set to None if limits (nullable) is None + # and model_fields_set contains the field + if self.limits is None and "limits" in self.model_fields_set: + _dict['limits'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ManagementProjectsUpdateResponseBody from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id"), + "name": obj.get("name"), + "description": obj.get("description"), + "timezone": obj.get("timezone"), + "currency": obj.get("currency"), + "dial_code": obj.get("dial_code"), + "webhook_version": obj.get("webhook_version") if obj.get("webhook_version") is not None else 'v2024-01-01', + "client_trusted_domains": obj.get("client_trusted_domains"), + "client_redeem_enabled": obj.get("client_redeem_enabled"), + "client_publish_enabled": obj.get("client_publish_enabled"), + "client_list_vouchers_enabled": obj.get("client_list_vouchers_enabled"), + "client_create_customer_enabled": obj.get("client_create_customer_enabled"), + "client_loyalty_events_enabled": obj.get("client_loyalty_events_enabled"), + "client_set_voucher_expiration_date_enabled": obj.get("client_set_voucher_expiration_date_enabled"), + "api_usage_notifications": ManagementProjectsUpdateResponseBodyApiUsageNotifications.from_dict(obj["api_usage_notifications"]) if obj.get("api_usage_notifications") is not None else None, + "webhooks_callout_notifications": ManagementProjectsUpdateResponseBodyWebhooksCalloutNotifications.from_dict(obj["webhooks_callout_notifications"]) if obj.get("webhooks_callout_notifications") is not None else None, + "cluster_id": obj.get("cluster_id"), + "case_sensitive_codes": obj.get("case_sensitive_codes"), + "api_version": obj.get("api_version") if obj.get("api_version") is not None else 'v2018-08-01', + "is_sandbox": obj.get("is_sandbox"), + "webhook_token": obj.get("webhook_token"), + "default_code_config": ManagementProjectsUpdateResponseBodyDefaultCodeConfig.from_dict(obj["default_code_config"]) if obj.get("default_code_config") is not None else None, + "limits": ManagementProjectsUpdateResponseBodyLimits.from_dict(obj["limits"]) if obj.get("limits") is not None else None + }) + return _obj + + diff --git a/voucherify/models/management_projects_update_response_body_api_usage_notifications.py b/voucherify/models/management_projects_update_response_body_api_usage_notifications.py new file mode 100644 index 00000000..968dfa3f --- /dev/null +++ b/voucherify/models/management_projects_update_response_body_api_usage_notifications.py @@ -0,0 +1,117 @@ +# coding: utf-8 + +""" + Voucherify API + + Voucherify promotion engine REST API. Please see https://docs.voucherify.io/docs for more details. + + The version of the OpenAPI document: v2018-08-01 + Contact: support@voucherify.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict +from typing import Any, ClassVar, Dict, List, Optional +from voucherify.models.usage_notifications import UsageNotifications +from typing import Optional, Set +from typing_extensions import Self + +class ManagementProjectsUpdateResponseBodyApiUsageNotifications(BaseModel): + """ + Determines the notification settings. + """ # noqa: E501 + redemptions: Optional[UsageNotifications] = None + messages: Optional[UsageNotifications] = None + api_calls: Optional[UsageNotifications] = None + bulk_api_calls: Optional[UsageNotifications] = None + webhook_calls: Optional[UsageNotifications] = None + cycle_calls: Optional[UsageNotifications] = None + __properties: ClassVar[List[str]] = ["redemptions", "messages", "api_calls", "bulk_api_calls", "webhook_calls", "cycle_calls"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ManagementProjectsUpdateResponseBodyApiUsageNotifications from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of redemptions + if self.redemptions: + _dict['redemptions'] = self.redemptions.to_dict() + # override the default output from pydantic by calling `to_dict()` of messages + if self.messages: + _dict['messages'] = self.messages.to_dict() + # override the default output from pydantic by calling `to_dict()` of api_calls + if self.api_calls: + _dict['api_calls'] = self.api_calls.to_dict() + # override the default output from pydantic by calling `to_dict()` of bulk_api_calls + if self.bulk_api_calls: + _dict['bulk_api_calls'] = self.bulk_api_calls.to_dict() + # override the default output from pydantic by calling `to_dict()` of webhook_calls + if self.webhook_calls: + _dict['webhook_calls'] = self.webhook_calls.to_dict() + # override the default output from pydantic by calling `to_dict()` of cycle_calls + if self.cycle_calls: + _dict['cycle_calls'] = self.cycle_calls.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ManagementProjectsUpdateResponseBodyApiUsageNotifications from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "redemptions": UsageNotifications.from_dict(obj["redemptions"]) if obj.get("redemptions") is not None else None, + "messages": UsageNotifications.from_dict(obj["messages"]) if obj.get("messages") is not None else None, + "api_calls": UsageNotifications.from_dict(obj["api_calls"]) if obj.get("api_calls") is not None else None, + "bulk_api_calls": UsageNotifications.from_dict(obj["bulk_api_calls"]) if obj.get("bulk_api_calls") is not None else None, + "webhook_calls": UsageNotifications.from_dict(obj["webhook_calls"]) if obj.get("webhook_calls") is not None else None, + "cycle_calls": UsageNotifications.from_dict(obj["cycle_calls"]) if obj.get("cycle_calls") is not None else None + }) + return _obj + + diff --git a/voucherify/models/management_projects_update_response_body_default_code_config.py b/voucherify/models/management_projects_update_response_body_default_code_config.py new file mode 100644 index 00000000..40224d03 --- /dev/null +++ b/voucherify/models/management_projects_update_response_body_default_code_config.py @@ -0,0 +1,93 @@ +# coding: utf-8 + +""" + Voucherify API + + Voucherify promotion engine REST API. Please see https://docs.voucherify.io/docs for more details. + + The version of the OpenAPI document: v2018-08-01 + Contact: support@voucherify.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class ManagementProjectsUpdateResponseBodyDefaultCodeConfig(BaseModel): + """ + Determines the character set that is used as default for vouchers. It is affected by the `\"case_sensitive_codes\"` setting. + """ # noqa: E501 + charset: Optional[StrictStr] = Field(default=None, description="Lists all characters that are used as default for vouchers") + __properties: ClassVar[List[str]] = ["charset"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ManagementProjectsUpdateResponseBodyDefaultCodeConfig from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if charset (nullable) is None + # and model_fields_set contains the field + if self.charset is None and "charset" in self.model_fields_set: + _dict['charset'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ManagementProjectsUpdateResponseBodyDefaultCodeConfig from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "charset": obj.get("charset") + }) + return _obj + + diff --git a/voucherify/models/management_projects_update_response_body_limits.py b/voucherify/models/management_projects_update_response_body_limits.py new file mode 100644 index 00000000..c20cfe98 --- /dev/null +++ b/voucherify/models/management_projects_update_response_body_limits.py @@ -0,0 +1,116 @@ +# coding: utf-8 + +""" + Voucherify API + + Voucherify promotion engine REST API. Please see https://docs.voucherify.io/docs for more details. + + The version of the OpenAPI document: v2018-08-01 + Contact: support@voucherify.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict +from typing import Any, ClassVar, Dict, List, Optional +from voucherify.models.management_projects_update_response_body_limits_api_calls_item import ManagementProjectsUpdateResponseBodyLimitsApiCallsItem +from voucherify.models.management_projects_update_response_body_limits_bulk_api_calls_item import ManagementProjectsUpdateResponseBodyLimitsBulkApiCallsItem +from typing import Optional, Set +from typing_extensions import Self + +class ManagementProjectsUpdateResponseBodyLimits(BaseModel): + """ + Determines additional limits set on a given project, e.g. the Sandbox project. If no limits are returned, the limits set for the whole organization apply. + """ # noqa: E501 + api_calls: Optional[List[ManagementProjectsUpdateResponseBodyLimitsApiCallsItem]] = None + bulk_api_calls: Optional[List[ManagementProjectsUpdateResponseBodyLimitsBulkApiCallsItem]] = None + __properties: ClassVar[List[str]] = ["api_calls", "bulk_api_calls"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ManagementProjectsUpdateResponseBodyLimits from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in api_calls (list) + _items = [] + if self.api_calls: + for _item_api_calls in self.api_calls: + if _item_api_calls: + _items.append(_item_api_calls.to_dict()) + _dict['api_calls'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in bulk_api_calls (list) + _items = [] + if self.bulk_api_calls: + for _item_bulk_api_calls in self.bulk_api_calls: + if _item_bulk_api_calls: + _items.append(_item_bulk_api_calls.to_dict()) + _dict['bulk_api_calls'] = _items + # set to None if api_calls (nullable) is None + # and model_fields_set contains the field + if self.api_calls is None and "api_calls" in self.model_fields_set: + _dict['api_calls'] = None + + # set to None if bulk_api_calls (nullable) is None + # and model_fields_set contains the field + if self.bulk_api_calls is None and "bulk_api_calls" in self.model_fields_set: + _dict['bulk_api_calls'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ManagementProjectsUpdateResponseBodyLimits from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "api_calls": [ManagementProjectsUpdateResponseBodyLimitsApiCallsItem.from_dict(_item) for _item in obj["api_calls"]] if obj.get("api_calls") is not None else None, + "bulk_api_calls": [ManagementProjectsUpdateResponseBodyLimitsBulkApiCallsItem.from_dict(_item) for _item in obj["bulk_api_calls"]] if obj.get("bulk_api_calls") is not None else None + }) + return _obj + + diff --git a/voucherify/models/management_projects_update_response_body_limits_api_calls_item.py b/voucherify/models/management_projects_update_response_body_limits_api_calls_item.py new file mode 100644 index 00000000..1cd2fb73 --- /dev/null +++ b/voucherify/models/management_projects_update_response_body_limits_api_calls_item.py @@ -0,0 +1,90 @@ +# coding: utf-8 + +""" + Voucherify API + + Voucherify promotion engine REST API. Please see https://docs.voucherify.io/docs for more details. + + The version of the OpenAPI document: v2018-08-01 + Contact: support@voucherify.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class ManagementProjectsUpdateResponseBodyLimitsApiCallsItem(BaseModel): + """ + Determines the limit of API calls per given unit time. + """ # noqa: E501 + value: Optional[StrictInt] = Field(default=None, description="Determines the maximum number of API calls per time set in `\"duration\"`.") + duration: Optional[StrictStr] = Field(default=None, description="Determines the amount of time during which the calls up to the number specified in the `value` can be made. The duration is presented in the ISO 8601 format, e.g. `PT1H` means one hour.") + __properties: ClassVar[List[str]] = ["value", "duration"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ManagementProjectsUpdateResponseBodyLimitsApiCallsItem from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ManagementProjectsUpdateResponseBodyLimitsApiCallsItem from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "value": obj.get("value"), + "duration": obj.get("duration") + }) + return _obj + + diff --git a/voucherify/models/management_projects_update_response_body_limits_bulk_api_calls_item.py b/voucherify/models/management_projects_update_response_body_limits_bulk_api_calls_item.py new file mode 100644 index 00000000..5c79a1df --- /dev/null +++ b/voucherify/models/management_projects_update_response_body_limits_bulk_api_calls_item.py @@ -0,0 +1,90 @@ +# coding: utf-8 + +""" + Voucherify API + + Voucherify promotion engine REST API. Please see https://docs.voucherify.io/docs for more details. + + The version of the OpenAPI document: v2018-08-01 + Contact: support@voucherify.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class ManagementProjectsUpdateResponseBodyLimitsBulkApiCallsItem(BaseModel): + """ + + """ # noqa: E501 + value: Optional[StrictInt] = Field(default=None, description="Determines the maximum number of API calls per time set in `\"duration\"`.") + duration: Optional[StrictStr] = Field(default=None, description="Determines the amount of time during which the calls up to the number specified in the `value` can be made. The duration is presented in the ISO 8601 format, e.g. `PT1H` means one hour.") + __properties: ClassVar[List[str]] = ["value", "duration"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ManagementProjectsUpdateResponseBodyLimitsBulkApiCallsItem from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ManagementProjectsUpdateResponseBodyLimitsBulkApiCallsItem from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "value": obj.get("value"), + "duration": obj.get("duration") + }) + return _obj + + diff --git a/voucherify/models/management_projects_update_response_body_webhooks_callout_notifications.py b/voucherify/models/management_projects_update_response_body_webhooks_callout_notifications.py new file mode 100644 index 00000000..f1125694 --- /dev/null +++ b/voucherify/models/management_projects_update_response_body_webhooks_callout_notifications.py @@ -0,0 +1,108 @@ +# coding: utf-8 + +""" + Voucherify API + + Voucherify promotion engine REST API. Please see https://docs.voucherify.io/docs for more details. + + The version of the OpenAPI document: v2018-08-01 + Contact: support@voucherify.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict +from typing import Any, ClassVar, Dict, List, Optional +from voucherify.models.management_projects_update_response_body_webhooks_callout_notifications_distributions import ManagementProjectsUpdateResponseBodyWebhooksCalloutNotificationsDistributions +from voucherify.models.management_projects_update_response_body_webhooks_callout_notifications_webhooks import ManagementProjectsUpdateResponseBodyWebhooksCalloutNotificationsWebhooks +from typing import Optional, Set +from typing_extensions import Self + +class ManagementProjectsUpdateResponseBodyWebhooksCalloutNotifications(BaseModel): + """ + Determines the notification settings for webhook callouts configured in Distributions and Project settings. + """ # noqa: E501 + distributions: Optional[ManagementProjectsUpdateResponseBodyWebhooksCalloutNotificationsDistributions] = None + webhooks: Optional[ManagementProjectsUpdateResponseBodyWebhooksCalloutNotificationsWebhooks] = None + __properties: ClassVar[List[str]] = ["distributions", "webhooks"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ManagementProjectsUpdateResponseBodyWebhooksCalloutNotifications from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of distributions + if self.distributions: + _dict['distributions'] = self.distributions.to_dict() + # override the default output from pydantic by calling `to_dict()` of webhooks + if self.webhooks: + _dict['webhooks'] = self.webhooks.to_dict() + # set to None if distributions (nullable) is None + # and model_fields_set contains the field + if self.distributions is None and "distributions" in self.model_fields_set: + _dict['distributions'] = None + + # set to None if webhooks (nullable) is None + # and model_fields_set contains the field + if self.webhooks is None and "webhooks" in self.model_fields_set: + _dict['webhooks'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ManagementProjectsUpdateResponseBodyWebhooksCalloutNotifications from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "distributions": ManagementProjectsUpdateResponseBodyWebhooksCalloutNotificationsDistributions.from_dict(obj["distributions"]) if obj.get("distributions") is not None else None, + "webhooks": ManagementProjectsUpdateResponseBodyWebhooksCalloutNotificationsWebhooks.from_dict(obj["webhooks"]) if obj.get("webhooks") is not None else None + }) + return _obj + + diff --git a/voucherify/models/management_projects_update_response_body_webhooks_callout_notifications_distributions.py b/voucherify/models/management_projects_update_response_body_webhooks_callout_notifications_distributions.py new file mode 100644 index 00000000..ad58de4b --- /dev/null +++ b/voucherify/models/management_projects_update_response_body_webhooks_callout_notifications_distributions.py @@ -0,0 +1,107 @@ +# coding: utf-8 + +""" + Voucherify API + + Voucherify promotion engine REST API. Please see https://docs.voucherify.io/docs for more details. + + The version of the OpenAPI document: v2018-08-01 + Contact: support@voucherify.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class ManagementProjectsUpdateResponseBodyWebhooksCalloutNotificationsDistributions(BaseModel): + """ + Determines the notification settings for webhooks sent through Distributions. + """ # noqa: E501 + email: Optional[StrictBool] = Field(default=None, description="Enables the notification through an email.") + in_app: Optional[StrictBool] = Field(default=None, description="Enables the notification through an email.") + emails: Optional[List[StrictStr]] = Field(default=None, description="An array of email addresses which will receive the notification.") + __properties: ClassVar[List[str]] = ["email", "in_app", "emails"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ManagementProjectsUpdateResponseBodyWebhooksCalloutNotificationsDistributions from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if email (nullable) is None + # and model_fields_set contains the field + if self.email is None and "email" in self.model_fields_set: + _dict['email'] = None + + # set to None if in_app (nullable) is None + # and model_fields_set contains the field + if self.in_app is None and "in_app" in self.model_fields_set: + _dict['in_app'] = None + + # set to None if emails (nullable) is None + # and model_fields_set contains the field + if self.emails is None and "emails" in self.model_fields_set: + _dict['emails'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ManagementProjectsUpdateResponseBodyWebhooksCalloutNotificationsDistributions from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "email": obj.get("email"), + "in_app": obj.get("in_app"), + "emails": obj.get("emails") + }) + return _obj + + diff --git a/voucherify/models/management_projects_update_response_body_webhooks_callout_notifications_webhooks.py b/voucherify/models/management_projects_update_response_body_webhooks_callout_notifications_webhooks.py new file mode 100644 index 00000000..10580f94 --- /dev/null +++ b/voucherify/models/management_projects_update_response_body_webhooks_callout_notifications_webhooks.py @@ -0,0 +1,107 @@ +# coding: utf-8 + +""" + Voucherify API + + Voucherify promotion engine REST API. Please see https://docs.voucherify.io/docs for more details. + + The version of the OpenAPI document: v2018-08-01 + Contact: support@voucherify.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class ManagementProjectsUpdateResponseBodyWebhooksCalloutNotificationsWebhooks(BaseModel): + """ + Determines the notification settings for webhooks sent as set out in the Project settings. + """ # noqa: E501 + email: Optional[StrictBool] = Field(default=None, description="Enables the notification through an email.") + in_app: Optional[StrictBool] = Field(default=None, description="Enables the notification through an email.") + emails: Optional[List[StrictStr]] = Field(default=None, description="An array of email addresses which will receive the notification.") + __properties: ClassVar[List[str]] = ["email", "in_app", "emails"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ManagementProjectsUpdateResponseBodyWebhooksCalloutNotificationsWebhooks from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if email (nullable) is None + # and model_fields_set contains the field + if self.email is None and "email" in self.model_fields_set: + _dict['email'] = None + + # set to None if in_app (nullable) is None + # and model_fields_set contains the field + if self.in_app is None and "in_app" in self.model_fields_set: + _dict['in_app'] = None + + # set to None if emails (nullable) is None + # and model_fields_set contains the field + if self.emails is None and "emails" in self.model_fields_set: + _dict['emails'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ManagementProjectsUpdateResponseBodyWebhooksCalloutNotificationsWebhooks from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "email": obj.get("email"), + "in_app": obj.get("in_app"), + "emails": obj.get("emails") + }) + return _obj + + diff --git a/voucherify/models/management_projects_users_assign_request_body.py b/voucherify/models/management_projects_users_assign_request_body.py new file mode 100644 index 00000000..5890306b --- /dev/null +++ b/voucherify/models/management_projects_users_assign_request_body.py @@ -0,0 +1,107 @@ +# coding: utf-8 + +""" + Voucherify API + + Voucherify promotion engine REST API. Please see https://docs.voucherify.io/docs for more details. + + The version of the OpenAPI document: v2018-08-01 + Contact: support@voucherify.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class ManagementProjectsUsersAssignRequestBody(BaseModel): + """ + ManagementProjectsUsersAssignRequestBody + """ # noqa: E501 + id: Optional[StrictStr] = Field(default=None, description="The unique identifier of the user who will be assigned to the project. It can be found in Team Settings > Team > Edit member. **Required** with the `role` string. Do **not** use with the `login` string.") + login: Optional[StrictStr] = Field(default=None, description="The login data of the user who will be assigned to the project. **Required** with the `role` string. Do **not** use with the `id` string.") + role: Optional[StrictStr] = Field(default=None, description="The role of the user to be added. It can be one of the following predefined roles: `ADMIN`, `USER`, `VIEWER`, `MERCHANT`, or an ID of a custom role.") + __properties: ClassVar[List[str]] = ["id", "login", "role"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ManagementProjectsUsersAssignRequestBody from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if id (nullable) is None + # and model_fields_set contains the field + if self.id is None and "id" in self.model_fields_set: + _dict['id'] = None + + # set to None if login (nullable) is None + # and model_fields_set contains the field + if self.login is None and "login" in self.model_fields_set: + _dict['login'] = None + + # set to None if role (nullable) is None + # and model_fields_set contains the field + if self.role is None and "role" in self.model_fields_set: + _dict['role'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ManagementProjectsUsersAssignRequestBody from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id"), + "login": obj.get("login"), + "role": obj.get("role") + }) + return _obj + + diff --git a/voucherify/models/management_projects_users_assign_response_body.py b/voucherify/models/management_projects_users_assign_response_body.py new file mode 100644 index 00000000..098eadf4 --- /dev/null +++ b/voucherify/models/management_projects_users_assign_response_body.py @@ -0,0 +1,135 @@ +# coding: utf-8 + +""" + Voucherify API + + Voucherify promotion engine REST API. Please see https://docs.voucherify.io/docs for more details. + + The version of the OpenAPI document: v2018-08-01 + Contact: support@voucherify.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class ManagementProjectsUsersAssignResponseBody(BaseModel): + """ + Details about the user assigned to the project. + """ # noqa: E501 + id: Optional[StrictStr] = Field(default=None, description="The unique identifier of the user who has been assigned to the project.") + login: Optional[StrictStr] = Field(default=None, description="The login data of the user who has been assigned to the project.") + email: Optional[StrictStr] = Field(default=None, description="The email address of the user who has been assigned to the project.") + first_name: Optional[StrictStr] = Field(default=None, description="The first name of the user who has been assigned to the project.") + last_name: Optional[StrictStr] = Field(default=None, description="The last name of the user who has been assigned to the project.") + projects: Optional[Dict[str, Any]] = Field(default=None, description="Lists key-value pairs, where the key is the project to which the user is assigned. The value is the role assigned in a given project. The predefined Voucherify roles are: `ADMIN`, `USER`, `VIEWER`, `MERCHANT`, `USER_RESTRICTED` (for the Areas and Stores, an Enterprise feature).") + is_owner: Optional[StrictBool] = Field(default=None, description="Determines if the user is the owner for the organization in Voucherify.") + __properties: ClassVar[List[str]] = ["id", "login", "email", "first_name", "last_name", "projects", "is_owner"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ManagementProjectsUsersAssignResponseBody from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if id (nullable) is None + # and model_fields_set contains the field + if self.id is None and "id" in self.model_fields_set: + _dict['id'] = None + + # set to None if login (nullable) is None + # and model_fields_set contains the field + if self.login is None and "login" in self.model_fields_set: + _dict['login'] = None + + # set to None if email (nullable) is None + # and model_fields_set contains the field + if self.email is None and "email" in self.model_fields_set: + _dict['email'] = None + + # set to None if first_name (nullable) is None + # and model_fields_set contains the field + if self.first_name is None and "first_name" in self.model_fields_set: + _dict['first_name'] = None + + # set to None if last_name (nullable) is None + # and model_fields_set contains the field + if self.last_name is None and "last_name" in self.model_fields_set: + _dict['last_name'] = None + + # set to None if projects (nullable) is None + # and model_fields_set contains the field + if self.projects is None and "projects" in self.model_fields_set: + _dict['projects'] = None + + # set to None if is_owner (nullable) is None + # and model_fields_set contains the field + if self.is_owner is None and "is_owner" in self.model_fields_set: + _dict['is_owner'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ManagementProjectsUsersAssignResponseBody from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id"), + "login": obj.get("login"), + "email": obj.get("email"), + "first_name": obj.get("first_name"), + "last_name": obj.get("last_name"), + "projects": obj.get("projects"), + "is_owner": obj.get("is_owner") + }) + return _obj + + diff --git a/voucherify/models/management_projects_users_get_user_response_body.py b/voucherify/models/management_projects_users_get_user_response_body.py new file mode 100644 index 00000000..57f4c5fe --- /dev/null +++ b/voucherify/models/management_projects_users_get_user_response_body.py @@ -0,0 +1,135 @@ +# coding: utf-8 + +""" + Voucherify API + + Voucherify promotion engine REST API. Please see https://docs.voucherify.io/docs for more details. + + The version of the OpenAPI document: v2018-08-01 + Contact: support@voucherify.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class ManagementProjectsUsersGetUserResponseBody(BaseModel): + """ + Details about the user assigned to the project. + """ # noqa: E501 + id: Optional[StrictStr] = Field(default=None, description="The unique identifier of the user who has been assigned to the project.") + login: Optional[StrictStr] = Field(default=None, description="The login data of the user who has been assigned to the project.") + email: Optional[StrictStr] = Field(default=None, description="The email address of the user who has been assigned to the project.") + first_name: Optional[StrictStr] = Field(default=None, description="The first name of the user who has been assigned to the project.") + last_name: Optional[StrictStr] = Field(default=None, description="The last name of the user who has been assigned to the project.") + projects: Optional[Dict[str, Any]] = Field(default=None, description="Lists key-value pairs, where the key is the project to which the user is assigned. The value is the role assigned in a given project. The predefined Voucherify roles are: `ADMIN`, `USER`, `VIEWER`, `MERCHANT`, `USER_RESTRICTED` (for the Areas and Stores, an Enterprise feature).") + is_owner: Optional[StrictBool] = Field(default=None, description="Determines if the user is the owner for the organization in Voucherify.") + __properties: ClassVar[List[str]] = ["id", "login", "email", "first_name", "last_name", "projects", "is_owner"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ManagementProjectsUsersGetUserResponseBody from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if id (nullable) is None + # and model_fields_set contains the field + if self.id is None and "id" in self.model_fields_set: + _dict['id'] = None + + # set to None if login (nullable) is None + # and model_fields_set contains the field + if self.login is None and "login" in self.model_fields_set: + _dict['login'] = None + + # set to None if email (nullable) is None + # and model_fields_set contains the field + if self.email is None and "email" in self.model_fields_set: + _dict['email'] = None + + # set to None if first_name (nullable) is None + # and model_fields_set contains the field + if self.first_name is None and "first_name" in self.model_fields_set: + _dict['first_name'] = None + + # set to None if last_name (nullable) is None + # and model_fields_set contains the field + if self.last_name is None and "last_name" in self.model_fields_set: + _dict['last_name'] = None + + # set to None if projects (nullable) is None + # and model_fields_set contains the field + if self.projects is None and "projects" in self.model_fields_set: + _dict['projects'] = None + + # set to None if is_owner (nullable) is None + # and model_fields_set contains the field + if self.is_owner is None and "is_owner" in self.model_fields_set: + _dict['is_owner'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ManagementProjectsUsersGetUserResponseBody from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id"), + "login": obj.get("login"), + "email": obj.get("email"), + "first_name": obj.get("first_name"), + "last_name": obj.get("last_name"), + "projects": obj.get("projects"), + "is_owner": obj.get("is_owner") + }) + return _obj + + diff --git a/voucherify/models/management_projects_users_invite_create_request_body.py b/voucherify/models/management_projects_users_invite_create_request_body.py new file mode 100644 index 00000000..b9f26260 --- /dev/null +++ b/voucherify/models/management_projects_users_invite_create_request_body.py @@ -0,0 +1,114 @@ +# coding: utf-8 + +""" + Voucherify API + + Voucherify promotion engine REST API. Please see https://docs.voucherify.io/docs for more details. + + The version of the OpenAPI document: v2018-08-01 + Contact: support@voucherify.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class ManagementProjectsUsersInviteCreateRequestBody(BaseModel): + """ + Request body schema for **POST** `v1/management/v1/projects/users/invite`. + """ # noqa: E501 + email: Optional[StrictStr] = Field(default=None, description="Email address to which the invitation will be sent. Must be a valid email address.") + first_name: Optional[StrictStr] = Field(default=None, description="First name of the person who will receive the invitation. The name will be used in the user profile.") + last_name: Optional[StrictStr] = Field(default=None, description="Last name of the person who will receive the invitation. The name will be used in the user profile.") + projects: Optional[Dict[str, Any]] = Field(default=None, description="In the key, provide the project ID to which the new user will be assigned. In the value, provide the role which the user will have in the project. The predefined Voucherify roles are: `ADMIN`, `USER`, `VIEWER`, `MERCHANT`, `USER_RESTRICTED` (for the Areas and Stores, an Enterprise feature). Send a custom role ID (Enterprise feature) to assign a custom role.") + __properties: ClassVar[List[str]] = ["email", "first_name", "last_name", "projects"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ManagementProjectsUsersInviteCreateRequestBody from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if email (nullable) is None + # and model_fields_set contains the field + if self.email is None and "email" in self.model_fields_set: + _dict['email'] = None + + # set to None if first_name (nullable) is None + # and model_fields_set contains the field + if self.first_name is None and "first_name" in self.model_fields_set: + _dict['first_name'] = None + + # set to None if last_name (nullable) is None + # and model_fields_set contains the field + if self.last_name is None and "last_name" in self.model_fields_set: + _dict['last_name'] = None + + # set to None if projects (nullable) is None + # and model_fields_set contains the field + if self.projects is None and "projects" in self.model_fields_set: + _dict['projects'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ManagementProjectsUsersInviteCreateRequestBody from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "email": obj.get("email"), + "first_name": obj.get("first_name"), + "last_name": obj.get("last_name"), + "projects": obj.get("projects") + }) + return _obj + + diff --git a/voucherify/models/management_projects_users_list_response_body.py b/voucherify/models/management_projects_users_list_response_body.py new file mode 100644 index 00000000..f232ea87 --- /dev/null +++ b/voucherify/models/management_projects_users_list_response_body.py @@ -0,0 +1,142 @@ +# coding: utf-8 + +""" + Voucherify API + + Voucherify promotion engine REST API. Please see https://docs.voucherify.io/docs for more details. + + The version of the OpenAPI document: v2018-08-01 + Contact: support@voucherify.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from voucherify.models.user import User +from typing import Optional, Set +from typing_extensions import Self + +class ManagementProjectsUsersListResponseBody(BaseModel): + """ + Object containing a list of users assigned to the project. + """ # noqa: E501 + object: Optional[StrictStr] = Field(default='list', description="The type of the object represented by JSON. This object stores information about the users in a dictionary.") + data_ref: Optional[StrictStr] = Field(default='data', description="Identifies the name of the attribute that contains the array of user objects.") + data: Optional[List[User]] = Field(default=None, description="Array of user objects.") + total: Optional[StrictInt] = Field(default=None, description="The total number of users.") + __properties: ClassVar[List[str]] = ["object", "data_ref", "data", "total"] + + @field_validator('object') + def object_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['list']): + raise ValueError("must be one of enum values ('list')") + return value + + @field_validator('data_ref') + def data_ref_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['data']): + raise ValueError("must be one of enum values ('data')") + return value + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ManagementProjectsUsersListResponseBody from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in data (list) + _items = [] + if self.data: + for _item_data in self.data: + if _item_data: + _items.append(_item_data.to_dict()) + _dict['data'] = _items + # set to None if object (nullable) is None + # and model_fields_set contains the field + if self.object is None and "object" in self.model_fields_set: + _dict['object'] = None + + # set to None if data_ref (nullable) is None + # and model_fields_set contains the field + if self.data_ref is None and "data_ref" in self.model_fields_set: + _dict['data_ref'] = None + + # set to None if data (nullable) is None + # and model_fields_set contains the field + if self.data is None and "data" in self.model_fields_set: + _dict['data'] = None + + # set to None if total (nullable) is None + # and model_fields_set contains the field + if self.total is None and "total" in self.model_fields_set: + _dict['total'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ManagementProjectsUsersListResponseBody from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "object": obj.get("object") if obj.get("object") is not None else 'list', + "data_ref": obj.get("data_ref") if obj.get("data_ref") is not None else 'data', + "data": [User.from_dict(_item) for _item in obj["data"]] if obj.get("data") is not None else None, + "total": obj.get("total") + }) + return _obj + + diff --git a/voucherify/models/management_projects_users_update_role_request_body.py b/voucherify/models/management_projects_users_update_role_request_body.py new file mode 100644 index 00000000..d40750bd --- /dev/null +++ b/voucherify/models/management_projects_users_update_role_request_body.py @@ -0,0 +1,93 @@ +# coding: utf-8 + +""" + Voucherify API + + Voucherify promotion engine REST API. Please see https://docs.voucherify.io/docs for more details. + + The version of the OpenAPI document: v2018-08-01 + Contact: support@voucherify.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class ManagementProjectsUsersUpdateRoleRequestBody(BaseModel): + """ + ManagementProjectsUsersUpdateRoleRequestBody + """ # noqa: E501 + role: Optional[StrictStr] = Field(default=None, description="The role of the user to be added. It can be a custom role or one of following predefined roles: `ADMIN`, `USER`, `VIEWER`, `MERCHANT` or an ID of a custom role..") + __properties: ClassVar[List[str]] = ["role"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ManagementProjectsUsersUpdateRoleRequestBody from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if role (nullable) is None + # and model_fields_set contains the field + if self.role is None and "role" in self.model_fields_set: + _dict['role'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ManagementProjectsUsersUpdateRoleRequestBody from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "role": obj.get("role") + }) + return _obj + + diff --git a/voucherify/models/management_projects_users_update_role_response_body.py b/voucherify/models/management_projects_users_update_role_response_body.py new file mode 100644 index 00000000..b157b137 --- /dev/null +++ b/voucherify/models/management_projects_users_update_role_response_body.py @@ -0,0 +1,135 @@ +# coding: utf-8 + +""" + Voucherify API + + Voucherify promotion engine REST API. Please see https://docs.voucherify.io/docs for more details. + + The version of the OpenAPI document: v2018-08-01 + Contact: support@voucherify.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class ManagementProjectsUsersUpdateRoleResponseBody(BaseModel): + """ + Details about the user assigned to the project. + """ # noqa: E501 + id: Optional[StrictStr] = Field(default=None, description="The unique identifier of the user who has been assigned to the project.") + login: Optional[StrictStr] = Field(default=None, description="The login data of the user who has been assigned to the project.") + email: Optional[StrictStr] = Field(default=None, description="The email address of the user who has been assigned to the project.") + first_name: Optional[StrictStr] = Field(default=None, description="The first name of the user who has been assigned to the project.") + last_name: Optional[StrictStr] = Field(default=None, description="The last name of the user who has been assigned to the project.") + projects: Optional[Dict[str, Any]] = Field(default=None, description="Lists key-value pairs, where the key is the project to which the user is assigned. The value is the role assigned in a given project. The predefined Voucherify roles are: `ADMIN`, `USER`, `VIEWER`, `MERCHANT`, `USER_RESTRICTED` (for the Areas and Stores, an Enterprise feature).") + is_owner: Optional[StrictBool] = Field(default=None, description="Determines if the user is the owner for the organization in Voucherify.") + __properties: ClassVar[List[str]] = ["id", "login", "email", "first_name", "last_name", "projects", "is_owner"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ManagementProjectsUsersUpdateRoleResponseBody from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if id (nullable) is None + # and model_fields_set contains the field + if self.id is None and "id" in self.model_fields_set: + _dict['id'] = None + + # set to None if login (nullable) is None + # and model_fields_set contains the field + if self.login is None and "login" in self.model_fields_set: + _dict['login'] = None + + # set to None if email (nullable) is None + # and model_fields_set contains the field + if self.email is None and "email" in self.model_fields_set: + _dict['email'] = None + + # set to None if first_name (nullable) is None + # and model_fields_set contains the field + if self.first_name is None and "first_name" in self.model_fields_set: + _dict['first_name'] = None + + # set to None if last_name (nullable) is None + # and model_fields_set contains the field + if self.last_name is None and "last_name" in self.model_fields_set: + _dict['last_name'] = None + + # set to None if projects (nullable) is None + # and model_fields_set contains the field + if self.projects is None and "projects" in self.model_fields_set: + _dict['projects'] = None + + # set to None if is_owner (nullable) is None + # and model_fields_set contains the field + if self.is_owner is None and "is_owner" in self.model_fields_set: + _dict['is_owner'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ManagementProjectsUsersUpdateRoleResponseBody from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id"), + "login": obj.get("login"), + "email": obj.get("email"), + "first_name": obj.get("first_name"), + "last_name": obj.get("last_name"), + "projects": obj.get("projects"), + "is_owner": obj.get("is_owner") + }) + return _obj + + diff --git a/voucherify/models/management_projects_webhook.py b/voucherify/models/management_projects_webhook.py new file mode 100644 index 00000000..834e8e3d --- /dev/null +++ b/voucherify/models/management_projects_webhook.py @@ -0,0 +1,150 @@ +# coding: utf-8 + +""" + Voucherify API + + Voucherify promotion engine REST API. Please see https://docs.voucherify.io/docs for more details. + + The version of the OpenAPI document: v2018-08-01 + Contact: support@voucherify.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class ManagementProjectsWebhook(BaseModel): + """ + Response body schema for webhook endpoints. + """ # noqa: E501 + id: Optional[StrictStr] = Field(default=None, description="Unique identifier of the webhook.") + object: Optional[StrictStr] = Field(default='webhook', description="The type of the object represented by JSON.") + created_at: Optional[datetime] = Field(default=None, description="Timestamp representing the date and time when the webhook configuration was created. The value for this parameter is shown in the ISO 8601 format.") + target_url: Optional[StrictStr] = Field(default=None, description="URL address that receives webhooks.") + events: Optional[List[StrictStr]] = Field(default=None, description="Lists the events that trigger webhook sendout.") + active: Optional[StrictBool] = Field(default=True, description="Determines if the webhook configuration is active.") + __properties: ClassVar[List[str]] = ["id", "object", "created_at", "target_url", "events", "active"] + + @field_validator('object') + def object_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['webhook']): + raise ValueError("must be one of enum values ('webhook')") + return value + + @field_validator('events') + def events_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + for i in value: + if i not in set(['redemption.succeeded', 'redemption.failed', 'redemption.rollback.succeeded', 'redemption.rollback.failed', 'publication.succeeded', 'voucher.published', 'voucher.updated', 'voucher.deleted', 'voucher.created', 'voucher.enabled', 'voucher.disabled', 'voucher.loyalty_card.points_added', 'voucher.gift.balance_added', 'campaign.enabled', 'campaign.deleted', 'campaign.created', 'campaign.updated', 'campaign.disabled', 'campaign.vouchers.generation.completed', 'business_validation_rule.assignment.created', 'business_validation_rule.assignment.deleted', 'business_validation_rule.created', 'business_validation_rule.deleted', 'business_validation_rule.updated', 'customer.created', 'customer.deleted', 'customer.rewarded', 'customer.rewarded.loyalty_points']): + raise ValueError("each list item must be one of ('redemption.succeeded', 'redemption.failed', 'redemption.rollback.succeeded', 'redemption.rollback.failed', 'publication.succeeded', 'voucher.published', 'voucher.updated', 'voucher.deleted', 'voucher.created', 'voucher.enabled', 'voucher.disabled', 'voucher.loyalty_card.points_added', 'voucher.gift.balance_added', 'campaign.enabled', 'campaign.deleted', 'campaign.created', 'campaign.updated', 'campaign.disabled', 'campaign.vouchers.generation.completed', 'business_validation_rule.assignment.created', 'business_validation_rule.assignment.deleted', 'business_validation_rule.created', 'business_validation_rule.deleted', 'business_validation_rule.updated', 'customer.created', 'customer.deleted', 'customer.rewarded', 'customer.rewarded.loyalty_points')") + return value + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ManagementProjectsWebhook from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if id (nullable) is None + # and model_fields_set contains the field + if self.id is None and "id" in self.model_fields_set: + _dict['id'] = None + + # set to None if object (nullable) is None + # and model_fields_set contains the field + if self.object is None and "object" in self.model_fields_set: + _dict['object'] = None + + # set to None if created_at (nullable) is None + # and model_fields_set contains the field + if self.created_at is None and "created_at" in self.model_fields_set: + _dict['created_at'] = None + + # set to None if target_url (nullable) is None + # and model_fields_set contains the field + if self.target_url is None and "target_url" in self.model_fields_set: + _dict['target_url'] = None + + # set to None if events (nullable) is None + # and model_fields_set contains the field + if self.events is None and "events" in self.model_fields_set: + _dict['events'] = None + + # set to None if active (nullable) is None + # and model_fields_set contains the field + if self.active is None and "active" in self.model_fields_set: + _dict['active'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ManagementProjectsWebhook from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id"), + "object": obj.get("object") if obj.get("object") is not None else 'webhook', + "created_at": obj.get("created_at"), + "target_url": obj.get("target_url"), + "events": obj.get("events"), + "active": obj.get("active") if obj.get("active") is not None else True + }) + return _obj + + diff --git a/voucherify/models/management_projects_webhooks_create_request_body.py b/voucherify/models/management_projects_webhooks_create_request_body.py new file mode 100644 index 00000000..bd77974c --- /dev/null +++ b/voucherify/models/management_projects_webhooks_create_request_body.py @@ -0,0 +1,118 @@ +# coding: utf-8 + +""" + Voucherify API + + Voucherify promotion engine REST API. Please see https://docs.voucherify.io/docs for more details. + + The version of the OpenAPI document: v2018-08-01 + Contact: support@voucherify.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class ManagementProjectsWebhooksCreateRequestBody(BaseModel): + """ + Request body schema for **POST** `v1/management/v1/projects/{projectId}/webhooks/{webhookId}`. + """ # noqa: E501 + target_url: Optional[StrictStr] = Field(default=None, description="URL address that receives webhooks.") + events: Optional[List[StrictStr]] = Field(default=None, description="Lists the events that trigger webhook sendout.") + active: Optional[StrictBool] = Field(default=True, description="Determines if the webhook configuration is active.") + __properties: ClassVar[List[str]] = ["target_url", "events", "active"] + + @field_validator('events') + def events_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + for i in value: + if i not in set(['redemption.succeeded', 'redemption.failed', 'redemption.rollback.succeeded', 'redemption.rollback.failed', 'publication.succeeded', 'voucher.published', 'voucher.updated', 'voucher.deleted', 'voucher.created', 'voucher.enabled', 'voucher.disabled', 'voucher.loyalty_card.points_added', 'voucher.gift.balance_added', 'campaign.enabled', 'campaign.deleted', 'campaign.created', 'campaign.updated', 'campaign.disabled', 'campaign.vouchers.generation.completed', 'business_validation_rule.assignment.created', 'business_validation_rule.assignment.deleted', 'business_validation_rule.created', 'business_validation_rule.deleted', 'business_validation_rule.updated', 'customer.created', 'customer.deleted', 'customer.rewarded', 'customer.rewarded.loyalty_points']): + raise ValueError("each list item must be one of ('redemption.succeeded', 'redemption.failed', 'redemption.rollback.succeeded', 'redemption.rollback.failed', 'publication.succeeded', 'voucher.published', 'voucher.updated', 'voucher.deleted', 'voucher.created', 'voucher.enabled', 'voucher.disabled', 'voucher.loyalty_card.points_added', 'voucher.gift.balance_added', 'campaign.enabled', 'campaign.deleted', 'campaign.created', 'campaign.updated', 'campaign.disabled', 'campaign.vouchers.generation.completed', 'business_validation_rule.assignment.created', 'business_validation_rule.assignment.deleted', 'business_validation_rule.created', 'business_validation_rule.deleted', 'business_validation_rule.updated', 'customer.created', 'customer.deleted', 'customer.rewarded', 'customer.rewarded.loyalty_points')") + return value + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ManagementProjectsWebhooksCreateRequestBody from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if target_url (nullable) is None + # and model_fields_set contains the field + if self.target_url is None and "target_url" in self.model_fields_set: + _dict['target_url'] = None + + # set to None if events (nullable) is None + # and model_fields_set contains the field + if self.events is None and "events" in self.model_fields_set: + _dict['events'] = None + + # set to None if active (nullable) is None + # and model_fields_set contains the field + if self.active is None and "active" in self.model_fields_set: + _dict['active'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ManagementProjectsWebhooksCreateRequestBody from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "target_url": obj.get("target_url"), + "events": obj.get("events"), + "active": obj.get("active") if obj.get("active") is not None else True + }) + return _obj + + diff --git a/voucherify/models/management_projects_webhooks_create_response_body.py b/voucherify/models/management_projects_webhooks_create_response_body.py new file mode 100644 index 00000000..cb4ac2d6 --- /dev/null +++ b/voucherify/models/management_projects_webhooks_create_response_body.py @@ -0,0 +1,150 @@ +# coding: utf-8 + +""" + Voucherify API + + Voucherify promotion engine REST API. Please see https://docs.voucherify.io/docs for more details. + + The version of the OpenAPI document: v2018-08-01 + Contact: support@voucherify.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class ManagementProjectsWebhooksCreateResponseBody(BaseModel): + """ + Response body schema for **POST** `v1/management/v1/projects/{projectId}/webhooks`. + """ # noqa: E501 + id: Optional[StrictStr] = Field(default=None, description="Unique identifier of the webhook.") + object: Optional[StrictStr] = Field(default='webhook', description="The type of the object represented by JSON.") + created_at: Optional[datetime] = Field(default=None, description="Timestamp representing the date and time when the webhook configuration was created. The value for this parameter is shown in the ISO 8601 format.") + target_url: Optional[StrictStr] = Field(default=None, description="URL address that receives webhooks.") + events: Optional[List[StrictStr]] = Field(default=None, description="Lists the events that trigger webhook sendout.") + active: Optional[StrictBool] = Field(default=True, description="Determines if the webhook configuration is active.") + __properties: ClassVar[List[str]] = ["id", "object", "created_at", "target_url", "events", "active"] + + @field_validator('object') + def object_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['webhook']): + raise ValueError("must be one of enum values ('webhook')") + return value + + @field_validator('events') + def events_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + for i in value: + if i not in set(['redemption.succeeded', 'redemption.failed', 'redemption.rollback.succeeded', 'redemption.rollback.failed', 'publication.succeeded', 'voucher.published', 'voucher.updated', 'voucher.deleted', 'voucher.created', 'voucher.enabled', 'voucher.disabled', 'voucher.loyalty_card.points_added', 'voucher.gift.balance_added', 'campaign.enabled', 'campaign.deleted', 'campaign.created', 'campaign.updated', 'campaign.disabled', 'campaign.vouchers.generation.completed', 'business_validation_rule.assignment.created', 'business_validation_rule.assignment.deleted', 'business_validation_rule.created', 'business_validation_rule.deleted', 'business_validation_rule.updated', 'customer.created', 'customer.deleted', 'customer.rewarded', 'customer.rewarded.loyalty_points']): + raise ValueError("each list item must be one of ('redemption.succeeded', 'redemption.failed', 'redemption.rollback.succeeded', 'redemption.rollback.failed', 'publication.succeeded', 'voucher.published', 'voucher.updated', 'voucher.deleted', 'voucher.created', 'voucher.enabled', 'voucher.disabled', 'voucher.loyalty_card.points_added', 'voucher.gift.balance_added', 'campaign.enabled', 'campaign.deleted', 'campaign.created', 'campaign.updated', 'campaign.disabled', 'campaign.vouchers.generation.completed', 'business_validation_rule.assignment.created', 'business_validation_rule.assignment.deleted', 'business_validation_rule.created', 'business_validation_rule.deleted', 'business_validation_rule.updated', 'customer.created', 'customer.deleted', 'customer.rewarded', 'customer.rewarded.loyalty_points')") + return value + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ManagementProjectsWebhooksCreateResponseBody from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if id (nullable) is None + # and model_fields_set contains the field + if self.id is None and "id" in self.model_fields_set: + _dict['id'] = None + + # set to None if object (nullable) is None + # and model_fields_set contains the field + if self.object is None and "object" in self.model_fields_set: + _dict['object'] = None + + # set to None if created_at (nullable) is None + # and model_fields_set contains the field + if self.created_at is None and "created_at" in self.model_fields_set: + _dict['created_at'] = None + + # set to None if target_url (nullable) is None + # and model_fields_set contains the field + if self.target_url is None and "target_url" in self.model_fields_set: + _dict['target_url'] = None + + # set to None if events (nullable) is None + # and model_fields_set contains the field + if self.events is None and "events" in self.model_fields_set: + _dict['events'] = None + + # set to None if active (nullable) is None + # and model_fields_set contains the field + if self.active is None and "active" in self.model_fields_set: + _dict['active'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ManagementProjectsWebhooksCreateResponseBody from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id"), + "object": obj.get("object") if obj.get("object") is not None else 'webhook', + "created_at": obj.get("created_at"), + "target_url": obj.get("target_url"), + "events": obj.get("events"), + "active": obj.get("active") if obj.get("active") is not None else True + }) + return _obj + + diff --git a/voucherify/models/management_projects_webhooks_get_response_body.py b/voucherify/models/management_projects_webhooks_get_response_body.py new file mode 100644 index 00000000..4d229c95 --- /dev/null +++ b/voucherify/models/management_projects_webhooks_get_response_body.py @@ -0,0 +1,150 @@ +# coding: utf-8 + +""" + Voucherify API + + Voucherify promotion engine REST API. Please see https://docs.voucherify.io/docs for more details. + + The version of the OpenAPI document: v2018-08-01 + Contact: support@voucherify.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class ManagementProjectsWebhooksGetResponseBody(BaseModel): + """ + Response body schema for **GET** `v1/management/v1/projects/{projectId}/webhooks/{webhookId}`. + """ # noqa: E501 + id: Optional[StrictStr] = Field(default=None, description="Unique identifier of the webhook.") + object: Optional[StrictStr] = Field(default='webhook', description="The type of the object represented by JSON.") + created_at: Optional[datetime] = Field(default=None, description="Timestamp representing the date and time when the webhook configuration was created. The value for this parameter is shown in the ISO 8601 format.") + target_url: Optional[StrictStr] = Field(default=None, description="URL address that receives webhooks.") + events: Optional[List[StrictStr]] = Field(default=None, description="Lists the events that trigger webhook sendout.") + active: Optional[StrictBool] = Field(default=True, description="Determines if the webhook configuration is active.") + __properties: ClassVar[List[str]] = ["id", "object", "created_at", "target_url", "events", "active"] + + @field_validator('object') + def object_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['webhook']): + raise ValueError("must be one of enum values ('webhook')") + return value + + @field_validator('events') + def events_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + for i in value: + if i not in set(['redemption.succeeded', 'redemption.failed', 'redemption.rollback.succeeded', 'redemption.rollback.failed', 'publication.succeeded', 'voucher.published', 'voucher.updated', 'voucher.deleted', 'voucher.created', 'voucher.enabled', 'voucher.disabled', 'voucher.loyalty_card.points_added', 'voucher.gift.balance_added', 'campaign.enabled', 'campaign.deleted', 'campaign.created', 'campaign.updated', 'campaign.disabled', 'campaign.vouchers.generation.completed', 'business_validation_rule.assignment.created', 'business_validation_rule.assignment.deleted', 'business_validation_rule.created', 'business_validation_rule.deleted', 'business_validation_rule.updated', 'customer.created', 'customer.deleted', 'customer.rewarded', 'customer.rewarded.loyalty_points']): + raise ValueError("each list item must be one of ('redemption.succeeded', 'redemption.failed', 'redemption.rollback.succeeded', 'redemption.rollback.failed', 'publication.succeeded', 'voucher.published', 'voucher.updated', 'voucher.deleted', 'voucher.created', 'voucher.enabled', 'voucher.disabled', 'voucher.loyalty_card.points_added', 'voucher.gift.balance_added', 'campaign.enabled', 'campaign.deleted', 'campaign.created', 'campaign.updated', 'campaign.disabled', 'campaign.vouchers.generation.completed', 'business_validation_rule.assignment.created', 'business_validation_rule.assignment.deleted', 'business_validation_rule.created', 'business_validation_rule.deleted', 'business_validation_rule.updated', 'customer.created', 'customer.deleted', 'customer.rewarded', 'customer.rewarded.loyalty_points')") + return value + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ManagementProjectsWebhooksGetResponseBody from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if id (nullable) is None + # and model_fields_set contains the field + if self.id is None and "id" in self.model_fields_set: + _dict['id'] = None + + # set to None if object (nullable) is None + # and model_fields_set contains the field + if self.object is None and "object" in self.model_fields_set: + _dict['object'] = None + + # set to None if created_at (nullable) is None + # and model_fields_set contains the field + if self.created_at is None and "created_at" in self.model_fields_set: + _dict['created_at'] = None + + # set to None if target_url (nullable) is None + # and model_fields_set contains the field + if self.target_url is None and "target_url" in self.model_fields_set: + _dict['target_url'] = None + + # set to None if events (nullable) is None + # and model_fields_set contains the field + if self.events is None and "events" in self.model_fields_set: + _dict['events'] = None + + # set to None if active (nullable) is None + # and model_fields_set contains the field + if self.active is None and "active" in self.model_fields_set: + _dict['active'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ManagementProjectsWebhooksGetResponseBody from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id"), + "object": obj.get("object") if obj.get("object") is not None else 'webhook', + "created_at": obj.get("created_at"), + "target_url": obj.get("target_url"), + "events": obj.get("events"), + "active": obj.get("active") if obj.get("active") is not None else True + }) + return _obj + + diff --git a/voucherify/models/management_projects_webhooks_list_response_body.py b/voucherify/models/management_projects_webhooks_list_response_body.py new file mode 100644 index 00000000..fb30bc26 --- /dev/null +++ b/voucherify/models/management_projects_webhooks_list_response_body.py @@ -0,0 +1,142 @@ +# coding: utf-8 + +""" + Voucherify API + + Voucherify promotion engine REST API. Please see https://docs.voucherify.io/docs for more details. + + The version of the OpenAPI document: v2018-08-01 + Contact: support@voucherify.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from voucherify.models.management_projects_webhook import ManagementProjectsWebhook +from typing import Optional, Set +from typing_extensions import Self + +class ManagementProjectsWebhooksListResponseBody(BaseModel): + """ + Object containing a list of webhook configurations. + """ # noqa: E501 + object: Optional[StrictStr] = Field(default='list', description="The type of the object represented by JSON. This object stores information about the webhook configurations in a dictionary.") + data_ref: Optional[StrictStr] = Field(default='data', description="Identifies the name of the attribute that contains the array of webhook objects.") + data: Optional[List[ManagementProjectsWebhook]] = Field(default=None, description="Array of webhook objects.") + total: Optional[StrictInt] = Field(default=None, description="The total number of webhook objects.") + __properties: ClassVar[List[str]] = ["object", "data_ref", "data", "total"] + + @field_validator('object') + def object_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['list']): + raise ValueError("must be one of enum values ('list')") + return value + + @field_validator('data_ref') + def data_ref_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['data']): + raise ValueError("must be one of enum values ('data')") + return value + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ManagementProjectsWebhooksListResponseBody from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in data (list) + _items = [] + if self.data: + for _item_data in self.data: + if _item_data: + _items.append(_item_data.to_dict()) + _dict['data'] = _items + # set to None if object (nullable) is None + # and model_fields_set contains the field + if self.object is None and "object" in self.model_fields_set: + _dict['object'] = None + + # set to None if data_ref (nullable) is None + # and model_fields_set contains the field + if self.data_ref is None and "data_ref" in self.model_fields_set: + _dict['data_ref'] = None + + # set to None if data (nullable) is None + # and model_fields_set contains the field + if self.data is None and "data" in self.model_fields_set: + _dict['data'] = None + + # set to None if total (nullable) is None + # and model_fields_set contains the field + if self.total is None and "total" in self.model_fields_set: + _dict['total'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ManagementProjectsWebhooksListResponseBody from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "object": obj.get("object") if obj.get("object") is not None else 'list', + "data_ref": obj.get("data_ref") if obj.get("data_ref") is not None else 'data', + "data": [ManagementProjectsWebhook.from_dict(_item) for _item in obj["data"]] if obj.get("data") is not None else None, + "total": obj.get("total") + }) + return _obj + + diff --git a/voucherify/models/management_projects_webhooks_update_request_body.py b/voucherify/models/management_projects_webhooks_update_request_body.py new file mode 100644 index 00000000..f532c593 --- /dev/null +++ b/voucherify/models/management_projects_webhooks_update_request_body.py @@ -0,0 +1,118 @@ +# coding: utf-8 + +""" + Voucherify API + + Voucherify promotion engine REST API. Please see https://docs.voucherify.io/docs for more details. + + The version of the OpenAPI document: v2018-08-01 + Contact: support@voucherify.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class ManagementProjectsWebhooksUpdateRequestBody(BaseModel): + """ + Request body schema for **PUT** `v1/management/v1/projects/{projectId}/webhooks`. + """ # noqa: E501 + target_url: Optional[StrictStr] = Field(default=None, description="URL address that receives webhooks.") + events: Optional[List[StrictStr]] = Field(default=None, description="Lists the events that trigger webhook sendout.") + active: Optional[StrictBool] = Field(default=True, description="Determines if the webhook configuration is active.") + __properties: ClassVar[List[str]] = ["target_url", "events", "active"] + + @field_validator('events') + def events_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + for i in value: + if i not in set(['redemption.succeeded', 'redemption.failed', 'redemption.rollback.succeeded', 'redemption.rollback.failed', 'publication.succeeded', 'voucher.published', 'voucher.updated', 'voucher.deleted', 'voucher.created', 'voucher.enabled', 'voucher.disabled', 'voucher.loyalty_card.points_added', 'voucher.gift.balance_added', 'campaign.enabled', 'campaign.deleted', 'campaign.created', 'campaign.updated', 'campaign.disabled', 'campaign.vouchers.generation.completed', 'business_validation_rule.assignment.created', 'business_validation_rule.assignment.deleted', 'business_validation_rule.created', 'business_validation_rule.deleted', 'business_validation_rule.updated', 'customer.created', 'customer.deleted', 'customer.rewarded', 'customer.rewarded.loyalty_points']): + raise ValueError("each list item must be one of ('redemption.succeeded', 'redemption.failed', 'redemption.rollback.succeeded', 'redemption.rollback.failed', 'publication.succeeded', 'voucher.published', 'voucher.updated', 'voucher.deleted', 'voucher.created', 'voucher.enabled', 'voucher.disabled', 'voucher.loyalty_card.points_added', 'voucher.gift.balance_added', 'campaign.enabled', 'campaign.deleted', 'campaign.created', 'campaign.updated', 'campaign.disabled', 'campaign.vouchers.generation.completed', 'business_validation_rule.assignment.created', 'business_validation_rule.assignment.deleted', 'business_validation_rule.created', 'business_validation_rule.deleted', 'business_validation_rule.updated', 'customer.created', 'customer.deleted', 'customer.rewarded', 'customer.rewarded.loyalty_points')") + return value + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ManagementProjectsWebhooksUpdateRequestBody from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if target_url (nullable) is None + # and model_fields_set contains the field + if self.target_url is None and "target_url" in self.model_fields_set: + _dict['target_url'] = None + + # set to None if events (nullable) is None + # and model_fields_set contains the field + if self.events is None and "events" in self.model_fields_set: + _dict['events'] = None + + # set to None if active (nullable) is None + # and model_fields_set contains the field + if self.active is None and "active" in self.model_fields_set: + _dict['active'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ManagementProjectsWebhooksUpdateRequestBody from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "target_url": obj.get("target_url"), + "events": obj.get("events"), + "active": obj.get("active") if obj.get("active") is not None else True + }) + return _obj + + diff --git a/voucherify/models/management_projects_webhooks_update_response_body.py b/voucherify/models/management_projects_webhooks_update_response_body.py new file mode 100644 index 00000000..ca23b9d4 --- /dev/null +++ b/voucherify/models/management_projects_webhooks_update_response_body.py @@ -0,0 +1,150 @@ +# coding: utf-8 + +""" + Voucherify API + + Voucherify promotion engine REST API. Please see https://docs.voucherify.io/docs for more details. + + The version of the OpenAPI document: v2018-08-01 + Contact: support@voucherify.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class ManagementProjectsWebhooksUpdateResponseBody(BaseModel): + """ + Response body schema for **PUT** `v1/management/v1/projects/{projectId}/webhooks/{webhookId}`. + """ # noqa: E501 + id: Optional[StrictStr] = Field(default=None, description="Unique identifier of the webhook.") + object: Optional[StrictStr] = Field(default='webhook', description="The type of the object represented by JSON.") + created_at: Optional[datetime] = Field(default=None, description="Timestamp representing the date and time when the webhook configuration was created. The value for this parameter is shown in the ISO 8601 format.") + target_url: Optional[StrictStr] = Field(default=None, description="URL address that receives webhooks.") + events: Optional[List[StrictStr]] = Field(default=None, description="Lists the events that trigger webhook sendout.") + active: Optional[StrictBool] = Field(default=True, description="Determines if the webhook configuration is active.") + __properties: ClassVar[List[str]] = ["id", "object", "created_at", "target_url", "events", "active"] + + @field_validator('object') + def object_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['webhook']): + raise ValueError("must be one of enum values ('webhook')") + return value + + @field_validator('events') + def events_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + for i in value: + if i not in set(['redemption.succeeded', 'redemption.failed', 'redemption.rollback.succeeded', 'redemption.rollback.failed', 'publication.succeeded', 'voucher.published', 'voucher.updated', 'voucher.deleted', 'voucher.created', 'voucher.enabled', 'voucher.disabled', 'voucher.loyalty_card.points_added', 'voucher.gift.balance_added', 'campaign.enabled', 'campaign.deleted', 'campaign.created', 'campaign.updated', 'campaign.disabled', 'campaign.vouchers.generation.completed', 'business_validation_rule.assignment.created', 'business_validation_rule.assignment.deleted', 'business_validation_rule.created', 'business_validation_rule.deleted', 'business_validation_rule.updated', 'customer.created', 'customer.deleted', 'customer.rewarded', 'customer.rewarded.loyalty_points']): + raise ValueError("each list item must be one of ('redemption.succeeded', 'redemption.failed', 'redemption.rollback.succeeded', 'redemption.rollback.failed', 'publication.succeeded', 'voucher.published', 'voucher.updated', 'voucher.deleted', 'voucher.created', 'voucher.enabled', 'voucher.disabled', 'voucher.loyalty_card.points_added', 'voucher.gift.balance_added', 'campaign.enabled', 'campaign.deleted', 'campaign.created', 'campaign.updated', 'campaign.disabled', 'campaign.vouchers.generation.completed', 'business_validation_rule.assignment.created', 'business_validation_rule.assignment.deleted', 'business_validation_rule.created', 'business_validation_rule.deleted', 'business_validation_rule.updated', 'customer.created', 'customer.deleted', 'customer.rewarded', 'customer.rewarded.loyalty_points')") + return value + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ManagementProjectsWebhooksUpdateResponseBody from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if id (nullable) is None + # and model_fields_set contains the field + if self.id is None and "id" in self.model_fields_set: + _dict['id'] = None + + # set to None if object (nullable) is None + # and model_fields_set contains the field + if self.object is None and "object" in self.model_fields_set: + _dict['object'] = None + + # set to None if created_at (nullable) is None + # and model_fields_set contains the field + if self.created_at is None and "created_at" in self.model_fields_set: + _dict['created_at'] = None + + # set to None if target_url (nullable) is None + # and model_fields_set contains the field + if self.target_url is None and "target_url" in self.model_fields_set: + _dict['target_url'] = None + + # set to None if events (nullable) is None + # and model_fields_set contains the field + if self.events is None and "events" in self.model_fields_set: + _dict['events'] = None + + # set to None if active (nullable) is None + # and model_fields_set contains the field + if self.active is None and "active" in self.model_fields_set: + _dict['active'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ManagementProjectsWebhooksUpdateResponseBody from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id"), + "object": obj.get("object") if obj.get("object") is not None else 'webhook', + "created_at": obj.get("created_at"), + "target_url": obj.get("target_url"), + "events": obj.get("events"), + "active": obj.get("active") if obj.get("active") is not None else True + }) + return _obj + + diff --git a/voucherify/models/order_item_product.py b/voucherify/models/order_item_product.py index 6787b3d6..51b7c80d 100644 --- a/voucherify/models/order_item_product.py +++ b/voucherify/models/order_item_product.py @@ -29,7 +29,7 @@ class OrderItemProduct(BaseModel): """ # noqa: E501 id: Optional[StrictStr] = Field(default=None, description="A unique identifier that represents the product and is assigned by Voucherify.") source_id: Optional[StrictStr] = Field(default=None, description="The merchant's product ID (if it is different than Voucherify's product ID). It is really useful in case of integration between multiple systems. It can be an ID from an eCommerce site, a database or a 3rd party service.") - override: Optional[StrictBool] = Field(default=None, description="The override set to `true` is used to store the product information in the system. If the product does not exist, it will be created with a source_id; if it does exist, the provided values for the name, price, and metadata will replace those already stored in the system.") + override: Optional[StrictBool] = Field(default=None, description="The override set to `true` is used to store the product information in the system. If the product does not exist, it will be created with a source_id; if it does exist, the provided values for the name, price, and metadata will replace those already stored in the system. Override works only for endpoints that create an order in the database.") name: Optional[StrictStr] = Field(default=None, description="Product name.") metadata: Optional[Dict[str, Any]] = Field(default=None, description="A set of custom key/value pairs that you can attach to a product. It can be useful for storing additional information about the product in a structured format.") price: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Product price. A positive integer in the smallest currency unit (e.g. 100 cents for $1.00).") diff --git a/voucherify/models/parameter_campaign_type.py b/voucherify/models/parameter_campaign_type.py index 040f3f0f..c70f6406 100644 --- a/voucherify/models/parameter_campaign_type.py +++ b/voucherify/models/parameter_campaign_type.py @@ -32,7 +32,6 @@ class ParameterCampaignType(str, Enum): REFERRAL_PROGRAM = 'REFERRAL_PROGRAM' DISCOUNT_COUPONS = 'DISCOUNT_COUPONS' LOYALTY_PROGRAM = 'LOYALTY_PROGRAM' - LUCKY_DRAW = 'LUCKY_DRAW' @classmethod def from_json(cls, json_str: str) -> Self: diff --git a/voucherify/models/parameter_filters_list_bin.py b/voucherify/models/parameter_filters_list_bin.py new file mode 100644 index 00000000..0c9039af --- /dev/null +++ b/voucherify/models/parameter_filters_list_bin.py @@ -0,0 +1,133 @@ +# coding: utf-8 + +""" + Voucherify API + + Voucherify promotion engine REST API. Please see https://docs.voucherify.io/docs for more details. + + The version of the OpenAPI document: v2018-08-01 + Contact: support@voucherify.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict +from typing import Any, ClassVar, Dict, List, Optional +from voucherify.models.junction import Junction +from voucherify.models.parameter_filters_list_bin_id import ParameterFiltersListBinId +from voucherify.models.parameter_filters_list_bin_resource_id import ParameterFiltersListBinResourceId +from voucherify.models.parameter_filters_list_bin_resource_name import ParameterFiltersListBinResourceName +from voucherify.models.parameter_filters_list_bin_resource_type import ParameterFiltersListBinResourceType +from typing import Optional, Set +from typing_extensions import Self + +class ParameterFiltersListBin(BaseModel): + """ + ParameterFiltersListBin + """ # noqa: E501 + junction: Optional[Junction] = None + id: Optional[ParameterFiltersListBinId] = None + resource_type: Optional[ParameterFiltersListBinResourceType] = None + resource_name: Optional[ParameterFiltersListBinResourceName] = None + resource_id: Optional[ParameterFiltersListBinResourceId] = None + __properties: ClassVar[List[str]] = ["junction", "id", "resource_type", "resource_name", "resource_id"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ParameterFiltersListBin from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of id + if self.id: + _dict['id'] = self.id.to_dict() + # override the default output from pydantic by calling `to_dict()` of resource_type + if self.resource_type: + _dict['resource_type'] = self.resource_type.to_dict() + # override the default output from pydantic by calling `to_dict()` of resource_name + if self.resource_name: + _dict['resource_name'] = self.resource_name.to_dict() + # override the default output from pydantic by calling `to_dict()` of resource_id + if self.resource_id: + _dict['resource_id'] = self.resource_id.to_dict() + # set to None if id (nullable) is None + # and model_fields_set contains the field + if self.id is None and "id" in self.model_fields_set: + _dict['id'] = None + + # set to None if resource_type (nullable) is None + # and model_fields_set contains the field + if self.resource_type is None and "resource_type" in self.model_fields_set: + _dict['resource_type'] = None + + # set to None if resource_name (nullable) is None + # and model_fields_set contains the field + if self.resource_name is None and "resource_name" in self.model_fields_set: + _dict['resource_name'] = None + + # set to None if resource_id (nullable) is None + # and model_fields_set contains the field + if self.resource_id is None and "resource_id" in self.model_fields_set: + _dict['resource_id'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ParameterFiltersListBin from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "junction": obj.get("junction"), + "id": ParameterFiltersListBinId.from_dict(obj["id"]) if obj.get("id") is not None else None, + "resource_type": ParameterFiltersListBinResourceType.from_dict(obj["resource_type"]) if obj.get("resource_type") is not None else None, + "resource_name": ParameterFiltersListBinResourceName.from_dict(obj["resource_name"]) if obj.get("resource_name") is not None else None, + "resource_id": ParameterFiltersListBinResourceId.from_dict(obj["resource_id"]) if obj.get("resource_id") is not None else None + }) + return _obj + + diff --git a/voucherify/models/parameter_filters_list_bin_id.py b/voucherify/models/parameter_filters_list_bin_id.py new file mode 100644 index 00000000..72f51f63 --- /dev/null +++ b/voucherify/models/parameter_filters_list_bin_id.py @@ -0,0 +1,92 @@ +# coding: utf-8 + +""" + Voucherify API + + Voucherify promotion engine REST API. Please see https://docs.voucherify.io/docs for more details. + + The version of the OpenAPI document: v2018-08-01 + Contact: support@voucherify.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict +from typing import Any, ClassVar, Dict, List, Optional +from voucherify.models.filter_conditions_string import FilterConditionsString +from typing import Optional, Set +from typing_extensions import Self + +class ParameterFiltersListBinId(BaseModel): + """ + Unique identifier of the bin entry. + """ # noqa: E501 + conditions: Optional[FilterConditionsString] = None + __properties: ClassVar[List[str]] = ["conditions"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ParameterFiltersListBinId from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of conditions + if self.conditions: + _dict['conditions'] = self.conditions.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ParameterFiltersListBinId from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "conditions": FilterConditionsString.from_dict(obj["conditions"]) if obj.get("conditions") is not None else None + }) + return _obj + + diff --git a/voucherify/models/parameter_filters_list_bin_resource_id.py b/voucherify/models/parameter_filters_list_bin_resource_id.py new file mode 100644 index 00000000..326f1e25 --- /dev/null +++ b/voucherify/models/parameter_filters_list_bin_resource_id.py @@ -0,0 +1,92 @@ +# coding: utf-8 + +""" + Voucherify API + + Voucherify promotion engine REST API. Please see https://docs.voucherify.io/docs for more details. + + The version of the OpenAPI document: v2018-08-01 + Contact: support@voucherify.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict +from typing import Any, ClassVar, Dict, List, Optional +from voucherify.models.filter_conditions_string import FilterConditionsString +from typing import Optional, Set +from typing_extensions import Self + +class ParameterFiltersListBinResourceId(BaseModel): + """ + Unique identifier of the resource moved to the bin. + """ # noqa: E501 + conditions: Optional[FilterConditionsString] = None + __properties: ClassVar[List[str]] = ["conditions"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ParameterFiltersListBinResourceId from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of conditions + if self.conditions: + _dict['conditions'] = self.conditions.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ParameterFiltersListBinResourceId from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "conditions": FilterConditionsString.from_dict(obj["conditions"]) if obj.get("conditions") is not None else None + }) + return _obj + + diff --git a/voucherify/models/parameter_filters_list_bin_resource_name.py b/voucherify/models/parameter_filters_list_bin_resource_name.py new file mode 100644 index 00000000..a6d91ce0 --- /dev/null +++ b/voucherify/models/parameter_filters_list_bin_resource_name.py @@ -0,0 +1,92 @@ +# coding: utf-8 + +""" + Voucherify API + + Voucherify promotion engine REST API. Please see https://docs.voucherify.io/docs for more details. + + The version of the OpenAPI document: v2018-08-01 + Contact: support@voucherify.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict +from typing import Any, ClassVar, Dict, List, Optional +from voucherify.models.filter_conditions_string import FilterConditionsString +from typing import Optional, Set +from typing_extensions import Self + +class ParameterFiltersListBinResourceName(BaseModel): + """ + Name of the resource moved to the bin: the name of the campaign, voucher, product, or SKU. + """ # noqa: E501 + conditions: Optional[FilterConditionsString] = None + __properties: ClassVar[List[str]] = ["conditions"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ParameterFiltersListBinResourceName from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of conditions + if self.conditions: + _dict['conditions'] = self.conditions.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ParameterFiltersListBinResourceName from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "conditions": FilterConditionsString.from_dict(obj["conditions"]) if obj.get("conditions") is not None else None + }) + return _obj + + diff --git a/voucherify/models/parameter_filters_list_bin_resource_type.py b/voucherify/models/parameter_filters_list_bin_resource_type.py new file mode 100644 index 00000000..f176bde1 --- /dev/null +++ b/voucherify/models/parameter_filters_list_bin_resource_type.py @@ -0,0 +1,92 @@ +# coding: utf-8 + +""" + Voucherify API + + Voucherify promotion engine REST API. Please see https://docs.voucherify.io/docs for more details. + + The version of the OpenAPI document: v2018-08-01 + Contact: support@voucherify.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict +from typing import Any, ClassVar, Dict, List, Optional +from voucherify.models.parameter_filters_list_bin_resource_type_conditions import ParameterFiltersListBinResourceTypeConditions +from typing import Optional, Set +from typing_extensions import Self + +class ParameterFiltersListBinResourceType(BaseModel): + """ + Resource type of the resource moved to the bin. + """ # noqa: E501 + conditions: Optional[ParameterFiltersListBinResourceTypeConditions] = None + __properties: ClassVar[List[str]] = ["conditions"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ParameterFiltersListBinResourceType from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of conditions + if self.conditions: + _dict['conditions'] = self.conditions.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ParameterFiltersListBinResourceType from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "conditions": ParameterFiltersListBinResourceTypeConditions.from_dict(obj["conditions"]) if obj.get("conditions") is not None else None + }) + return _obj + + diff --git a/voucherify/models/parameter_filters_list_bin_resource_type_conditions.py b/voucherify/models/parameter_filters_list_bin_resource_type_conditions.py new file mode 100644 index 00000000..896d62bf --- /dev/null +++ b/voucherify/models/parameter_filters_list_bin_resource_type_conditions.py @@ -0,0 +1,184 @@ +# coding: utf-8 + +""" + Voucherify API + + Voucherify promotion engine REST API. Please see https://docs.voucherify.io/docs for more details. + + The version of the OpenAPI document: v2018-08-01 + Contact: support@voucherify.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class ParameterFiltersListBinResourceTypeConditions(BaseModel): + """ + ParameterFiltersListBinResourceTypeConditions + """ # noqa: E501 + var_in: Optional[List[StrictStr]] = Field(default=None, description="Array of resource values that should be included in the results (multiple values).", alias="$in") + not_in: Optional[List[StrictStr]] = Field(default=None, description="Array of resource values that should be included in the results (multiple values).", alias="$not_in") + var_is: Optional[StrictStr] = Field(default=None, description="Value is exactly this value (single value).", alias="$is") + is_not: Optional[StrictStr] = Field(default=None, description="Results omit this value (single value).", alias="$is_not") + has_value: Optional[StrictStr] = Field(default=None, description="Value is NOT null. The value for this parameter is an empty string.", alias="$has_value") + is_unknown: Optional[StrictStr] = Field(default=None, description="Value is null. The value for this parameter is an empty string.", alias="$is_unknown") + starts_with: Optional[StrictStr] = Field(default=None, description="Value starts with the specified string.", alias="$starts_with") + ends_with: Optional[StrictStr] = Field(default=None, description="Value ends with the specified string.", alias="$ends_with") + __properties: ClassVar[List[str]] = ["$in", "$not_in", "$is", "$is_not", "$has_value", "$is_unknown", "$starts_with", "$ends_with"] + + @field_validator('var_in') + def var_in_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + for i in value: + if i not in set(['campaign', 'product', 'sku', 'voucher']): + raise ValueError("each list item must be one of ('campaign', 'product', 'sku', 'voucher')") + return value + + @field_validator('not_in') + def not_in_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + for i in value: + if i not in set(['campaign', 'product', 'sku', 'voucher']): + raise ValueError("each list item must be one of ('campaign', 'product', 'sku', 'voucher')") + return value + + @field_validator('var_is') + def var_is_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['campaign', 'product', 'sku', 'voucher']): + raise ValueError("must be one of enum values ('campaign', 'product', 'sku', 'voucher')") + return value + + @field_validator('is_not') + def is_not_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['campaign', 'product', 'sku', 'voucher']): + raise ValueError("must be one of enum values ('campaign', 'product', 'sku', 'voucher')") + return value + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ParameterFiltersListBinResourceTypeConditions from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if var_in (nullable) is None + # and model_fields_set contains the field + if self.var_in is None and "var_in" in self.model_fields_set: + _dict['$in'] = None + + # set to None if not_in (nullable) is None + # and model_fields_set contains the field + if self.not_in is None and "not_in" in self.model_fields_set: + _dict['$not_in'] = None + + # set to None if var_is (nullable) is None + # and model_fields_set contains the field + if self.var_is is None and "var_is" in self.model_fields_set: + _dict['$is'] = None + + # set to None if is_not (nullable) is None + # and model_fields_set contains the field + if self.is_not is None and "is_not" in self.model_fields_set: + _dict['$is_not'] = None + + # set to None if has_value (nullable) is None + # and model_fields_set contains the field + if self.has_value is None and "has_value" in self.model_fields_set: + _dict['$has_value'] = None + + # set to None if is_unknown (nullable) is None + # and model_fields_set contains the field + if self.is_unknown is None and "is_unknown" in self.model_fields_set: + _dict['$is_unknown'] = None + + # set to None if starts_with (nullable) is None + # and model_fields_set contains the field + if self.starts_with is None and "starts_with" in self.model_fields_set: + _dict['$starts_with'] = None + + # set to None if ends_with (nullable) is None + # and model_fields_set contains the field + if self.ends_with is None and "ends_with" in self.model_fields_set: + _dict['$ends_with'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ParameterFiltersListBinResourceTypeConditions from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "$in": obj.get("$in"), + "$not_in": obj.get("$not_in"), + "$is": obj.get("$is"), + "$is_not": obj.get("$is_not"), + "$has_value": obj.get("$has_value"), + "$is_unknown": obj.get("$is_unknown"), + "$starts_with": obj.get("$starts_with"), + "$ends_with": obj.get("$ends_with") + }) + return _obj + + diff --git a/voucherify/models/parameter_filters_list_campaigns.py b/voucherify/models/parameter_filters_list_campaigns.py new file mode 100644 index 00000000..1c17a12a --- /dev/null +++ b/voucherify/models/parameter_filters_list_campaigns.py @@ -0,0 +1,155 @@ +# coding: utf-8 + +""" + Voucherify API + + Voucherify promotion engine REST API. Please see https://docs.voucherify.io/docs for more details. + + The version of the OpenAPI document: v2018-08-01 + Contact: support@voucherify.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict +from typing import Any, ClassVar, Dict, List, Optional +from voucherify.models.junction import Junction +from voucherify.models.parameter_filters_list_campaigns_campaign_status import ParameterFiltersListCampaignsCampaignStatus +from voucherify.models.parameter_filters_list_campaigns_categories import ParameterFiltersListCampaignsCategories +from voucherify.models.parameter_filters_list_campaigns_category_ids import ParameterFiltersListCampaignsCategoryIds +from voucherify.models.parameter_filters_list_campaigns_is_referral_code import ParameterFiltersListCampaignsIsReferralCode +from voucherify.models.parameter_filters_list_campaigns_validity_timeframe import ParameterFiltersListCampaignsValidityTimeframe +from voucherify.models.parameter_filters_list_campaigns_voucher_type import ParameterFiltersListCampaignsVoucherType +from typing import Optional, Set +from typing_extensions import Self + +class ParameterFiltersListCampaigns(BaseModel): + """ + ParameterFiltersListCampaigns + """ # noqa: E501 + campaign_status: Optional[ParameterFiltersListCampaignsCampaignStatus] = None + is_referral_code: Optional[ParameterFiltersListCampaignsIsReferralCode] = None + validity_timeframe: Optional[ParameterFiltersListCampaignsValidityTimeframe] = None + voucher_type: Optional[ParameterFiltersListCampaignsVoucherType] = None + categories: Optional[ParameterFiltersListCampaignsCategories] = None + category_ids: Optional[ParameterFiltersListCampaignsCategoryIds] = None + junction: Optional[Junction] = None + __properties: ClassVar[List[str]] = ["campaign_status", "is_referral_code", "validity_timeframe", "voucher_type", "categories", "category_ids", "junction"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ParameterFiltersListCampaigns from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of campaign_status + if self.campaign_status: + _dict['campaign_status'] = self.campaign_status.to_dict() + # override the default output from pydantic by calling `to_dict()` of is_referral_code + if self.is_referral_code: + _dict['is_referral_code'] = self.is_referral_code.to_dict() + # override the default output from pydantic by calling `to_dict()` of validity_timeframe + if self.validity_timeframe: + _dict['validity_timeframe'] = self.validity_timeframe.to_dict() + # override the default output from pydantic by calling `to_dict()` of voucher_type + if self.voucher_type: + _dict['voucher_type'] = self.voucher_type.to_dict() + # override the default output from pydantic by calling `to_dict()` of categories + if self.categories: + _dict['categories'] = self.categories.to_dict() + # override the default output from pydantic by calling `to_dict()` of category_ids + if self.category_ids: + _dict['category_ids'] = self.category_ids.to_dict() + # set to None if campaign_status (nullable) is None + # and model_fields_set contains the field + if self.campaign_status is None and "campaign_status" in self.model_fields_set: + _dict['campaign_status'] = None + + # set to None if is_referral_code (nullable) is None + # and model_fields_set contains the field + if self.is_referral_code is None and "is_referral_code" in self.model_fields_set: + _dict['is_referral_code'] = None + + # set to None if validity_timeframe (nullable) is None + # and model_fields_set contains the field + if self.validity_timeframe is None and "validity_timeframe" in self.model_fields_set: + _dict['validity_timeframe'] = None + + # set to None if voucher_type (nullable) is None + # and model_fields_set contains the field + if self.voucher_type is None and "voucher_type" in self.model_fields_set: + _dict['voucher_type'] = None + + # set to None if categories (nullable) is None + # and model_fields_set contains the field + if self.categories is None and "categories" in self.model_fields_set: + _dict['categories'] = None + + # set to None if category_ids (nullable) is None + # and model_fields_set contains the field + if self.category_ids is None and "category_ids" in self.model_fields_set: + _dict['category_ids'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ParameterFiltersListCampaigns from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "campaign_status": ParameterFiltersListCampaignsCampaignStatus.from_dict(obj["campaign_status"]) if obj.get("campaign_status") is not None else None, + "is_referral_code": ParameterFiltersListCampaignsIsReferralCode.from_dict(obj["is_referral_code"]) if obj.get("is_referral_code") is not None else None, + "validity_timeframe": ParameterFiltersListCampaignsValidityTimeframe.from_dict(obj["validity_timeframe"]) if obj.get("validity_timeframe") is not None else None, + "voucher_type": ParameterFiltersListCampaignsVoucherType.from_dict(obj["voucher_type"]) if obj.get("voucher_type") is not None else None, + "categories": ParameterFiltersListCampaignsCategories.from_dict(obj["categories"]) if obj.get("categories") is not None else None, + "category_ids": ParameterFiltersListCampaignsCategoryIds.from_dict(obj["category_ids"]) if obj.get("category_ids") is not None else None, + "junction": obj.get("junction") + }) + return _obj + + diff --git a/voucherify/models/parameter_filters_list_campaigns_campaign_status.py b/voucherify/models/parameter_filters_list_campaigns_campaign_status.py new file mode 100644 index 00000000..07a22e27 --- /dev/null +++ b/voucherify/models/parameter_filters_list_campaigns_campaign_status.py @@ -0,0 +1,92 @@ +# coding: utf-8 + +""" + Voucherify API + + Voucherify promotion engine REST API. Please see https://docs.voucherify.io/docs for more details. + + The version of the OpenAPI document: v2018-08-01 + Contact: support@voucherify.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict +from typing import Any, ClassVar, Dict, List, Optional +from voucherify.models.parameter_filters_list_campaigns_campaign_status_conditions import ParameterFiltersListCampaignsCampaignStatusConditions +from typing import Optional, Set +from typing_extensions import Self + +class ParameterFiltersListCampaignsCampaignStatus(BaseModel): + """ + Type of the campaign. Allowed values: `DONE`, `IN_PROGRESS`, `DRAFT`, `FAILED` `MODIFYING` + """ # noqa: E501 + conditions: Optional[ParameterFiltersListCampaignsCampaignStatusConditions] = None + __properties: ClassVar[List[str]] = ["conditions"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ParameterFiltersListCampaignsCampaignStatus from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of conditions + if self.conditions: + _dict['conditions'] = self.conditions.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ParameterFiltersListCampaignsCampaignStatus from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "conditions": ParameterFiltersListCampaignsCampaignStatusConditions.from_dict(obj["conditions"]) if obj.get("conditions") is not None else None + }) + return _obj + + diff --git a/voucherify/models/parameter_filters_list_campaigns_campaign_status_conditions.py b/voucherify/models/parameter_filters_list_campaigns_campaign_status_conditions.py new file mode 100644 index 00000000..958db3da --- /dev/null +++ b/voucherify/models/parameter_filters_list_campaigns_campaign_status_conditions.py @@ -0,0 +1,184 @@ +# coding: utf-8 + +""" + Voucherify API + + Voucherify promotion engine REST API. Please see https://docs.voucherify.io/docs for more details. + + The version of the OpenAPI document: v2018-08-01 + Contact: support@voucherify.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class ParameterFiltersListCampaignsCampaignStatusConditions(BaseModel): + """ + ParameterFiltersListCampaignsCampaignStatusConditions + """ # noqa: E501 + var_in: Optional[List[StrictStr]] = Field(default=None, description="Array of resource values that should be included in the results (multiple values).", alias="$in") + not_in: Optional[List[StrictStr]] = Field(default=None, description="Array of resource values that should be included in the results (multiple values).", alias="$not_in") + var_is: Optional[StrictStr] = Field(default=None, description="Value is exactly this value (single value).", alias="$is") + is_not: Optional[StrictStr] = Field(default=None, description="Results omit this value (single value).", alias="$is_not") + has_value: Optional[StrictStr] = Field(default=None, description="Value is NOT null. The value for this parameter is an empty string.", alias="$has_value") + is_unknown: Optional[StrictStr] = Field(default=None, description="Value is null. The value for this parameter is an empty string.", alias="$is_unknown") + starts_with: Optional[StrictStr] = Field(default=None, description="Value starts with the specified string.", alias="$starts_with") + ends_with: Optional[StrictStr] = Field(default=None, description="Value ends with the specified string.", alias="$ends_with") + __properties: ClassVar[List[str]] = ["$in", "$not_in", "$is", "$is_not", "$has_value", "$is_unknown", "$starts_with", "$ends_with"] + + @field_validator('var_in') + def var_in_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + for i in value: + if i not in set(['DONE', 'IN_PROGRESS', 'FAILED', 'DRAFT', 'MODIFYING']): + raise ValueError("each list item must be one of ('DONE', 'IN_PROGRESS', 'FAILED', 'DRAFT', 'MODIFYING')") + return value + + @field_validator('not_in') + def not_in_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + for i in value: + if i not in set(['DONE', 'IN_PROGRESS', 'FAILED', 'DRAFT', 'MODIFYING']): + raise ValueError("each list item must be one of ('DONE', 'IN_PROGRESS', 'FAILED', 'DRAFT', 'MODIFYING')") + return value + + @field_validator('var_is') + def var_is_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['DONE', 'IN_PROGRESS', 'FAILED', 'DRAFT', 'MODIFYING']): + raise ValueError("must be one of enum values ('DONE', 'IN_PROGRESS', 'FAILED', 'DRAFT', 'MODIFYING')") + return value + + @field_validator('is_not') + def is_not_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['DONE', 'IN_PROGRESS', 'FAILED', 'DRAFT', 'MODIFYING']): + raise ValueError("must be one of enum values ('DONE', 'IN_PROGRESS', 'FAILED', 'DRAFT', 'MODIFYING')") + return value + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ParameterFiltersListCampaignsCampaignStatusConditions from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if var_in (nullable) is None + # and model_fields_set contains the field + if self.var_in is None and "var_in" in self.model_fields_set: + _dict['$in'] = None + + # set to None if not_in (nullable) is None + # and model_fields_set contains the field + if self.not_in is None and "not_in" in self.model_fields_set: + _dict['$not_in'] = None + + # set to None if var_is (nullable) is None + # and model_fields_set contains the field + if self.var_is is None and "var_is" in self.model_fields_set: + _dict['$is'] = None + + # set to None if is_not (nullable) is None + # and model_fields_set contains the field + if self.is_not is None and "is_not" in self.model_fields_set: + _dict['$is_not'] = None + + # set to None if has_value (nullable) is None + # and model_fields_set contains the field + if self.has_value is None and "has_value" in self.model_fields_set: + _dict['$has_value'] = None + + # set to None if is_unknown (nullable) is None + # and model_fields_set contains the field + if self.is_unknown is None and "is_unknown" in self.model_fields_set: + _dict['$is_unknown'] = None + + # set to None if starts_with (nullable) is None + # and model_fields_set contains the field + if self.starts_with is None and "starts_with" in self.model_fields_set: + _dict['$starts_with'] = None + + # set to None if ends_with (nullable) is None + # and model_fields_set contains the field + if self.ends_with is None and "ends_with" in self.model_fields_set: + _dict['$ends_with'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ParameterFiltersListCampaignsCampaignStatusConditions from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "$in": obj.get("$in"), + "$not_in": obj.get("$not_in"), + "$is": obj.get("$is"), + "$is_not": obj.get("$is_not"), + "$has_value": obj.get("$has_value"), + "$is_unknown": obj.get("$is_unknown"), + "$starts_with": obj.get("$starts_with"), + "$ends_with": obj.get("$ends_with") + }) + return _obj + + diff --git a/voucherify/models/parameter_filters_list_campaigns_categories.py b/voucherify/models/parameter_filters_list_campaigns_categories.py new file mode 100644 index 00000000..3e33a4a9 --- /dev/null +++ b/voucherify/models/parameter_filters_list_campaigns_categories.py @@ -0,0 +1,92 @@ +# coding: utf-8 + +""" + Voucherify API + + Voucherify promotion engine REST API. Please see https://docs.voucherify.io/docs for more details. + + The version of the OpenAPI document: v2018-08-01 + Contact: support@voucherify.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict +from typing import Any, ClassVar, Dict, List, Optional +from voucherify.models.filter_conditions_string import FilterConditionsString +from typing import Optional, Set +from typing_extensions import Self + +class ParameterFiltersListCampaignsCategories(BaseModel): + """ + Filter by categories names + """ # noqa: E501 + conditions: Optional[FilterConditionsString] = None + __properties: ClassVar[List[str]] = ["conditions"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ParameterFiltersListCampaignsCategories from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of conditions + if self.conditions: + _dict['conditions'] = self.conditions.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ParameterFiltersListCampaignsCategories from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "conditions": FilterConditionsString.from_dict(obj["conditions"]) if obj.get("conditions") is not None else None + }) + return _obj + + diff --git a/voucherify/models/parameter_filters_list_campaigns_category_ids.py b/voucherify/models/parameter_filters_list_campaigns_category_ids.py new file mode 100644 index 00000000..8f44c217 --- /dev/null +++ b/voucherify/models/parameter_filters_list_campaigns_category_ids.py @@ -0,0 +1,92 @@ +# coding: utf-8 + +""" + Voucherify API + + Voucherify promotion engine REST API. Please see https://docs.voucherify.io/docs for more details. + + The version of the OpenAPI document: v2018-08-01 + Contact: support@voucherify.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict +from typing import Any, ClassVar, Dict, List, Optional +from voucherify.models.filter_conditions_string import FilterConditionsString +from typing import Optional, Set +from typing_extensions import Self + +class ParameterFiltersListCampaignsCategoryIds(BaseModel): + """ + Filter by categories ids + """ # noqa: E501 + conditions: Optional[FilterConditionsString] = None + __properties: ClassVar[List[str]] = ["conditions"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ParameterFiltersListCampaignsCategoryIds from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of conditions + if self.conditions: + _dict['conditions'] = self.conditions.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ParameterFiltersListCampaignsCategoryIds from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "conditions": FilterConditionsString.from_dict(obj["conditions"]) if obj.get("conditions") is not None else None + }) + return _obj + + diff --git a/voucherify/models/parameter_filters_list_campaigns_is_referral_code.py b/voucherify/models/parameter_filters_list_campaigns_is_referral_code.py new file mode 100644 index 00000000..0625dfd5 --- /dev/null +++ b/voucherify/models/parameter_filters_list_campaigns_is_referral_code.py @@ -0,0 +1,120 @@ +# coding: utf-8 + +""" + Voucherify API + + Voucherify promotion engine REST API. Please see https://docs.voucherify.io/docs for more details. + + The version of the OpenAPI document: v2018-08-01 + Contact: support@voucherify.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class ParameterFiltersListCampaignsIsReferralCode(BaseModel): + """ + + """ # noqa: E501 + var_is: Optional[StrictStr] = Field(default=None, description="Value is exactly this value (single value).", alias="$is") + is_not: Optional[StrictStr] = Field(default=None, description="Results omit this value (single value).", alias="$is_not") + __properties: ClassVar[List[str]] = ["$is", "$is_not"] + + @field_validator('var_is') + def var_is_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['TRUE', 'FALSE']): + raise ValueError("must be one of enum values ('TRUE', 'FALSE')") + return value + + @field_validator('is_not') + def is_not_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['TRUE', 'FALSE']): + raise ValueError("must be one of enum values ('TRUE', 'FALSE')") + return value + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ParameterFiltersListCampaignsIsReferralCode from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if var_is (nullable) is None + # and model_fields_set contains the field + if self.var_is is None and "var_is" in self.model_fields_set: + _dict['$is'] = None + + # set to None if is_not (nullable) is None + # and model_fields_set contains the field + if self.is_not is None and "is_not" in self.model_fields_set: + _dict['$is_not'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ParameterFiltersListCampaignsIsReferralCode from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "$is": obj.get("$is"), + "$is_not": obj.get("$is_not") + }) + return _obj + + diff --git a/voucherify/models/parameter_filters_list_campaigns_validity_timeframe.py b/voucherify/models/parameter_filters_list_campaigns_validity_timeframe.py new file mode 100644 index 00000000..6cb32e6c --- /dev/null +++ b/voucherify/models/parameter_filters_list_campaigns_validity_timeframe.py @@ -0,0 +1,92 @@ +# coding: utf-8 + +""" + Voucherify API + + Voucherify promotion engine REST API. Please see https://docs.voucherify.io/docs for more details. + + The version of the OpenAPI document: v2018-08-01 + Contact: support@voucherify.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict +from typing import Any, ClassVar, Dict, List, Optional +from voucherify.models.filter_conditions_date_time import FilterConditionsDateTime +from typing import Optional, Set +from typing_extensions import Self + +class ParameterFiltersListCampaignsValidityTimeframe(BaseModel): + """ + Filter by validity timeframe + """ # noqa: E501 + conditions: Optional[FilterConditionsDateTime] = None + __properties: ClassVar[List[str]] = ["conditions"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ParameterFiltersListCampaignsValidityTimeframe from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of conditions + if self.conditions: + _dict['conditions'] = self.conditions.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ParameterFiltersListCampaignsValidityTimeframe from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "conditions": FilterConditionsDateTime.from_dict(obj["conditions"]) if obj.get("conditions") is not None else None + }) + return _obj + + diff --git a/voucherify/models/parameter_filters_list_campaigns_voucher_type.py b/voucherify/models/parameter_filters_list_campaigns_voucher_type.py new file mode 100644 index 00000000..d9cbf990 --- /dev/null +++ b/voucherify/models/parameter_filters_list_campaigns_voucher_type.py @@ -0,0 +1,92 @@ +# coding: utf-8 + +""" + Voucherify API + + Voucherify promotion engine REST API. Please see https://docs.voucherify.io/docs for more details. + + The version of the OpenAPI document: v2018-08-01 + Contact: support@voucherify.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict +from typing import Any, ClassVar, Dict, List, Optional +from voucherify.models.filter_conditions_string import FilterConditionsString +from typing import Optional, Set +from typing_extensions import Self + +class ParameterFiltersListCampaignsVoucherType(BaseModel): + """ + Filter by voucher type + """ # noqa: E501 + conditions: Optional[FilterConditionsString] = None + __properties: ClassVar[List[str]] = ["conditions"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ParameterFiltersListCampaignsVoucherType from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of conditions + if self.conditions: + _dict['conditions'] = self.conditions.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ParameterFiltersListCampaignsVoucherType from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "conditions": FilterConditionsString.from_dict(obj["conditions"]) if obj.get("conditions") is not None else None + }) + return _obj + + diff --git a/voucherify/models/parameter_filters_list_customer_redeemables.py b/voucherify/models/parameter_filters_list_customer_redeemables.py index da4fef5f..26ce5428 100644 --- a/voucherify/models/parameter_filters_list_customer_redeemables.py +++ b/voucherify/models/parameter_filters_list_customer_redeemables.py @@ -20,6 +20,7 @@ from pydantic import BaseModel, ConfigDict from typing import Any, ClassVar, Dict, List, Optional +from voucherify.models.junction import Junction from voucherify.models.parameter_filters_list_customer_redeemables_campaign_id import ParameterFiltersListCustomerRedeemablesCampaignId from voucherify.models.parameter_filters_list_customer_redeemables_campaign_type import ParameterFiltersListCustomerRedeemablesCampaignType from voucherify.models.parameter_filters_list_customer_redeemables_created_at import ParameterFiltersListCustomerRedeemablesCreatedAt @@ -43,7 +44,8 @@ class ParameterFiltersListCustomerRedeemables(BaseModel): campaign_id: Optional[ParameterFiltersListCustomerRedeemablesCampaignId] = None campaign_type: Optional[ParameterFiltersListCustomerRedeemablesCampaignType] = None voucher_type: Optional[ParameterFiltersListCustomerRedeemablesVoucherType] = None - __properties: ClassVar[List[str]] = ["id", "created_at", "redeemable_id", "redeemable_object", "holder_role", "campaign_id", "campaign_type", "voucher_type"] + junction: Optional[Junction] = None + __properties: ClassVar[List[str]] = ["id", "created_at", "redeemable_id", "redeemable_object", "holder_role", "campaign_id", "campaign_type", "voucher_type", "junction"] model_config = ConfigDict( populate_by_name=True, @@ -167,7 +169,8 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "holder_role": ParameterFiltersListCustomerRedeemablesHolderRole.from_dict(obj["holder_role"]) if obj.get("holder_role") is not None else None, "campaign_id": ParameterFiltersListCustomerRedeemablesCampaignId.from_dict(obj["campaign_id"]) if obj.get("campaign_id") is not None else None, "campaign_type": ParameterFiltersListCustomerRedeemablesCampaignType.from_dict(obj["campaign_type"]) if obj.get("campaign_type") is not None else None, - "voucher_type": ParameterFiltersListCustomerRedeemablesVoucherType.from_dict(obj["voucher_type"]) if obj.get("voucher_type") is not None else None + "voucher_type": ParameterFiltersListCustomerRedeemablesVoucherType.from_dict(obj["voucher_type"]) if obj.get("voucher_type") is not None else None, + "junction": obj.get("junction") }) return _obj diff --git a/voucherify/models/parameter_filters_list_customer_redeemables_campaign_id.py b/voucherify/models/parameter_filters_list_customer_redeemables_campaign_id.py index a82a30f4..666273f9 100644 --- a/voucherify/models/parameter_filters_list_customer_redeemables_campaign_id.py +++ b/voucherify/models/parameter_filters_list_customer_redeemables_campaign_id.py @@ -21,7 +21,6 @@ from pydantic import BaseModel, ConfigDict from typing import Any, ClassVar, Dict, List, Optional from voucherify.models.filter_conditions_string import FilterConditionsString -from voucherify.models.junction import Junction from typing import Optional, Set from typing_extensions import Self @@ -30,8 +29,7 @@ class ParameterFiltersListCustomerRedeemablesCampaignId(BaseModel): Unique campaign identifer, e.g. `camp_bfrwAVsP6Q1EM1ZjgHwheKYr`. """ # noqa: E501 conditions: Optional[FilterConditionsString] = None - junction: Optional[Junction] = None - __properties: ClassVar[List[str]] = ["conditions", "junction"] + __properties: ClassVar[List[str]] = ["conditions"] model_config = ConfigDict( populate_by_name=True, @@ -87,8 +85,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: return cls.model_validate(obj) _obj = cls.model_validate({ - "conditions": FilterConditionsString.from_dict(obj["conditions"]) if obj.get("conditions") is not None else None, - "junction": obj.get("junction") + "conditions": FilterConditionsString.from_dict(obj["conditions"]) if obj.get("conditions") is not None else None }) return _obj diff --git a/voucherify/models/parameter_filters_list_customer_redeemables_campaign_type.py b/voucherify/models/parameter_filters_list_customer_redeemables_campaign_type.py index a41cf1de..d9449032 100644 --- a/voucherify/models/parameter_filters_list_customer_redeemables_campaign_type.py +++ b/voucherify/models/parameter_filters_list_customer_redeemables_campaign_type.py @@ -20,7 +20,6 @@ from pydantic import BaseModel, ConfigDict from typing import Any, ClassVar, Dict, List, Optional -from voucherify.models.junction import Junction from voucherify.models.parameter_filters_list_customer_redeemables_campaign_type_conditions import ParameterFiltersListCustomerRedeemablesCampaignTypeConditions from typing import Optional, Set from typing_extensions import Self @@ -30,8 +29,7 @@ class ParameterFiltersListCustomerRedeemablesCampaignType(BaseModel): Type of the campaign. Allowed values: `DISCOUNT_COUPONS`, `REFERRAL_PROGRAM`, `GIFT_VOUCHERS`, `LOYALTY_PROGRAM` """ # noqa: E501 conditions: Optional[ParameterFiltersListCustomerRedeemablesCampaignTypeConditions] = None - junction: Optional[Junction] = None - __properties: ClassVar[List[str]] = ["conditions", "junction"] + __properties: ClassVar[List[str]] = ["conditions"] model_config = ConfigDict( populate_by_name=True, @@ -87,8 +85,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: return cls.model_validate(obj) _obj = cls.model_validate({ - "conditions": ParameterFiltersListCustomerRedeemablesCampaignTypeConditions.from_dict(obj["conditions"]) if obj.get("conditions") is not None else None, - "junction": obj.get("junction") + "conditions": ParameterFiltersListCustomerRedeemablesCampaignTypeConditions.from_dict(obj["conditions"]) if obj.get("conditions") is not None else None }) return _obj diff --git a/voucherify/models/parameter_filters_list_customer_redeemables_created_at.py b/voucherify/models/parameter_filters_list_customer_redeemables_created_at.py index e241b5f7..52b2b080 100644 --- a/voucherify/models/parameter_filters_list_customer_redeemables_created_at.py +++ b/voucherify/models/parameter_filters_list_customer_redeemables_created_at.py @@ -20,8 +20,7 @@ from pydantic import BaseModel, ConfigDict from typing import Any, ClassVar, Dict, List, Optional -from voucherify.models.junction import Junction -from voucherify.models.parameter_filters_list_customer_redeemables_created_at_conditions import ParameterFiltersListCustomerRedeemablesCreatedAtConditions +from voucherify.models.filter_conditions_date_time import FilterConditionsDateTime from typing import Optional, Set from typing_extensions import Self @@ -29,9 +28,8 @@ class ParameterFiltersListCustomerRedeemablesCreatedAt(BaseModel): """ Timestamp representing the date and time when the customer redeemable was created. The value is shown in the ISO 8601 format. """ # noqa: E501 - conditions: Optional[ParameterFiltersListCustomerRedeemablesCreatedAtConditions] = None - junction: Optional[Junction] = None - __properties: ClassVar[List[str]] = ["conditions", "junction"] + conditions: Optional[FilterConditionsDateTime] = None + __properties: ClassVar[List[str]] = ["conditions"] model_config = ConfigDict( populate_by_name=True, @@ -75,11 +73,6 @@ def to_dict(self) -> Dict[str, Any]: # override the default output from pydantic by calling `to_dict()` of conditions if self.conditions: _dict['conditions'] = self.conditions.to_dict() - # set to None if conditions (nullable) is None - # and model_fields_set contains the field - if self.conditions is None and "conditions" in self.model_fields_set: - _dict['conditions'] = None - return _dict @classmethod @@ -92,8 +85,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: return cls.model_validate(obj) _obj = cls.model_validate({ - "conditions": ParameterFiltersListCustomerRedeemablesCreatedAtConditions.from_dict(obj["conditions"]) if obj.get("conditions") is not None else None, - "junction": obj.get("junction") + "conditions": FilterConditionsDateTime.from_dict(obj["conditions"]) if obj.get("conditions") is not None else None }) return _obj diff --git a/voucherify/models/parameter_filters_list_customer_redeemables_holder_role.py b/voucherify/models/parameter_filters_list_customer_redeemables_holder_role.py index b7fce07a..30598bdb 100644 --- a/voucherify/models/parameter_filters_list_customer_redeemables_holder_role.py +++ b/voucherify/models/parameter_filters_list_customer_redeemables_holder_role.py @@ -20,7 +20,6 @@ from pydantic import BaseModel, ConfigDict from typing import Any, ClassVar, Dict, List, Optional -from voucherify.models.junction import Junction from voucherify.models.parameter_filters_list_customer_redeemables_holder_role_conditions import ParameterFiltersListCustomerRedeemablesHolderRoleConditions from typing import Optional, Set from typing_extensions import Self @@ -30,8 +29,7 @@ class ParameterFiltersListCustomerRedeemablesHolderRole(BaseModel): Holder role of the redeemable. Allowed values: `OWNER`, `REFEREE`, `REFERRER`. """ # noqa: E501 conditions: Optional[ParameterFiltersListCustomerRedeemablesHolderRoleConditions] = None - junction: Optional[Junction] = None - __properties: ClassVar[List[str]] = ["conditions", "junction"] + __properties: ClassVar[List[str]] = ["conditions"] model_config = ConfigDict( populate_by_name=True, @@ -87,8 +85,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: return cls.model_validate(obj) _obj = cls.model_validate({ - "conditions": ParameterFiltersListCustomerRedeemablesHolderRoleConditions.from_dict(obj["conditions"]) if obj.get("conditions") is not None else None, - "junction": obj.get("junction") + "conditions": ParameterFiltersListCustomerRedeemablesHolderRoleConditions.from_dict(obj["conditions"]) if obj.get("conditions") is not None else None }) return _obj diff --git a/voucherify/models/parameter_filters_list_customer_redeemables_id.py b/voucherify/models/parameter_filters_list_customer_redeemables_id.py index f940c0a4..4c1c9dbc 100644 --- a/voucherify/models/parameter_filters_list_customer_redeemables_id.py +++ b/voucherify/models/parameter_filters_list_customer_redeemables_id.py @@ -21,7 +21,6 @@ from pydantic import BaseModel, ConfigDict from typing import Any, ClassVar, Dict, List, Optional from voucherify.models.filter_conditions_string import FilterConditionsString -from voucherify.models.junction import Junction from typing import Optional, Set from typing_extensions import Self @@ -30,8 +29,7 @@ class ParameterFiltersListCustomerRedeemablesId(BaseModel): Unique redeemable holder ID, i.e. `rh_0e77502f84f0f4a6a8`. """ # noqa: E501 conditions: Optional[FilterConditionsString] = None - junction: Optional[Junction] = None - __properties: ClassVar[List[str]] = ["conditions", "junction"] + __properties: ClassVar[List[str]] = ["conditions"] model_config = ConfigDict( populate_by_name=True, @@ -87,8 +85,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: return cls.model_validate(obj) _obj = cls.model_validate({ - "conditions": FilterConditionsString.from_dict(obj["conditions"]) if obj.get("conditions") is not None else None, - "junction": obj.get("junction") + "conditions": FilterConditionsString.from_dict(obj["conditions"]) if obj.get("conditions") is not None else None }) return _obj diff --git a/voucherify/models/parameter_filters_list_customer_redeemables_redeemable_id.py b/voucherify/models/parameter_filters_list_customer_redeemables_redeemable_id.py index 0fa74f66..75afb377 100644 --- a/voucherify/models/parameter_filters_list_customer_redeemables_redeemable_id.py +++ b/voucherify/models/parameter_filters_list_customer_redeemables_redeemable_id.py @@ -21,7 +21,6 @@ from pydantic import BaseModel, ConfigDict from typing import Any, ClassVar, Dict, List, Optional from voucherify.models.filter_conditions_string import FilterConditionsString -from voucherify.models.junction import Junction from typing import Optional, Set from typing_extensions import Self @@ -30,8 +29,7 @@ class ParameterFiltersListCustomerRedeemablesRedeemableId(BaseModel): Unique redeemable ID, e.g. `v_hS8JFl8S6lNcd1L69wLIoXgTio7eWEgk`. """ # noqa: E501 conditions: Optional[FilterConditionsString] = None - junction: Optional[Junction] = None - __properties: ClassVar[List[str]] = ["conditions", "junction"] + __properties: ClassVar[List[str]] = ["conditions"] model_config = ConfigDict( populate_by_name=True, @@ -87,8 +85,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: return cls.model_validate(obj) _obj = cls.model_validate({ - "conditions": FilterConditionsString.from_dict(obj["conditions"]) if obj.get("conditions") is not None else None, - "junction": obj.get("junction") + "conditions": FilterConditionsString.from_dict(obj["conditions"]) if obj.get("conditions") is not None else None }) return _obj diff --git a/voucherify/models/parameter_filters_list_customer_redeemables_redeemable_object.py b/voucherify/models/parameter_filters_list_customer_redeemables_redeemable_object.py index ff1d5417..fb0516c7 100644 --- a/voucherify/models/parameter_filters_list_customer_redeemables_redeemable_object.py +++ b/voucherify/models/parameter_filters_list_customer_redeemables_redeemable_object.py @@ -20,7 +20,6 @@ from pydantic import BaseModel, ConfigDict from typing import Any, ClassVar, Dict, List, Optional -from voucherify.models.junction import Junction from voucherify.models.parameter_filters_list_customer_redeemables_redeemable_object_conditions import ParameterFiltersListCustomerRedeemablesRedeemableObjectConditions from typing import Optional, Set from typing_extensions import Self @@ -30,8 +29,7 @@ class ParameterFiltersListCustomerRedeemablesRedeemableObject(BaseModel): Unique related object, i.e. `voucher`. """ # noqa: E501 conditions: Optional[ParameterFiltersListCustomerRedeemablesRedeemableObjectConditions] = None - junction: Optional[Junction] = None - __properties: ClassVar[List[str]] = ["conditions", "junction"] + __properties: ClassVar[List[str]] = ["conditions"] model_config = ConfigDict( populate_by_name=True, @@ -87,8 +85,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: return cls.model_validate(obj) _obj = cls.model_validate({ - "conditions": ParameterFiltersListCustomerRedeemablesRedeemableObjectConditions.from_dict(obj["conditions"]) if obj.get("conditions") is not None else None, - "junction": obj.get("junction") + "conditions": ParameterFiltersListCustomerRedeemablesRedeemableObjectConditions.from_dict(obj["conditions"]) if obj.get("conditions") is not None else None }) return _obj diff --git a/voucherify/models/parameter_filters_list_customer_redeemables_voucher_type.py b/voucherify/models/parameter_filters_list_customer_redeemables_voucher_type.py index fef821da..41f9f8b9 100644 --- a/voucherify/models/parameter_filters_list_customer_redeemables_voucher_type.py +++ b/voucherify/models/parameter_filters_list_customer_redeemables_voucher_type.py @@ -20,7 +20,6 @@ from pydantic import BaseModel, ConfigDict from typing import Any, ClassVar, Dict, List, Optional -from voucherify.models.junction import Junction from voucherify.models.parameter_filters_list_customer_redeemables_voucher_type_conditions import ParameterFiltersListCustomerRedeemablesVoucherTypeConditions from typing import Optional, Set from typing_extensions import Self @@ -30,8 +29,7 @@ class ParameterFiltersListCustomerRedeemablesVoucherType(BaseModel): Type of the voucher. Allowed values: `DISCOUNT_VOUCHER`, `GIFT_VOUCHER`, `LOYALTY_CARD`. """ # noqa: E501 conditions: Optional[ParameterFiltersListCustomerRedeemablesVoucherTypeConditions] = None - junction: Optional[Junction] = None - __properties: ClassVar[List[str]] = ["conditions", "junction"] + __properties: ClassVar[List[str]] = ["conditions"] model_config = ConfigDict( populate_by_name=True, @@ -87,8 +85,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: return cls.model_validate(obj) _obj = cls.model_validate({ - "conditions": ParameterFiltersListCustomerRedeemablesVoucherTypeConditions.from_dict(obj["conditions"]) if obj.get("conditions") is not None else None, - "junction": obj.get("junction") + "conditions": ParameterFiltersListCustomerRedeemablesVoucherTypeConditions.from_dict(obj["conditions"]) if obj.get("conditions") is not None else None }) return _obj diff --git a/voucherify/models/parameter_filters_list_publications.py b/voucherify/models/parameter_filters_list_publications.py new file mode 100644 index 00000000..efe5f931 --- /dev/null +++ b/voucherify/models/parameter_filters_list_publications.py @@ -0,0 +1,188 @@ +# coding: utf-8 + +""" + Voucherify API + + Voucherify promotion engine REST API. Please see https://docs.voucherify.io/docs for more details. + + The version of the OpenAPI document: v2018-08-01 + Contact: support@voucherify.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict +from typing import Any, ClassVar, Dict, List, Optional +from voucherify.models.junction import Junction +from voucherify.models.parameter_filters_list_publications_campaign_name import ParameterFiltersListPublicationsCampaignName +from voucherify.models.parameter_filters_list_publications_customer_id import ParameterFiltersListPublicationsCustomerId +from voucherify.models.parameter_filters_list_publications_failure_code import ParameterFiltersListPublicationsFailureCode +from voucherify.models.parameter_filters_list_publications_is_referral_code import ParameterFiltersListPublicationsIsReferralCode +from voucherify.models.parameter_filters_list_publications_parent_object_id import ParameterFiltersListPublicationsParentObjectId +from voucherify.models.parameter_filters_list_publications_related_object_id import ParameterFiltersListPublicationsRelatedObjectId +from voucherify.models.parameter_filters_list_publications_result import ParameterFiltersListPublicationsResult +from voucherify.models.parameter_filters_list_publications_source_id import ParameterFiltersListPublicationsSourceId +from voucherify.models.parameter_filters_list_publications_voucher_type import ParameterFiltersListPublicationsVoucherType +from typing import Optional, Set +from typing_extensions import Self + +class ParameterFiltersListPublications(BaseModel): + """ + ParameterFiltersListPublications + """ # noqa: E501 + junction: Optional[Junction] = None + failure_code: Optional[ParameterFiltersListPublicationsFailureCode] = None + result: Optional[ParameterFiltersListPublicationsResult] = None + customer_id: Optional[ParameterFiltersListPublicationsCustomerId] = None + campaign_name: Optional[ParameterFiltersListPublicationsCampaignName] = None + voucher_type: Optional[ParameterFiltersListPublicationsVoucherType] = None + is_referral_code: Optional[ParameterFiltersListPublicationsIsReferralCode] = None + parent_object_id: Optional[ParameterFiltersListPublicationsParentObjectId] = None + related_object_id: Optional[ParameterFiltersListPublicationsRelatedObjectId] = None + source_id: Optional[ParameterFiltersListPublicationsSourceId] = None + __properties: ClassVar[List[str]] = ["junction", "failure_code", "result", "customer_id", "campaign_name", "voucher_type", "is_referral_code", "parent_object_id", "related_object_id", "source_id"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ParameterFiltersListPublications from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of failure_code + if self.failure_code: + _dict['failure_code'] = self.failure_code.to_dict() + # override the default output from pydantic by calling `to_dict()` of result + if self.result: + _dict['result'] = self.result.to_dict() + # override the default output from pydantic by calling `to_dict()` of customer_id + if self.customer_id: + _dict['customer_id'] = self.customer_id.to_dict() + # override the default output from pydantic by calling `to_dict()` of campaign_name + if self.campaign_name: + _dict['campaign_name'] = self.campaign_name.to_dict() + # override the default output from pydantic by calling `to_dict()` of voucher_type + if self.voucher_type: + _dict['voucher_type'] = self.voucher_type.to_dict() + # override the default output from pydantic by calling `to_dict()` of is_referral_code + if self.is_referral_code: + _dict['is_referral_code'] = self.is_referral_code.to_dict() + # override the default output from pydantic by calling `to_dict()` of parent_object_id + if self.parent_object_id: + _dict['parent_object_id'] = self.parent_object_id.to_dict() + # override the default output from pydantic by calling `to_dict()` of related_object_id + if self.related_object_id: + _dict['related_object_id'] = self.related_object_id.to_dict() + # override the default output from pydantic by calling `to_dict()` of source_id + if self.source_id: + _dict['source_id'] = self.source_id.to_dict() + # set to None if failure_code (nullable) is None + # and model_fields_set contains the field + if self.failure_code is None and "failure_code" in self.model_fields_set: + _dict['failure_code'] = None + + # set to None if result (nullable) is None + # and model_fields_set contains the field + if self.result is None and "result" in self.model_fields_set: + _dict['result'] = None + + # set to None if customer_id (nullable) is None + # and model_fields_set contains the field + if self.customer_id is None and "customer_id" in self.model_fields_set: + _dict['customer_id'] = None + + # set to None if campaign_name (nullable) is None + # and model_fields_set contains the field + if self.campaign_name is None and "campaign_name" in self.model_fields_set: + _dict['campaign_name'] = None + + # set to None if voucher_type (nullable) is None + # and model_fields_set contains the field + if self.voucher_type is None and "voucher_type" in self.model_fields_set: + _dict['voucher_type'] = None + + # set to None if is_referral_code (nullable) is None + # and model_fields_set contains the field + if self.is_referral_code is None and "is_referral_code" in self.model_fields_set: + _dict['is_referral_code'] = None + + # set to None if parent_object_id (nullable) is None + # and model_fields_set contains the field + if self.parent_object_id is None and "parent_object_id" in self.model_fields_set: + _dict['parent_object_id'] = None + + # set to None if related_object_id (nullable) is None + # and model_fields_set contains the field + if self.related_object_id is None and "related_object_id" in self.model_fields_set: + _dict['related_object_id'] = None + + # set to None if source_id (nullable) is None + # and model_fields_set contains the field + if self.source_id is None and "source_id" in self.model_fields_set: + _dict['source_id'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ParameterFiltersListPublications from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "junction": obj.get("junction"), + "failure_code": ParameterFiltersListPublicationsFailureCode.from_dict(obj["failure_code"]) if obj.get("failure_code") is not None else None, + "result": ParameterFiltersListPublicationsResult.from_dict(obj["result"]) if obj.get("result") is not None else None, + "customer_id": ParameterFiltersListPublicationsCustomerId.from_dict(obj["customer_id"]) if obj.get("customer_id") is not None else None, + "campaign_name": ParameterFiltersListPublicationsCampaignName.from_dict(obj["campaign_name"]) if obj.get("campaign_name") is not None else None, + "voucher_type": ParameterFiltersListPublicationsVoucherType.from_dict(obj["voucher_type"]) if obj.get("voucher_type") is not None else None, + "is_referral_code": ParameterFiltersListPublicationsIsReferralCode.from_dict(obj["is_referral_code"]) if obj.get("is_referral_code") is not None else None, + "parent_object_id": ParameterFiltersListPublicationsParentObjectId.from_dict(obj["parent_object_id"]) if obj.get("parent_object_id") is not None else None, + "related_object_id": ParameterFiltersListPublicationsRelatedObjectId.from_dict(obj["related_object_id"]) if obj.get("related_object_id") is not None else None, + "source_id": ParameterFiltersListPublicationsSourceId.from_dict(obj["source_id"]) if obj.get("source_id") is not None else None + }) + return _obj + + diff --git a/voucherify/models/parameter_filters_list_publications_campaign_name.py b/voucherify/models/parameter_filters_list_publications_campaign_name.py new file mode 100644 index 00000000..c3ac5493 --- /dev/null +++ b/voucherify/models/parameter_filters_list_publications_campaign_name.py @@ -0,0 +1,92 @@ +# coding: utf-8 + +""" + Voucherify API + + Voucherify promotion engine REST API. Please see https://docs.voucherify.io/docs for more details. + + The version of the OpenAPI document: v2018-08-01 + Contact: support@voucherify.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict +from typing import Any, ClassVar, Dict, List, Optional +from voucherify.models.filter_conditions_string import FilterConditionsString +from typing import Optional, Set +from typing_extensions import Self + +class ParameterFiltersListPublicationsCampaignName(BaseModel): + """ + Filter publications by campaign names. + """ # noqa: E501 + conditions: Optional[FilterConditionsString] = None + __properties: ClassVar[List[str]] = ["conditions"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ParameterFiltersListPublicationsCampaignName from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of conditions + if self.conditions: + _dict['conditions'] = self.conditions.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ParameterFiltersListPublicationsCampaignName from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "conditions": FilterConditionsString.from_dict(obj["conditions"]) if obj.get("conditions") is not None else None + }) + return _obj + + diff --git a/voucherify/models/parameter_filters_list_publications_customer_id.py b/voucherify/models/parameter_filters_list_publications_customer_id.py new file mode 100644 index 00000000..0ed0e3fe --- /dev/null +++ b/voucherify/models/parameter_filters_list_publications_customer_id.py @@ -0,0 +1,92 @@ +# coding: utf-8 + +""" + Voucherify API + + Voucherify promotion engine REST API. Please see https://docs.voucherify.io/docs for more details. + + The version of the OpenAPI document: v2018-08-01 + Contact: support@voucherify.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict +from typing import Any, ClassVar, Dict, List, Optional +from voucherify.models.filter_conditions_string import FilterConditionsString +from typing import Optional, Set +from typing_extensions import Self + +class ParameterFiltersListPublicationsCustomerId(BaseModel): + """ + Filter publications by customer ids. + """ # noqa: E501 + conditions: Optional[FilterConditionsString] = None + __properties: ClassVar[List[str]] = ["conditions"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ParameterFiltersListPublicationsCustomerId from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of conditions + if self.conditions: + _dict['conditions'] = self.conditions.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ParameterFiltersListPublicationsCustomerId from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "conditions": FilterConditionsString.from_dict(obj["conditions"]) if obj.get("conditions") is not None else None + }) + return _obj + + diff --git a/voucherify/models/parameter_filters_list_publications_failure_code.py b/voucherify/models/parameter_filters_list_publications_failure_code.py new file mode 100644 index 00000000..46fb5e19 --- /dev/null +++ b/voucherify/models/parameter_filters_list_publications_failure_code.py @@ -0,0 +1,92 @@ +# coding: utf-8 + +""" + Voucherify API + + Voucherify promotion engine REST API. Please see https://docs.voucherify.io/docs for more details. + + The version of the OpenAPI document: v2018-08-01 + Contact: support@voucherify.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict +from typing import Any, ClassVar, Dict, List, Optional +from voucherify.models.filter_conditions_string import FilterConditionsString +from typing import Optional, Set +from typing_extensions import Self + +class ParameterFiltersListPublicationsFailureCode(BaseModel): + """ + Filter publications by ids. + """ # noqa: E501 + conditions: Optional[FilterConditionsString] = None + __properties: ClassVar[List[str]] = ["conditions"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ParameterFiltersListPublicationsFailureCode from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of conditions + if self.conditions: + _dict['conditions'] = self.conditions.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ParameterFiltersListPublicationsFailureCode from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "conditions": FilterConditionsString.from_dict(obj["conditions"]) if obj.get("conditions") is not None else None + }) + return _obj + + diff --git a/voucherify/models/parameter_filters_list_publications_is_referral_code.py b/voucherify/models/parameter_filters_list_publications_is_referral_code.py new file mode 100644 index 00000000..723de254 --- /dev/null +++ b/voucherify/models/parameter_filters_list_publications_is_referral_code.py @@ -0,0 +1,92 @@ +# coding: utf-8 + +""" + Voucherify API + + Voucherify promotion engine REST API. Please see https://docs.voucherify.io/docs for more details. + + The version of the OpenAPI document: v2018-08-01 + Contact: support@voucherify.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict +from typing import Any, ClassVar, Dict, List, Optional +from voucherify.models.filter_conditions_string import FilterConditionsString +from typing import Optional, Set +from typing_extensions import Self + +class ParameterFiltersListPublicationsIsReferralCode(BaseModel): + """ + Filter publications by is referall code. + """ # noqa: E501 + conditions: Optional[FilterConditionsString] = None + __properties: ClassVar[List[str]] = ["conditions"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ParameterFiltersListPublicationsIsReferralCode from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of conditions + if self.conditions: + _dict['conditions'] = self.conditions.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ParameterFiltersListPublicationsIsReferralCode from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "conditions": FilterConditionsString.from_dict(obj["conditions"]) if obj.get("conditions") is not None else None + }) + return _obj + + diff --git a/voucherify/models/parameter_filters_list_publications_parent_object_id.py b/voucherify/models/parameter_filters_list_publications_parent_object_id.py new file mode 100644 index 00000000..40314028 --- /dev/null +++ b/voucherify/models/parameter_filters_list_publications_parent_object_id.py @@ -0,0 +1,92 @@ +# coding: utf-8 + +""" + Voucherify API + + Voucherify promotion engine REST API. Please see https://docs.voucherify.io/docs for more details. + + The version of the OpenAPI document: v2018-08-01 + Contact: support@voucherify.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict +from typing import Any, ClassVar, Dict, List, Optional +from voucherify.models.filter_conditions_string import FilterConditionsString +from typing import Optional, Set +from typing_extensions import Self + +class ParameterFiltersListPublicationsParentObjectId(BaseModel): + """ + Filter publications by parent object id. + """ # noqa: E501 + conditions: Optional[FilterConditionsString] = None + __properties: ClassVar[List[str]] = ["conditions"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ParameterFiltersListPublicationsParentObjectId from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of conditions + if self.conditions: + _dict['conditions'] = self.conditions.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ParameterFiltersListPublicationsParentObjectId from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "conditions": FilterConditionsString.from_dict(obj["conditions"]) if obj.get("conditions") is not None else None + }) + return _obj + + diff --git a/voucherify/models/parameter_filters_list_publications_related_object_id.py b/voucherify/models/parameter_filters_list_publications_related_object_id.py new file mode 100644 index 00000000..daac3a34 --- /dev/null +++ b/voucherify/models/parameter_filters_list_publications_related_object_id.py @@ -0,0 +1,92 @@ +# coding: utf-8 + +""" + Voucherify API + + Voucherify promotion engine REST API. Please see https://docs.voucherify.io/docs for more details. + + The version of the OpenAPI document: v2018-08-01 + Contact: support@voucherify.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict +from typing import Any, ClassVar, Dict, List, Optional +from voucherify.models.filter_conditions_string import FilterConditionsString +from typing import Optional, Set +from typing_extensions import Self + +class ParameterFiltersListPublicationsRelatedObjectId(BaseModel): + """ + Filter publications by related object id. + """ # noqa: E501 + conditions: Optional[FilterConditionsString] = None + __properties: ClassVar[List[str]] = ["conditions"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ParameterFiltersListPublicationsRelatedObjectId from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of conditions + if self.conditions: + _dict['conditions'] = self.conditions.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ParameterFiltersListPublicationsRelatedObjectId from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "conditions": FilterConditionsString.from_dict(obj["conditions"]) if obj.get("conditions") is not None else None + }) + return _obj + + diff --git a/voucherify/models/parameter_filters_list_publications_result.py b/voucherify/models/parameter_filters_list_publications_result.py new file mode 100644 index 00000000..86bd8b13 --- /dev/null +++ b/voucherify/models/parameter_filters_list_publications_result.py @@ -0,0 +1,92 @@ +# coding: utf-8 + +""" + Voucherify API + + Voucherify promotion engine REST API. Please see https://docs.voucherify.io/docs for more details. + + The version of the OpenAPI document: v2018-08-01 + Contact: support@voucherify.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict +from typing import Any, ClassVar, Dict, List, Optional +from voucherify.models.filter_conditions_string import FilterConditionsString +from typing import Optional, Set +from typing_extensions import Self + +class ParameterFiltersListPublicationsResult(BaseModel): + """ + Filter publications by names. + """ # noqa: E501 + conditions: Optional[FilterConditionsString] = None + __properties: ClassVar[List[str]] = ["conditions"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ParameterFiltersListPublicationsResult from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of conditions + if self.conditions: + _dict['conditions'] = self.conditions.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ParameterFiltersListPublicationsResult from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "conditions": FilterConditionsString.from_dict(obj["conditions"]) if obj.get("conditions") is not None else None + }) + return _obj + + diff --git a/voucherify/models/parameter_filters_list_publications_source_id.py b/voucherify/models/parameter_filters_list_publications_source_id.py new file mode 100644 index 00000000..17327b68 --- /dev/null +++ b/voucherify/models/parameter_filters_list_publications_source_id.py @@ -0,0 +1,92 @@ +# coding: utf-8 + +""" + Voucherify API + + Voucherify promotion engine REST API. Please see https://docs.voucherify.io/docs for more details. + + The version of the OpenAPI document: v2018-08-01 + Contact: support@voucherify.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict +from typing import Any, ClassVar, Dict, List, Optional +from voucherify.models.filter_conditions_string import FilterConditionsString +from typing import Optional, Set +from typing_extensions import Self + +class ParameterFiltersListPublicationsSourceId(BaseModel): + """ + Filter publications by source id. + """ # noqa: E501 + conditions: Optional[FilterConditionsString] = None + __properties: ClassVar[List[str]] = ["conditions"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ParameterFiltersListPublicationsSourceId from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of conditions + if self.conditions: + _dict['conditions'] = self.conditions.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ParameterFiltersListPublicationsSourceId from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "conditions": FilterConditionsString.from_dict(obj["conditions"]) if obj.get("conditions") is not None else None + }) + return _obj + + diff --git a/voucherify/models/parameter_filters_list_publications_voucher_type.py b/voucherify/models/parameter_filters_list_publications_voucher_type.py new file mode 100644 index 00000000..c83b0a7c --- /dev/null +++ b/voucherify/models/parameter_filters_list_publications_voucher_type.py @@ -0,0 +1,92 @@ +# coding: utf-8 + +""" + Voucherify API + + Voucherify promotion engine REST API. Please see https://docs.voucherify.io/docs for more details. + + The version of the OpenAPI document: v2018-08-01 + Contact: support@voucherify.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict +from typing import Any, ClassVar, Dict, List, Optional +from voucherify.models.filter_conditions_string import FilterConditionsString +from typing import Optional, Set +from typing_extensions import Self + +class ParameterFiltersListPublicationsVoucherType(BaseModel): + """ + Filter publications by voucher types. + """ # noqa: E501 + conditions: Optional[FilterConditionsString] = None + __properties: ClassVar[List[str]] = ["conditions"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ParameterFiltersListPublicationsVoucherType from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of conditions + if self.conditions: + _dict['conditions'] = self.conditions.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ParameterFiltersListPublicationsVoucherType from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "conditions": FilterConditionsString.from_dict(obj["conditions"]) if obj.get("conditions") is not None else None + }) + return _obj + + diff --git a/voucherify/models/parameter_filters_list_redemptions.py b/voucherify/models/parameter_filters_list_redemptions.py index 53dbb7f6..b53ea013 100644 --- a/voucherify/models/parameter_filters_list_redemptions.py +++ b/voucherify/models/parameter_filters_list_redemptions.py @@ -20,6 +20,7 @@ from pydantic import BaseModel, ConfigDict from typing import Any, ClassVar, Dict, List, Optional +from voucherify.models.junction import Junction from voucherify.models.parameter_filters_list_redemptions_campaign_name import ParameterFiltersListRedemptionsCampaignName from voucherify.models.parameter_filters_list_redemptions_customer_id import ParameterFiltersListRedemptionsCustomerId from voucherify.models.parameter_filters_list_redemptions_failure_code import ParameterFiltersListRedemptionsFailureCode @@ -47,7 +48,8 @@ class ParameterFiltersListRedemptions(BaseModel): customer_id: Optional[ParameterFiltersListRedemptionsCustomerId] = None campaign_name: Optional[ParameterFiltersListRedemptionsCampaignName] = None user_login: Optional[ParameterFiltersListRedemptionsUserLogin] = None - __properties: ClassVar[List[str]] = ["voucher_code", "related_object_id", "related_object_parent_id", "parent_redemption_id", "failure_code", "result", "object", "customer_id", "campaign_name", "user_login"] + junction: Optional[Junction] = None + __properties: ClassVar[List[str]] = ["voucher_code", "related_object_id", "related_object_parent_id", "parent_redemption_id", "failure_code", "result", "object", "customer_id", "campaign_name", "user_login", "junction"] model_config = ConfigDict( populate_by_name=True, @@ -189,7 +191,8 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "object": ParameterFiltersListRedemptionsObject.from_dict(obj["object"]) if obj.get("object") is not None else None, "customer_id": ParameterFiltersListRedemptionsCustomerId.from_dict(obj["customer_id"]) if obj.get("customer_id") is not None else None, "campaign_name": ParameterFiltersListRedemptionsCampaignName.from_dict(obj["campaign_name"]) if obj.get("campaign_name") is not None else None, - "user_login": ParameterFiltersListRedemptionsUserLogin.from_dict(obj["user_login"]) if obj.get("user_login") is not None else None + "user_login": ParameterFiltersListRedemptionsUserLogin.from_dict(obj["user_login"]) if obj.get("user_login") is not None else None, + "junction": obj.get("junction") }) return _obj diff --git a/voucherify/models/parameter_filters_list_redemptions_campaign_name.py b/voucherify/models/parameter_filters_list_redemptions_campaign_name.py index 5c99ed09..22d61c14 100644 --- a/voucherify/models/parameter_filters_list_redemptions_campaign_name.py +++ b/voucherify/models/parameter_filters_list_redemptions_campaign_name.py @@ -21,7 +21,6 @@ from pydantic import BaseModel, ConfigDict from typing import Any, ClassVar, Dict, List, Optional from voucherify.models.filter_conditions_string import FilterConditionsString -from voucherify.models.junction import Junction from typing import Optional, Set from typing_extensions import Self @@ -30,8 +29,7 @@ class ParameterFiltersListRedemptionsCampaignName(BaseModel): Campaign name. """ # noqa: E501 conditions: Optional[FilterConditionsString] = None - junction: Optional[Junction] = None - __properties: ClassVar[List[str]] = ["conditions", "junction"] + __properties: ClassVar[List[str]] = ["conditions"] model_config = ConfigDict( populate_by_name=True, @@ -87,8 +85,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: return cls.model_validate(obj) _obj = cls.model_validate({ - "conditions": FilterConditionsString.from_dict(obj["conditions"]) if obj.get("conditions") is not None else None, - "junction": obj.get("junction") + "conditions": FilterConditionsString.from_dict(obj["conditions"]) if obj.get("conditions") is not None else None }) return _obj diff --git a/voucherify/models/parameter_filters_list_redemptions_customer_id.py b/voucherify/models/parameter_filters_list_redemptions_customer_id.py index 411703cb..32e58295 100644 --- a/voucherify/models/parameter_filters_list_redemptions_customer_id.py +++ b/voucherify/models/parameter_filters_list_redemptions_customer_id.py @@ -21,7 +21,6 @@ from pydantic import BaseModel, ConfigDict from typing import Any, ClassVar, Dict, List, Optional from voucherify.models.filter_conditions_string import FilterConditionsString -from voucherify.models.junction import Junction from typing import Optional, Set from typing_extensions import Self @@ -30,8 +29,7 @@ class ParameterFiltersListRedemptionsCustomerId(BaseModel): Unique customer ID, i.e. cust_sehkNIi8Uq2qQuRqSr7xn4Zi. """ # noqa: E501 conditions: Optional[FilterConditionsString] = None - junction: Optional[Junction] = None - __properties: ClassVar[List[str]] = ["conditions", "junction"] + __properties: ClassVar[List[str]] = ["conditions"] model_config = ConfigDict( populate_by_name=True, @@ -87,8 +85,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: return cls.model_validate(obj) _obj = cls.model_validate({ - "conditions": FilterConditionsString.from_dict(obj["conditions"]) if obj.get("conditions") is not None else None, - "junction": obj.get("junction") + "conditions": FilterConditionsString.from_dict(obj["conditions"]) if obj.get("conditions") is not None else None }) return _obj diff --git a/voucherify/models/parameter_filters_list_redemptions_failure_code.py b/voucherify/models/parameter_filters_list_redemptions_failure_code.py index b1757be8..7fa86cce 100644 --- a/voucherify/models/parameter_filters_list_redemptions_failure_code.py +++ b/voucherify/models/parameter_filters_list_redemptions_failure_code.py @@ -21,7 +21,6 @@ from pydantic import BaseModel, ConfigDict from typing import Any, ClassVar, Dict, List, Optional from voucherify.models.filter_conditions_string import FilterConditionsString -from voucherify.models.junction import Junction from typing import Optional, Set from typing_extensions import Self @@ -30,8 +29,7 @@ class ParameterFiltersListRedemptionsFailureCode(BaseModel): Failure code, i.e. quantity_exceeded. """ # noqa: E501 conditions: Optional[FilterConditionsString] = None - junction: Optional[Junction] = None - __properties: ClassVar[List[str]] = ["conditions", "junction"] + __properties: ClassVar[List[str]] = ["conditions"] model_config = ConfigDict( populate_by_name=True, @@ -87,8 +85,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: return cls.model_validate(obj) _obj = cls.model_validate({ - "conditions": FilterConditionsString.from_dict(obj["conditions"]) if obj.get("conditions") is not None else None, - "junction": obj.get("junction") + "conditions": FilterConditionsString.from_dict(obj["conditions"]) if obj.get("conditions") is not None else None }) return _obj diff --git a/voucherify/models/parameter_filters_list_redemptions_object.py b/voucherify/models/parameter_filters_list_redemptions_object.py index 8cc0966e..e19989f2 100644 --- a/voucherify/models/parameter_filters_list_redemptions_object.py +++ b/voucherify/models/parameter_filters_list_redemptions_object.py @@ -21,7 +21,6 @@ from pydantic import BaseModel, ConfigDict from typing import Any, ClassVar, Dict, List, Optional from voucherify.models.filter_conditions_string import FilterConditionsString -from voucherify.models.junction import Junction from typing import Optional, Set from typing_extensions import Self @@ -30,8 +29,7 @@ class ParameterFiltersListRedemptionsObject(BaseModel): Specify which type of object to return, i.e. `redemption` or `redemption_rollback`. """ # noqa: E501 conditions: Optional[FilterConditionsString] = None - junction: Optional[Junction] = None - __properties: ClassVar[List[str]] = ["conditions", "junction"] + __properties: ClassVar[List[str]] = ["conditions"] model_config = ConfigDict( populate_by_name=True, @@ -87,8 +85,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: return cls.model_validate(obj) _obj = cls.model_validate({ - "conditions": FilterConditionsString.from_dict(obj["conditions"]) if obj.get("conditions") is not None else None, - "junction": obj.get("junction") + "conditions": FilterConditionsString.from_dict(obj["conditions"]) if obj.get("conditions") is not None else None }) return _obj diff --git a/voucherify/models/parameter_filters_list_redemptions_parent_redemption_id.py b/voucherify/models/parameter_filters_list_redemptions_parent_redemption_id.py index 80a48994..bc5ee007 100644 --- a/voucherify/models/parameter_filters_list_redemptions_parent_redemption_id.py +++ b/voucherify/models/parameter_filters_list_redemptions_parent_redemption_id.py @@ -21,7 +21,6 @@ from pydantic import BaseModel, ConfigDict from typing import Any, ClassVar, Dict, List, Optional from voucherify.models.filter_conditions_string import FilterConditionsString -from voucherify.models.junction import Junction from typing import Optional, Set from typing_extensions import Self @@ -30,8 +29,7 @@ class ParameterFiltersListRedemptionsParentRedemptionId(BaseModel): Unique parent redemption ID, i.e. r_0c5952900bcbfd54b6. """ # noqa: E501 conditions: Optional[FilterConditionsString] = None - junction: Optional[Junction] = None - __properties: ClassVar[List[str]] = ["conditions", "junction"] + __properties: ClassVar[List[str]] = ["conditions"] model_config = ConfigDict( populate_by_name=True, @@ -87,8 +85,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: return cls.model_validate(obj) _obj = cls.model_validate({ - "conditions": FilterConditionsString.from_dict(obj["conditions"]) if obj.get("conditions") is not None else None, - "junction": obj.get("junction") + "conditions": FilterConditionsString.from_dict(obj["conditions"]) if obj.get("conditions") is not None else None }) return _obj diff --git a/voucherify/models/parameter_filters_list_redemptions_related_object_id.py b/voucherify/models/parameter_filters_list_redemptions_related_object_id.py index 25cb60e6..b10208b1 100644 --- a/voucherify/models/parameter_filters_list_redemptions_related_object_id.py +++ b/voucherify/models/parameter_filters_list_redemptions_related_object_id.py @@ -21,7 +21,6 @@ from pydantic import BaseModel, ConfigDict from typing import Any, ClassVar, Dict, List, Optional from voucherify.models.filter_conditions_string import FilterConditionsString -from voucherify.models.junction import Junction from typing import Optional, Set from typing_extensions import Self @@ -30,8 +29,7 @@ class ParameterFiltersListRedemptionsRelatedObjectId(BaseModel): Unique related object ID, i.e. v_hS8JFl8S6lNcd1L69wLIoXgTio7eWEgk. """ # noqa: E501 conditions: Optional[FilterConditionsString] = None - junction: Optional[Junction] = None - __properties: ClassVar[List[str]] = ["conditions", "junction"] + __properties: ClassVar[List[str]] = ["conditions"] model_config = ConfigDict( populate_by_name=True, @@ -87,8 +85,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: return cls.model_validate(obj) _obj = cls.model_validate({ - "conditions": FilterConditionsString.from_dict(obj["conditions"]) if obj.get("conditions") is not None else None, - "junction": obj.get("junction") + "conditions": FilterConditionsString.from_dict(obj["conditions"]) if obj.get("conditions") is not None else None }) return _obj diff --git a/voucherify/models/parameter_filters_list_redemptions_related_object_parent_id.py b/voucherify/models/parameter_filters_list_redemptions_related_object_parent_id.py index 1b62da4b..0cf453fe 100644 --- a/voucherify/models/parameter_filters_list_redemptions_related_object_parent_id.py +++ b/voucherify/models/parameter_filters_list_redemptions_related_object_parent_id.py @@ -21,7 +21,6 @@ from pydantic import BaseModel, ConfigDict from typing import Any, ClassVar, Dict, List, Optional from voucherify.models.filter_conditions_string import FilterConditionsString -from voucherify.models.junction import Junction from typing import Optional, Set from typing_extensions import Self @@ -30,8 +29,7 @@ class ParameterFiltersListRedemptionsRelatedObjectParentId(BaseModel): Unique related object parent ID, i.e. camp_22noMlhTADb7Fq2UL3vWu3d1. """ # noqa: E501 conditions: Optional[FilterConditionsString] = None - junction: Optional[Junction] = None - __properties: ClassVar[List[str]] = ["conditions", "junction"] + __properties: ClassVar[List[str]] = ["conditions"] model_config = ConfigDict( populate_by_name=True, @@ -87,8 +85,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: return cls.model_validate(obj) _obj = cls.model_validate({ - "conditions": FilterConditionsString.from_dict(obj["conditions"]) if obj.get("conditions") is not None else None, - "junction": obj.get("junction") + "conditions": FilterConditionsString.from_dict(obj["conditions"]) if obj.get("conditions") is not None else None }) return _obj diff --git a/voucherify/models/parameter_filters_list_redemptions_result.py b/voucherify/models/parameter_filters_list_redemptions_result.py index b30e79a7..6ae601d4 100644 --- a/voucherify/models/parameter_filters_list_redemptions_result.py +++ b/voucherify/models/parameter_filters_list_redemptions_result.py @@ -21,7 +21,6 @@ from pydantic import BaseModel, ConfigDict from typing import Any, ClassVar, Dict, List, Optional from voucherify.models.filter_conditions_string import FilterConditionsString -from voucherify.models.junction import Junction from typing import Optional, Set from typing_extensions import Self @@ -30,8 +29,7 @@ class ParameterFiltersListRedemptionsResult(BaseModel): Result, i.e. `SUCCESS` or `FAILURE`. """ # noqa: E501 conditions: Optional[FilterConditionsString] = None - junction: Optional[Junction] = None - __properties: ClassVar[List[str]] = ["conditions", "junction"] + __properties: ClassVar[List[str]] = ["conditions"] model_config = ConfigDict( populate_by_name=True, @@ -87,8 +85,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: return cls.model_validate(obj) _obj = cls.model_validate({ - "conditions": FilterConditionsString.from_dict(obj["conditions"]) if obj.get("conditions") is not None else None, - "junction": obj.get("junction") + "conditions": FilterConditionsString.from_dict(obj["conditions"]) if obj.get("conditions") is not None else None }) return _obj diff --git a/voucherify/models/parameter_filters_list_redemptions_user_login.py b/voucherify/models/parameter_filters_list_redemptions_user_login.py index 322748df..462a46ef 100644 --- a/voucherify/models/parameter_filters_list_redemptions_user_login.py +++ b/voucherify/models/parameter_filters_list_redemptions_user_login.py @@ -21,7 +21,6 @@ from pydantic import BaseModel, ConfigDict from typing import Any, ClassVar, Dict, List, Optional from voucherify.models.filter_conditions_string import FilterConditionsString -from voucherify.models.junction import Junction from typing import Optional, Set from typing_extensions import Self @@ -30,8 +29,7 @@ class ParameterFiltersListRedemptionsUserLogin(BaseModel): User login used to login to Voucherify, i.e. name.lastname@email.com """ # noqa: E501 conditions: Optional[FilterConditionsString] = None - junction: Optional[Junction] = None - __properties: ClassVar[List[str]] = ["conditions", "junction"] + __properties: ClassVar[List[str]] = ["conditions"] model_config = ConfigDict( populate_by_name=True, @@ -87,8 +85,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: return cls.model_validate(obj) _obj = cls.model_validate({ - "conditions": FilterConditionsString.from_dict(obj["conditions"]) if obj.get("conditions") is not None else None, - "junction": obj.get("junction") + "conditions": FilterConditionsString.from_dict(obj["conditions"]) if obj.get("conditions") is not None else None }) return _obj diff --git a/voucherify/models/parameter_filters_list_redemptions_voucher_code.py b/voucherify/models/parameter_filters_list_redemptions_voucher_code.py index fc42e972..75d7eebb 100644 --- a/voucherify/models/parameter_filters_list_redemptions_voucher_code.py +++ b/voucherify/models/parameter_filters_list_redemptions_voucher_code.py @@ -21,7 +21,6 @@ from pydantic import BaseModel, ConfigDict from typing import Any, ClassVar, Dict, List, Optional from voucherify.models.filter_conditions_string import FilterConditionsString -from voucherify.models.junction import Junction from typing import Optional, Set from typing_extensions import Self @@ -30,8 +29,7 @@ class ParameterFiltersListRedemptionsVoucherCode(BaseModel): Unique voucher code. """ # noqa: E501 conditions: Optional[FilterConditionsString] = None - junction: Optional[Junction] = None - __properties: ClassVar[List[str]] = ["conditions", "junction"] + __properties: ClassVar[List[str]] = ["conditions"] model_config = ConfigDict( populate_by_name=True, @@ -87,8 +85,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: return cls.model_validate(obj) _obj = cls.model_validate({ - "conditions": FilterConditionsString.from_dict(obj["conditions"]) if obj.get("conditions") is not None else None, - "junction": obj.get("junction") + "conditions": FilterConditionsString.from_dict(obj["conditions"]) if obj.get("conditions") is not None else None }) return _obj diff --git a/voucherify/models/parameter_order_list_bin.py b/voucherify/models/parameter_order_list_bin.py new file mode 100644 index 00000000..9b5b81d1 --- /dev/null +++ b/voucherify/models/parameter_order_list_bin.py @@ -0,0 +1,38 @@ +# coding: utf-8 + +""" + Voucherify API + + Voucherify promotion engine REST API. Please see https://docs.voucherify.io/docs for more details. + + The version of the OpenAPI document: v2018-08-01 + Contact: support@voucherify.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import json +from enum import Enum +from typing_extensions import Self + + +class ParameterOrderListBin(str, Enum): + """ + ParameterOrderListBin + """ + + """ + allowed enum values + """ + ID = 'id' + MINUS_ID = '-id' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of ParameterOrderListBin from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/voucherify/models/parameter_voucher_type_list_publications.py b/voucherify/models/parameter_voucher_type_list_publications.py index b8b2beab..ab7571f4 100644 --- a/voucherify/models/parameter_voucher_type_list_publications.py +++ b/voucherify/models/parameter_voucher_type_list_publications.py @@ -29,7 +29,6 @@ class ParameterVoucherTypeListPublications(str, Enum): """ DISCOUNT = 'discount' LOYALTY = 'loyalty' - LUCKY_DRAW = 'lucky_draw' @classmethod def from_json(cls, json_str: str) -> Self: diff --git a/voucherify/models/referral_program_referee_reward.py b/voucherify/models/referral_program_referee_reward.py index 4562b384..f604237b 100644 --- a/voucherify/models/referral_program_referee_reward.py +++ b/voucherify/models/referral_program_referee_reward.py @@ -39,8 +39,8 @@ def type_validate_enum(cls, value): if value is None: return value - if value not in set(['DISCOUNT_VOUCHER', 'LOYALTY_CARD', 'GIFT_VOUCHER', 'LUCKY_DRAW_CODE']): - raise ValueError("must be one of enum values ('DISCOUNT_VOUCHER', 'LOYALTY_CARD', 'GIFT_VOUCHER', 'LUCKY_DRAW_CODE')") + if value not in set(['DISCOUNT_VOUCHER', 'LOYALTY_CARD', 'GIFT_VOUCHER']): + raise ValueError("must be one of enum values ('DISCOUNT_VOUCHER', 'LOYALTY_CARD', 'GIFT_VOUCHER')") return value model_config = ConfigDict( diff --git a/voucherify/models/trash_bin_item.py b/voucherify/models/trash_bin_item.py new file mode 100644 index 00000000..543325b6 --- /dev/null +++ b/voucherify/models/trash_bin_item.py @@ -0,0 +1,163 @@ +# coding: utf-8 + +""" + Voucherify API + + Voucherify promotion engine REST API. Please see https://docs.voucherify.io/docs for more details. + + The version of the OpenAPI document: v2018-08-01 + Contact: support@voucherify.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class TrashBinItem(BaseModel): + """ + Resource moved to the bin, i.e. a campaign, product, SKU, or voucher. + """ # noqa: E501 + id: Optional[StrictStr] = Field(default=None, description="Unique identifier of the trash bin entry. It should not be confused with the ID of the resource moved to the bin.") + created_at: Optional[datetime] = Field(default=None, description="Timestamp representing the date and time when the resource was moved to the bin. The value for this parameter is shown in the ISO 8601 format.") + deleted_by_user_id: Optional[StrictStr] = Field(default=None, description="Unique identifier of the user who moved the resource to the bin. It returns a user ID if the resource was moved to the bin through an action in the website. It returns a `null` if the resource was deleted through the API.") + resource_id: Optional[StrictStr] = Field(default=None, description="Unique identifier of the resource moved to the bin, i.e. an ID of a campaign, product, SKU, or voucher.") + resource_type: Optional[StrictStr] = Field(default=None, description="Type of the resource moved to the bin.") + resource_name: Optional[StrictStr] = Field(default=None, description="Name of the resouce moved to the bin. It is the name of the campaign, product or SKU, or the voucher code.") + resource_parent_id: Optional[StrictStr] = Field(default=None, description="Unique identifier of the parent resource. For a voucher, it is a campaign ID, except for standalone vouchers. For an SKU, it is the product ID. It returns `null` for campaigns and base products.") + object: Optional[StrictStr] = Field(default=None, description="The type of the object represented by JSON. It is equal to the `resource_type`.") + __properties: ClassVar[List[str]] = ["id", "created_at", "deleted_by_user_id", "resource_id", "resource_type", "resource_name", "resource_parent_id", "object"] + + @field_validator('resource_type') + def resource_type_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['campaign', 'product', 'sku', 'voucher']): + raise ValueError("must be one of enum values ('campaign', 'product', 'sku', 'voucher')") + return value + + @field_validator('object') + def object_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['campaign', 'product', 'sku', 'voucher']): + raise ValueError("must be one of enum values ('campaign', 'product', 'sku', 'voucher')") + return value + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of TrashBinItem from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if id (nullable) is None + # and model_fields_set contains the field + if self.id is None and "id" in self.model_fields_set: + _dict['id'] = None + + # set to None if created_at (nullable) is None + # and model_fields_set contains the field + if self.created_at is None and "created_at" in self.model_fields_set: + _dict['created_at'] = None + + # set to None if deleted_by_user_id (nullable) is None + # and model_fields_set contains the field + if self.deleted_by_user_id is None and "deleted_by_user_id" in self.model_fields_set: + _dict['deleted_by_user_id'] = None + + # set to None if resource_id (nullable) is None + # and model_fields_set contains the field + if self.resource_id is None and "resource_id" in self.model_fields_set: + _dict['resource_id'] = None + + # set to None if resource_type (nullable) is None + # and model_fields_set contains the field + if self.resource_type is None and "resource_type" in self.model_fields_set: + _dict['resource_type'] = None + + # set to None if resource_name (nullable) is None + # and model_fields_set contains the field + if self.resource_name is None and "resource_name" in self.model_fields_set: + _dict['resource_name'] = None + + # set to None if resource_parent_id (nullable) is None + # and model_fields_set contains the field + if self.resource_parent_id is None and "resource_parent_id" in self.model_fields_set: + _dict['resource_parent_id'] = None + + # set to None if object (nullable) is None + # and model_fields_set contains the field + if self.object is None and "object" in self.model_fields_set: + _dict['object'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of TrashBinItem from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id"), + "created_at": obj.get("created_at"), + "deleted_by_user_id": obj.get("deleted_by_user_id"), + "resource_id": obj.get("resource_id"), + "resource_type": obj.get("resource_type"), + "resource_name": obj.get("resource_name"), + "resource_parent_id": obj.get("resource_parent_id"), + "object": obj.get("object") + }) + return _obj + + diff --git a/voucherify/models/trash_bin_list_response_body.py b/voucherify/models/trash_bin_list_response_body.py new file mode 100644 index 00000000..3fd99793 --- /dev/null +++ b/voucherify/models/trash_bin_list_response_body.py @@ -0,0 +1,156 @@ +# coding: utf-8 + +""" + Voucherify API + + Voucherify promotion engine REST API. Please see https://docs.voucherify.io/docs for more details. + + The version of the OpenAPI document: v2018-08-01 + Contact: support@voucherify.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from voucherify.models.trash_bin_item import TrashBinItem +from typing import Optional, Set +from typing_extensions import Self + +class TrashBinListResponseBody(BaseModel): + """ + Retrieves a list of the resources moved the bin. + """ # noqa: E501 + object: Optional[StrictStr] = Field(default='list', description="The type of the object represented by JSON. This object stores information about the bin entries in a dictionary.") + data_ref: Optional[StrictStr] = Field(default='data', description="Identifies the name of the attribute that contains the array of bin entry objects.") + data: Optional[List[TrashBinItem]] = Field(default=None, description="Array of bin entry objects.") + total: Optional[StrictInt] = Field(default=None, description="The total number of bin entries. This is the number of the entries returned in the array, not the number of all matching results or all resources currently moved to the bin.") + has_more: Optional[StrictBool] = Field(default=None, description="As query results are always limited (by the limit parameter), the `has_more` flag indicates if there are more records for given filter parameters. This lets you know if you can run another request with a `starting_after_id` query or a different limit to get more records returned in the results.") + more_starting_after: Optional[StrictStr] = Field(default=None, description="If `has_more` is `true`, it returns an ID that can be used to return another page of results. Use the ID in the `starting_after_id` query parameter to display another page of the results occuring after the field with that ID.") + __properties: ClassVar[List[str]] = ["object", "data_ref", "data", "total", "has_more", "more_starting_after"] + + @field_validator('object') + def object_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['list']): + raise ValueError("must be one of enum values ('list')") + return value + + @field_validator('data_ref') + def data_ref_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['data']): + raise ValueError("must be one of enum values ('data')") + return value + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of TrashBinListResponseBody from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in data (list) + _items = [] + if self.data: + for _item_data in self.data: + if _item_data: + _items.append(_item_data.to_dict()) + _dict['data'] = _items + # set to None if object (nullable) is None + # and model_fields_set contains the field + if self.object is None and "object" in self.model_fields_set: + _dict['object'] = None + + # set to None if data_ref (nullable) is None + # and model_fields_set contains the field + if self.data_ref is None and "data_ref" in self.model_fields_set: + _dict['data_ref'] = None + + # set to None if data (nullable) is None + # and model_fields_set contains the field + if self.data is None and "data" in self.model_fields_set: + _dict['data'] = None + + # set to None if total (nullable) is None + # and model_fields_set contains the field + if self.total is None and "total" in self.model_fields_set: + _dict['total'] = None + + # set to None if has_more (nullable) is None + # and model_fields_set contains the field + if self.has_more is None and "has_more" in self.model_fields_set: + _dict['has_more'] = None + + # set to None if more_starting_after (nullable) is None + # and model_fields_set contains the field + if self.more_starting_after is None and "more_starting_after" in self.model_fields_set: + _dict['more_starting_after'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of TrashBinListResponseBody from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "object": obj.get("object") if obj.get("object") is not None else 'list', + "data_ref": obj.get("data_ref") if obj.get("data_ref") is not None else 'data', + "data": [TrashBinItem.from_dict(_item) for _item in obj["data"]] if obj.get("data") is not None else None, + "total": obj.get("total"), + "has_more": obj.get("has_more"), + "more_starting_after": obj.get("more_starting_after") + }) + return _obj + + diff --git a/voucherify/models/usage_notifications.py b/voucherify/models/usage_notifications.py new file mode 100644 index 00000000..e70dfee9 --- /dev/null +++ b/voucherify/models/usage_notifications.py @@ -0,0 +1,115 @@ +# coding: utf-8 + +""" + Voucherify API + + Voucherify promotion engine REST API. Please see https://docs.voucherify.io/docs for more details. + + The version of the OpenAPI document: v2018-08-01 + Contact: support@voucherify.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self + +class UsageNotifications(BaseModel): + """ + UsageNotifications + """ # noqa: E501 + enabled: Optional[StrictBool] = Field(default=None, description="Enables the notification.") + value: Optional[Annotated[int, Field(le=90, strict=True, ge=10)]] = Field(default=None, description="The percent value of the limit which, when reached, triggers the notification.") + in_app: Optional[StrictBool] = Field(default=None, description="Enables the notification in the application.") + emails: Optional[List[StrictStr]] = Field(default=None, description="An array of email addresses which will receive the notification.") + __properties: ClassVar[List[str]] = ["enabled", "value", "in_app", "emails"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of UsageNotifications from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if enabled (nullable) is None + # and model_fields_set contains the field + if self.enabled is None and "enabled" in self.model_fields_set: + _dict['enabled'] = None + + # set to None if value (nullable) is None + # and model_fields_set contains the field + if self.value is None and "value" in self.model_fields_set: + _dict['value'] = None + + # set to None if in_app (nullable) is None + # and model_fields_set contains the field + if self.in_app is None and "in_app" in self.model_fields_set: + _dict['in_app'] = None + + # set to None if emails (nullable) is None + # and model_fields_set contains the field + if self.emails is None and "emails" in self.model_fields_set: + _dict['emails'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of UsageNotifications from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "enabled": obj.get("enabled"), + "value": obj.get("value"), + "in_app": obj.get("in_app"), + "emails": obj.get("emails") + }) + return _obj + + diff --git a/voucherify/models/user.py b/voucherify/models/user.py new file mode 100644 index 00000000..4bb5af71 --- /dev/null +++ b/voucherify/models/user.py @@ -0,0 +1,135 @@ +# coding: utf-8 + +""" + Voucherify API + + Voucherify promotion engine REST API. Please see https://docs.voucherify.io/docs for more details. + + The version of the OpenAPI document: v2018-08-01 + Contact: support@voucherify.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class User(BaseModel): + """ + Details about the user. + """ # noqa: E501 + id: Optional[StrictStr] = Field(default=None, description="The unique identifier of the user who has been assigned to the project.") + login: Optional[StrictStr] = Field(default=None, description="The login data of the user who has been assigned to the project.") + email: Optional[StrictStr] = Field(default=None, description="The email address of the user who has been assigned to the project.") + first_name: Optional[StrictStr] = Field(default=None, description="The first name of the user who has been assigned to the project.") + last_name: Optional[StrictStr] = Field(default=None, description="The last name of the user who has been assigned to the project.") + projects: Optional[Dict[str, Any]] = Field(default=None, description="Lists key-value pairs, where the key is the project to which the user is assigned. The value is the role assigned in a given project. The predefined Voucherify roles are: `ADMIN`, `USER`, `VIEWER`, `MERCHANT`, `USER_RESTRICTED` (for the Areas and Stores, an Enterprise feature).") + is_owner: Optional[StrictBool] = Field(default=None, description="Determines if the user is the owner for the organization in Voucherify.") + __properties: ClassVar[List[str]] = ["id", "login", "email", "first_name", "last_name", "projects", "is_owner"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of User from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if id (nullable) is None + # and model_fields_set contains the field + if self.id is None and "id" in self.model_fields_set: + _dict['id'] = None + + # set to None if login (nullable) is None + # and model_fields_set contains the field + if self.login is None and "login" in self.model_fields_set: + _dict['login'] = None + + # set to None if email (nullable) is None + # and model_fields_set contains the field + if self.email is None and "email" in self.model_fields_set: + _dict['email'] = None + + # set to None if first_name (nullable) is None + # and model_fields_set contains the field + if self.first_name is None and "first_name" in self.model_fields_set: + _dict['first_name'] = None + + # set to None if last_name (nullable) is None + # and model_fields_set contains the field + if self.last_name is None and "last_name" in self.model_fields_set: + _dict['last_name'] = None + + # set to None if projects (nullable) is None + # and model_fields_set contains the field + if self.projects is None and "projects" in self.model_fields_set: + _dict['projects'] = None + + # set to None if is_owner (nullable) is None + # and model_fields_set contains the field + if self.is_owner is None and "is_owner" in self.model_fields_set: + _dict['is_owner'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of User from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id"), + "login": obj.get("login"), + "email": obj.get("email"), + "first_name": obj.get("first_name"), + "last_name": obj.get("last_name"), + "projects": obj.get("projects"), + "is_owner": obj.get("is_owner") + }) + return _obj + + diff --git a/voucherify/models/validation_rule.py b/voucherify/models/validation_rule.py index c667c7dc..fa1f2dcc 100644 --- a/voucherify/models/validation_rule.py +++ b/voucherify/models/validation_rule.py @@ -35,7 +35,7 @@ class ValidationRule(BaseModel): error: Optional[ValidationRuleError] = None applicable_to: Optional[ValidationRuleApplicableTo] = None type: Optional[StrictStr] = Field(default='expression', description="Type of validation rule.") - context_type: Optional[StrictStr] = Field(default='global', description="Validation rule context type. | **Context Type** | **Definition** | |:---|:---| | earning_rule.order.paid | | | earning_rule.custom_event | | | earning_rule.customer.segment.entered | | | campaign.discount_coupons | | | campaign.discount_coupons.discount.apply_to_order | | | campaign.discount_coupons.discount.apply_to_items | | | campaign.discount_coupons.discount.apply_to_items_proportionally | | | campaign.discount_coupons.discount.apply_to_items_proportionally_by_quantity | | | campaign.discount_coupons.discount.fixed.apply_to_items | | | campaign.gift_vouchers | | | campaign.gift_vouchers.gift.apply_to_order | | | campaign.gift_vouchers.gift.apply_to_items | | | campaign.referral_program | | | campaign.referral_program.discount.apply_to_order | | | campaign.referral_program.discount.apply_to_items | | | campaign.referral_program.discount.apply_to_items_proportionally | | | campaign.referral_program.discount.apply_to_items_proportionally_by_quantity | | | campaign.referral_program.discount.fixed.apply_to_items | | | campaign.promotion | | | campaign.promotion.discount.apply_to_order | | | campaign.promotion.discount.apply_to_items | | | campaign.promotion.discount.apply_to_items_proportionally | | | campaign.promotion.discount.apply_to_items_proportionally_by_quantity | | | campaign.promotion.discount.fixed.apply_to_items | | | campaign.loyalty_program | | | campaign.lucky_draw | | | voucher.discount_voucher | | | voucher.discount_voucher.discount.apply_to_order | | | voucher.discount_voucher.discount.apply_to_items | | | voucher.discount_voucher.discount.apply_to_items_proportionally | | | voucher.discount_voucher.discount.apply_to_items_proportionally_by_quantity | | | voucher.discount_voucher.discount.fixed.apply_to_items | | | voucher.gift_voucher | | | voucher.gift_voucher.gift.apply_to_order | | | voucher.gift_voucher.gift.apply_to_items | | | voucher.loyalty_card | | | voucher.lucky_draw_code | | | distribution.custom_event | | | reward_assignment.pay_with_points | | | global | |") + context_type: Optional[StrictStr] = Field(default='global', description="Validation rule context type. | **Context Type** | **Definition** | |:---|:---| | earning_rule.order.paid | | | earning_rule.custom_event | | | earning_rule.customer.segment.entered | | | campaign.discount_coupons | | | campaign.discount_coupons.discount.apply_to_order | | | campaign.discount_coupons.discount.apply_to_items | | | campaign.discount_coupons.discount.apply_to_items_proportionally | | | campaign.discount_coupons.discount.apply_to_items_proportionally_by_quantity | | | campaign.discount_coupons.discount.fixed.apply_to_items | | | campaign.gift_vouchers | | | campaign.gift_vouchers.gift.apply_to_order | | | campaign.gift_vouchers.gift.apply_to_items | | | campaign.referral_program | | | campaign.referral_program.discount.apply_to_order | | | campaign.referral_program.discount.apply_to_items | | | campaign.referral_program.discount.apply_to_items_proportionally | | | campaign.referral_program.discount.apply_to_items_proportionally_by_quantity | | | campaign.referral_program.discount.fixed.apply_to_items | | | campaign.promotion | | | campaign.promotion.discount.apply_to_order | | | campaign.promotion.discount.apply_to_items | | | campaign.promotion.discount.apply_to_items_proportionally | | | campaign.promotion.discount.apply_to_items_proportionally_by_quantity | | | campaign.promotion.discount.fixed.apply_to_items | | | campaign.loyalty_program | | | voucher.discount_voucher | | | voucher.discount_voucher.discount.apply_to_order | | | voucher.discount_voucher.discount.apply_to_items | | | voucher.discount_voucher.discount.apply_to_items_proportionally | | | voucher.discount_voucher.discount.apply_to_items_proportionally_by_quantity | | | voucher.discount_voucher.discount.fixed.apply_to_items | | | voucher.gift_voucher | | | voucher.gift_voucher.gift.apply_to_order | | | voucher.gift_voucher.gift.apply_to_items | | | voucher.loyalty_card | | | distribution.custom_event | | | reward_assignment.pay_with_points | | | global | |") id: Optional[StrictStr] = Field(default=None, description="Unique validation rule ID.") created_at: Optional[datetime] = Field(default=None, description="Timestamp representing the date and time when the validation rule was created. The value is shown in the ISO 8601 format.") updated_at: Optional[datetime] = Field(default=None, description="Timestamp representing the date and time when the validation rule was updated. The value is shown in the ISO 8601 format.") @@ -59,8 +59,8 @@ def context_type_validate_enum(cls, value): if value is None: return value - if value not in set(['earning_rule.order.paid', 'earning_rule.custom_event', 'earning_rule.customer.segment.entered', 'earning_rule.customer.tier.joined', 'earning_rule.customer.tier.left', 'earning_rule.customer.tier.upgraded', 'earning_rule.customer.tier.downgraded', 'earning_rule.customer.tier.prolonged', 'campaign.discount_coupons', 'campaign.discount_coupons.discount.apply_to_order', 'campaign.discount_coupons.discount.apply_to_items', 'campaign.discount_coupons.discount.apply_to_items_proportionally', 'campaign.discount_coupons.discount.apply_to_items_proportionally_by_quantity', 'campaign.discount_coupons.discount.apply_to_items_by_quantity', 'campaign.discount_coupons.discount.fixed.apply_to_items', 'campaign.discount_coupons.discount.percent.apply_to_items', 'campaign.gift_vouchers', 'campaign.gift_vouchers.gift.apply_to_order', 'campaign.gift_vouchers.gift.apply_to_items', 'campaign.referral_program', 'campaign.referral_program.discount.apply_to_order', 'campaign.referral_program.discount.apply_to_items', 'campaign.referral_program.discount.apply_to_items_proportionally', 'campaign.referral_program.discount.apply_to_items_proportionally_by_quantity', 'campaign.referral_program.discount.apply_to_items_by_quantity', 'campaign.referral_program.discount.fixed.apply_to_items', 'campaign.referral_program.discount.percent.apply_to_items', 'campaign.promotion', 'campaign.promotion.discount.apply_to_order', 'campaign.promotion.discount.apply_to_items', 'campaign.promotion.discount.apply_to_items_proportionally', 'campaign.promotion.discount.apply_to_items_proportionally_by_quantity', 'campaign.promotion.discount.apply_to_items_by_quantity', 'campaign.promotion.discount.fixed.apply_to_items', 'campaign.promotion.discount.percent.apply_to_items', 'campaign.loyalty_program', 'campaign.lucky_draw', 'voucher.discount_voucher', 'voucher.discount_voucher.discount.apply_to_order', 'voucher.discount_voucher.discount.apply_to_items', 'voucher.discount_voucher.discount.apply_to_items_proportionally', 'voucher.discount_voucher.discount.apply_to_items_proportionally_by_quantity', 'voucher.discount_voucher.discount.apply_to_items_by_quantity', 'voucher.discount_voucher.discount.fixed.apply_to_items', 'voucher.discount_voucher.discount.percent.apply_to_items', 'voucher.gift_voucher', 'voucher.gift_voucher.gift.apply_to_order', 'voucher.gift_voucher.gift.apply_to_items', 'voucher.loyalty_card', 'voucher.lucky_draw_code', 'distribution.custom_event', 'distribution.order.paid', 'distribution.order.created', 'distribution.order.canceled', 'distribution.order.updated', 'reward_assignment.pay_with_points', 'global']): - raise ValueError("must be one of enum values ('earning_rule.order.paid', 'earning_rule.custom_event', 'earning_rule.customer.segment.entered', 'earning_rule.customer.tier.joined', 'earning_rule.customer.tier.left', 'earning_rule.customer.tier.upgraded', 'earning_rule.customer.tier.downgraded', 'earning_rule.customer.tier.prolonged', 'campaign.discount_coupons', 'campaign.discount_coupons.discount.apply_to_order', 'campaign.discount_coupons.discount.apply_to_items', 'campaign.discount_coupons.discount.apply_to_items_proportionally', 'campaign.discount_coupons.discount.apply_to_items_proportionally_by_quantity', 'campaign.discount_coupons.discount.apply_to_items_by_quantity', 'campaign.discount_coupons.discount.fixed.apply_to_items', 'campaign.discount_coupons.discount.percent.apply_to_items', 'campaign.gift_vouchers', 'campaign.gift_vouchers.gift.apply_to_order', 'campaign.gift_vouchers.gift.apply_to_items', 'campaign.referral_program', 'campaign.referral_program.discount.apply_to_order', 'campaign.referral_program.discount.apply_to_items', 'campaign.referral_program.discount.apply_to_items_proportionally', 'campaign.referral_program.discount.apply_to_items_proportionally_by_quantity', 'campaign.referral_program.discount.apply_to_items_by_quantity', 'campaign.referral_program.discount.fixed.apply_to_items', 'campaign.referral_program.discount.percent.apply_to_items', 'campaign.promotion', 'campaign.promotion.discount.apply_to_order', 'campaign.promotion.discount.apply_to_items', 'campaign.promotion.discount.apply_to_items_proportionally', 'campaign.promotion.discount.apply_to_items_proportionally_by_quantity', 'campaign.promotion.discount.apply_to_items_by_quantity', 'campaign.promotion.discount.fixed.apply_to_items', 'campaign.promotion.discount.percent.apply_to_items', 'campaign.loyalty_program', 'campaign.lucky_draw', 'voucher.discount_voucher', 'voucher.discount_voucher.discount.apply_to_order', 'voucher.discount_voucher.discount.apply_to_items', 'voucher.discount_voucher.discount.apply_to_items_proportionally', 'voucher.discount_voucher.discount.apply_to_items_proportionally_by_quantity', 'voucher.discount_voucher.discount.apply_to_items_by_quantity', 'voucher.discount_voucher.discount.fixed.apply_to_items', 'voucher.discount_voucher.discount.percent.apply_to_items', 'voucher.gift_voucher', 'voucher.gift_voucher.gift.apply_to_order', 'voucher.gift_voucher.gift.apply_to_items', 'voucher.loyalty_card', 'voucher.lucky_draw_code', 'distribution.custom_event', 'distribution.order.paid', 'distribution.order.created', 'distribution.order.canceled', 'distribution.order.updated', 'reward_assignment.pay_with_points', 'global')") + if value not in set(['earning_rule.order.paid', 'earning_rule.custom_event', 'earning_rule.customer.segment.entered', 'earning_rule.customer.tier.joined', 'earning_rule.customer.tier.left', 'earning_rule.customer.tier.upgraded', 'earning_rule.customer.tier.downgraded', 'earning_rule.customer.tier.prolonged', 'campaign.discount_coupons', 'campaign.discount_coupons.discount.apply_to_order', 'campaign.discount_coupons.discount.apply_to_items', 'campaign.discount_coupons.discount.apply_to_items_proportionally', 'campaign.discount_coupons.discount.apply_to_items_proportionally_by_quantity', 'campaign.discount_coupons.discount.apply_to_items_by_quantity', 'campaign.discount_coupons.discount.fixed.apply_to_items', 'campaign.discount_coupons.discount.percent.apply_to_items', 'campaign.gift_vouchers', 'campaign.gift_vouchers.gift.apply_to_order', 'campaign.gift_vouchers.gift.apply_to_items', 'campaign.referral_program', 'campaign.referral_program.discount.apply_to_order', 'campaign.referral_program.discount.apply_to_items', 'campaign.referral_program.discount.apply_to_items_proportionally', 'campaign.referral_program.discount.apply_to_items_proportionally_by_quantity', 'campaign.referral_program.discount.apply_to_items_by_quantity', 'campaign.referral_program.discount.fixed.apply_to_items', 'campaign.referral_program.discount.percent.apply_to_items', 'campaign.promotion', 'campaign.promotion.discount.apply_to_order', 'campaign.promotion.discount.apply_to_items', 'campaign.promotion.discount.apply_to_items_proportionally', 'campaign.promotion.discount.apply_to_items_proportionally_by_quantity', 'campaign.promotion.discount.apply_to_items_by_quantity', 'campaign.promotion.discount.fixed.apply_to_items', 'campaign.promotion.discount.percent.apply_to_items', 'campaign.loyalty_program', 'voucher.discount_voucher', 'voucher.discount_voucher.discount.apply_to_order', 'voucher.discount_voucher.discount.apply_to_items', 'voucher.discount_voucher.discount.apply_to_items_proportionally', 'voucher.discount_voucher.discount.apply_to_items_proportionally_by_quantity', 'voucher.discount_voucher.discount.apply_to_items_by_quantity', 'voucher.discount_voucher.discount.fixed.apply_to_items', 'voucher.discount_voucher.discount.percent.apply_to_items', 'voucher.gift_voucher', 'voucher.gift_voucher.gift.apply_to_order', 'voucher.gift_voucher.gift.apply_to_items', 'voucher.loyalty_card', 'distribution.custom_event', 'distribution.order.paid', 'distribution.order.created', 'distribution.order.canceled', 'distribution.order.updated', 'reward_assignment.pay_with_points', 'global']): + raise ValueError("must be one of enum values ('earning_rule.order.paid', 'earning_rule.custom_event', 'earning_rule.customer.segment.entered', 'earning_rule.customer.tier.joined', 'earning_rule.customer.tier.left', 'earning_rule.customer.tier.upgraded', 'earning_rule.customer.tier.downgraded', 'earning_rule.customer.tier.prolonged', 'campaign.discount_coupons', 'campaign.discount_coupons.discount.apply_to_order', 'campaign.discount_coupons.discount.apply_to_items', 'campaign.discount_coupons.discount.apply_to_items_proportionally', 'campaign.discount_coupons.discount.apply_to_items_proportionally_by_quantity', 'campaign.discount_coupons.discount.apply_to_items_by_quantity', 'campaign.discount_coupons.discount.fixed.apply_to_items', 'campaign.discount_coupons.discount.percent.apply_to_items', 'campaign.gift_vouchers', 'campaign.gift_vouchers.gift.apply_to_order', 'campaign.gift_vouchers.gift.apply_to_items', 'campaign.referral_program', 'campaign.referral_program.discount.apply_to_order', 'campaign.referral_program.discount.apply_to_items', 'campaign.referral_program.discount.apply_to_items_proportionally', 'campaign.referral_program.discount.apply_to_items_proportionally_by_quantity', 'campaign.referral_program.discount.apply_to_items_by_quantity', 'campaign.referral_program.discount.fixed.apply_to_items', 'campaign.referral_program.discount.percent.apply_to_items', 'campaign.promotion', 'campaign.promotion.discount.apply_to_order', 'campaign.promotion.discount.apply_to_items', 'campaign.promotion.discount.apply_to_items_proportionally', 'campaign.promotion.discount.apply_to_items_proportionally_by_quantity', 'campaign.promotion.discount.apply_to_items_by_quantity', 'campaign.promotion.discount.fixed.apply_to_items', 'campaign.promotion.discount.percent.apply_to_items', 'campaign.loyalty_program', 'voucher.discount_voucher', 'voucher.discount_voucher.discount.apply_to_order', 'voucher.discount_voucher.discount.apply_to_items', 'voucher.discount_voucher.discount.apply_to_items_proportionally', 'voucher.discount_voucher.discount.apply_to_items_proportionally_by_quantity', 'voucher.discount_voucher.discount.apply_to_items_by_quantity', 'voucher.discount_voucher.discount.fixed.apply_to_items', 'voucher.discount_voucher.discount.percent.apply_to_items', 'voucher.gift_voucher', 'voucher.gift_voucher.gift.apply_to_order', 'voucher.gift_voucher.gift.apply_to_items', 'voucher.loyalty_card', 'distribution.custom_event', 'distribution.order.paid', 'distribution.order.created', 'distribution.order.canceled', 'distribution.order.updated', 'reward_assignment.pay_with_points', 'global')") return value model_config = ConfigDict( diff --git a/voucherify/models/validation_rules_create_request_body.py b/voucherify/models/validation_rules_create_request_body.py index 8a39b33a..ee6b6d69 100644 --- a/voucherify/models/validation_rules_create_request_body.py +++ b/voucherify/models/validation_rules_create_request_body.py @@ -34,7 +34,7 @@ class ValidationRulesCreateRequestBody(BaseModel): error: Optional[ValidationRulesCreateRequestBodyError] = None applicable_to: Optional[ValidationRulesCreateRequestBodyApplicableTo] = None type: Optional[StrictStr] = Field(default='expression', description="Type of validation rule.") - context_type: Optional[StrictStr] = Field(default='global', description="Validation rule context type. | **Context Type** | **Definition** | |:---|:---| | earning_rule.order.paid | | | earning_rule.custom_event | | | earning_rule.customer.segment.entered | | | campaign.discount_coupons | | | campaign.discount_coupons.discount.apply_to_order | | | campaign.discount_coupons.discount.apply_to_items | | | campaign.discount_coupons.discount.apply_to_items_proportionally | | | campaign.discount_coupons.discount.apply_to_items_proportionally_by_quantity | | | campaign.discount_coupons.discount.fixed.apply_to_items | | | campaign.gift_vouchers | | | campaign.gift_vouchers.gift.apply_to_order | | | campaign.gift_vouchers.gift.apply_to_items | | | campaign.referral_program | | | campaign.referral_program.discount.apply_to_order | | | campaign.referral_program.discount.apply_to_items | | | campaign.referral_program.discount.apply_to_items_proportionally | | | campaign.referral_program.discount.apply_to_items_proportionally_by_quantity | | | campaign.referral_program.discount.fixed.apply_to_items | | | campaign.promotion | | | campaign.promotion.discount.apply_to_order | | | campaign.promotion.discount.apply_to_items | | | campaign.promotion.discount.apply_to_items_proportionally | | | campaign.promotion.discount.apply_to_items_proportionally_by_quantity | | | campaign.promotion.discount.fixed.apply_to_items | | | campaign.loyalty_program | | | campaign.lucky_draw | | | voucher.discount_voucher | | | voucher.discount_voucher.discount.apply_to_order | | | voucher.discount_voucher.discount.apply_to_items | | | voucher.discount_voucher.discount.apply_to_items_proportionally | | | voucher.discount_voucher.discount.apply_to_items_proportionally_by_quantity | | | voucher.discount_voucher.discount.fixed.apply_to_items | | | voucher.gift_voucher | | | voucher.gift_voucher.gift.apply_to_order | | | voucher.gift_voucher.gift.apply_to_items | | | voucher.loyalty_card | | | voucher.lucky_draw_code | | | distribution.custom_event | | | reward_assignment.pay_with_points | | | global | |") + context_type: Optional[StrictStr] = Field(default='global', description="Validation rule context type. | **Context Type** | **Definition** | |:---|:---| | earning_rule.order.paid | | | earning_rule.custom_event | | | earning_rule.customer.segment.entered | | | campaign.discount_coupons | | | campaign.discount_coupons.discount.apply_to_order | | | campaign.discount_coupons.discount.apply_to_items | | | campaign.discount_coupons.discount.apply_to_items_proportionally | | | campaign.discount_coupons.discount.apply_to_items_proportionally_by_quantity | | | campaign.discount_coupons.discount.fixed.apply_to_items | | | campaign.gift_vouchers | | | campaign.gift_vouchers.gift.apply_to_order | | | campaign.gift_vouchers.gift.apply_to_items | | | campaign.referral_program | | | campaign.referral_program.discount.apply_to_order | | | campaign.referral_program.discount.apply_to_items | | | campaign.referral_program.discount.apply_to_items_proportionally | | | campaign.referral_program.discount.apply_to_items_proportionally_by_quantity | | | campaign.referral_program.discount.fixed.apply_to_items | | | campaign.promotion | | | campaign.promotion.discount.apply_to_order | | | campaign.promotion.discount.apply_to_items | | | campaign.promotion.discount.apply_to_items_proportionally | | | campaign.promotion.discount.apply_to_items_proportionally_by_quantity | | | campaign.promotion.discount.fixed.apply_to_items | | | campaign.loyalty_program | | | voucher.discount_voucher | | | voucher.discount_voucher.discount.apply_to_order | | | voucher.discount_voucher.discount.apply_to_items | | | voucher.discount_voucher.discount.apply_to_items_proportionally | | | voucher.discount_voucher.discount.apply_to_items_proportionally_by_quantity | | | voucher.discount_voucher.discount.fixed.apply_to_items | | | voucher.gift_voucher | | | voucher.gift_voucher.gift.apply_to_order | | | voucher.gift_voucher.gift.apply_to_items | | | voucher.loyalty_card | | | distribution.custom_event | | | reward_assignment.pay_with_points | | | global | |") __properties: ClassVar[List[str]] = ["name", "rules", "error", "applicable_to", "type", "context_type"] @field_validator('type') @@ -53,8 +53,8 @@ def context_type_validate_enum(cls, value): if value is None: return value - if value not in set(['earning_rule.order.paid', 'earning_rule.custom_event', 'earning_rule.customer.segment.entered', 'earning_rule.customer.tier.joined', 'earning_rule.customer.tier.left', 'earning_rule.customer.tier.upgraded', 'earning_rule.customer.tier.downgraded', 'earning_rule.customer.tier.prolonged', 'campaign.discount_coupons', 'campaign.discount_coupons.discount.apply_to_order', 'campaign.discount_coupons.discount.apply_to_items', 'campaign.discount_coupons.discount.apply_to_items_proportionally', 'campaign.discount_coupons.discount.apply_to_items_proportionally_by_quantity', 'campaign.discount_coupons.discount.apply_to_items_by_quantity', 'campaign.discount_coupons.discount.fixed.apply_to_items', 'campaign.discount_coupons.discount.percent.apply_to_items', 'campaign.gift_vouchers', 'campaign.gift_vouchers.gift.apply_to_order', 'campaign.gift_vouchers.gift.apply_to_items', 'campaign.referral_program', 'campaign.referral_program.discount.apply_to_order', 'campaign.referral_program.discount.apply_to_items', 'campaign.referral_program.discount.apply_to_items_proportionally', 'campaign.referral_program.discount.apply_to_items_proportionally_by_quantity', 'campaign.referral_program.discount.apply_to_items_by_quantity', 'campaign.referral_program.discount.fixed.apply_to_items', 'campaign.referral_program.discount.percent.apply_to_items', 'campaign.promotion', 'campaign.promotion.discount.apply_to_order', 'campaign.promotion.discount.apply_to_items', 'campaign.promotion.discount.apply_to_items_proportionally', 'campaign.promotion.discount.apply_to_items_proportionally_by_quantity', 'campaign.promotion.discount.apply_to_items_by_quantity', 'campaign.promotion.discount.fixed.apply_to_items', 'campaign.promotion.discount.percent.apply_to_items', 'campaign.loyalty_program', 'campaign.lucky_draw', 'voucher.discount_voucher', 'voucher.discount_voucher.discount.apply_to_order', 'voucher.discount_voucher.discount.apply_to_items', 'voucher.discount_voucher.discount.apply_to_items_proportionally', 'voucher.discount_voucher.discount.apply_to_items_proportionally_by_quantity', 'voucher.discount_voucher.discount.apply_to_items_by_quantity', 'voucher.discount_voucher.discount.fixed.apply_to_items', 'voucher.discount_voucher.discount.percent.apply_to_items', 'voucher.gift_voucher', 'voucher.gift_voucher.gift.apply_to_order', 'voucher.gift_voucher.gift.apply_to_items', 'voucher.loyalty_card', 'voucher.lucky_draw_code', 'distribution.custom_event', 'distribution.order.paid', 'distribution.order.created', 'distribution.order.canceled', 'distribution.order.updated', 'reward_assignment.pay_with_points', 'global']): - raise ValueError("must be one of enum values ('earning_rule.order.paid', 'earning_rule.custom_event', 'earning_rule.customer.segment.entered', 'earning_rule.customer.tier.joined', 'earning_rule.customer.tier.left', 'earning_rule.customer.tier.upgraded', 'earning_rule.customer.tier.downgraded', 'earning_rule.customer.tier.prolonged', 'campaign.discount_coupons', 'campaign.discount_coupons.discount.apply_to_order', 'campaign.discount_coupons.discount.apply_to_items', 'campaign.discount_coupons.discount.apply_to_items_proportionally', 'campaign.discount_coupons.discount.apply_to_items_proportionally_by_quantity', 'campaign.discount_coupons.discount.apply_to_items_by_quantity', 'campaign.discount_coupons.discount.fixed.apply_to_items', 'campaign.discount_coupons.discount.percent.apply_to_items', 'campaign.gift_vouchers', 'campaign.gift_vouchers.gift.apply_to_order', 'campaign.gift_vouchers.gift.apply_to_items', 'campaign.referral_program', 'campaign.referral_program.discount.apply_to_order', 'campaign.referral_program.discount.apply_to_items', 'campaign.referral_program.discount.apply_to_items_proportionally', 'campaign.referral_program.discount.apply_to_items_proportionally_by_quantity', 'campaign.referral_program.discount.apply_to_items_by_quantity', 'campaign.referral_program.discount.fixed.apply_to_items', 'campaign.referral_program.discount.percent.apply_to_items', 'campaign.promotion', 'campaign.promotion.discount.apply_to_order', 'campaign.promotion.discount.apply_to_items', 'campaign.promotion.discount.apply_to_items_proportionally', 'campaign.promotion.discount.apply_to_items_proportionally_by_quantity', 'campaign.promotion.discount.apply_to_items_by_quantity', 'campaign.promotion.discount.fixed.apply_to_items', 'campaign.promotion.discount.percent.apply_to_items', 'campaign.loyalty_program', 'campaign.lucky_draw', 'voucher.discount_voucher', 'voucher.discount_voucher.discount.apply_to_order', 'voucher.discount_voucher.discount.apply_to_items', 'voucher.discount_voucher.discount.apply_to_items_proportionally', 'voucher.discount_voucher.discount.apply_to_items_proportionally_by_quantity', 'voucher.discount_voucher.discount.apply_to_items_by_quantity', 'voucher.discount_voucher.discount.fixed.apply_to_items', 'voucher.discount_voucher.discount.percent.apply_to_items', 'voucher.gift_voucher', 'voucher.gift_voucher.gift.apply_to_order', 'voucher.gift_voucher.gift.apply_to_items', 'voucher.loyalty_card', 'voucher.lucky_draw_code', 'distribution.custom_event', 'distribution.order.paid', 'distribution.order.created', 'distribution.order.canceled', 'distribution.order.updated', 'reward_assignment.pay_with_points', 'global')") + if value not in set(['earning_rule.order.paid', 'earning_rule.custom_event', 'earning_rule.customer.segment.entered', 'earning_rule.customer.tier.joined', 'earning_rule.customer.tier.left', 'earning_rule.customer.tier.upgraded', 'earning_rule.customer.tier.downgraded', 'earning_rule.customer.tier.prolonged', 'campaign.discount_coupons', 'campaign.discount_coupons.discount.apply_to_order', 'campaign.discount_coupons.discount.apply_to_items', 'campaign.discount_coupons.discount.apply_to_items_proportionally', 'campaign.discount_coupons.discount.apply_to_items_proportionally_by_quantity', 'campaign.discount_coupons.discount.apply_to_items_by_quantity', 'campaign.discount_coupons.discount.fixed.apply_to_items', 'campaign.discount_coupons.discount.percent.apply_to_items', 'campaign.gift_vouchers', 'campaign.gift_vouchers.gift.apply_to_order', 'campaign.gift_vouchers.gift.apply_to_items', 'campaign.referral_program', 'campaign.referral_program.discount.apply_to_order', 'campaign.referral_program.discount.apply_to_items', 'campaign.referral_program.discount.apply_to_items_proportionally', 'campaign.referral_program.discount.apply_to_items_proportionally_by_quantity', 'campaign.referral_program.discount.apply_to_items_by_quantity', 'campaign.referral_program.discount.fixed.apply_to_items', 'campaign.referral_program.discount.percent.apply_to_items', 'campaign.promotion', 'campaign.promotion.discount.apply_to_order', 'campaign.promotion.discount.apply_to_items', 'campaign.promotion.discount.apply_to_items_proportionally', 'campaign.promotion.discount.apply_to_items_proportionally_by_quantity', 'campaign.promotion.discount.apply_to_items_by_quantity', 'campaign.promotion.discount.fixed.apply_to_items', 'campaign.promotion.discount.percent.apply_to_items', 'campaign.loyalty_program', 'voucher.discount_voucher', 'voucher.discount_voucher.discount.apply_to_order', 'voucher.discount_voucher.discount.apply_to_items', 'voucher.discount_voucher.discount.apply_to_items_proportionally', 'voucher.discount_voucher.discount.apply_to_items_proportionally_by_quantity', 'voucher.discount_voucher.discount.apply_to_items_by_quantity', 'voucher.discount_voucher.discount.fixed.apply_to_items', 'voucher.discount_voucher.discount.percent.apply_to_items', 'voucher.gift_voucher', 'voucher.gift_voucher.gift.apply_to_order', 'voucher.gift_voucher.gift.apply_to_items', 'voucher.loyalty_card', 'distribution.custom_event', 'distribution.order.paid', 'distribution.order.created', 'distribution.order.canceled', 'distribution.order.updated', 'reward_assignment.pay_with_points', 'global']): + raise ValueError("must be one of enum values ('earning_rule.order.paid', 'earning_rule.custom_event', 'earning_rule.customer.segment.entered', 'earning_rule.customer.tier.joined', 'earning_rule.customer.tier.left', 'earning_rule.customer.tier.upgraded', 'earning_rule.customer.tier.downgraded', 'earning_rule.customer.tier.prolonged', 'campaign.discount_coupons', 'campaign.discount_coupons.discount.apply_to_order', 'campaign.discount_coupons.discount.apply_to_items', 'campaign.discount_coupons.discount.apply_to_items_proportionally', 'campaign.discount_coupons.discount.apply_to_items_proportionally_by_quantity', 'campaign.discount_coupons.discount.apply_to_items_by_quantity', 'campaign.discount_coupons.discount.fixed.apply_to_items', 'campaign.discount_coupons.discount.percent.apply_to_items', 'campaign.gift_vouchers', 'campaign.gift_vouchers.gift.apply_to_order', 'campaign.gift_vouchers.gift.apply_to_items', 'campaign.referral_program', 'campaign.referral_program.discount.apply_to_order', 'campaign.referral_program.discount.apply_to_items', 'campaign.referral_program.discount.apply_to_items_proportionally', 'campaign.referral_program.discount.apply_to_items_proportionally_by_quantity', 'campaign.referral_program.discount.apply_to_items_by_quantity', 'campaign.referral_program.discount.fixed.apply_to_items', 'campaign.referral_program.discount.percent.apply_to_items', 'campaign.promotion', 'campaign.promotion.discount.apply_to_order', 'campaign.promotion.discount.apply_to_items', 'campaign.promotion.discount.apply_to_items_proportionally', 'campaign.promotion.discount.apply_to_items_proportionally_by_quantity', 'campaign.promotion.discount.apply_to_items_by_quantity', 'campaign.promotion.discount.fixed.apply_to_items', 'campaign.promotion.discount.percent.apply_to_items', 'campaign.loyalty_program', 'voucher.discount_voucher', 'voucher.discount_voucher.discount.apply_to_order', 'voucher.discount_voucher.discount.apply_to_items', 'voucher.discount_voucher.discount.apply_to_items_proportionally', 'voucher.discount_voucher.discount.apply_to_items_proportionally_by_quantity', 'voucher.discount_voucher.discount.apply_to_items_by_quantity', 'voucher.discount_voucher.discount.fixed.apply_to_items', 'voucher.discount_voucher.discount.percent.apply_to_items', 'voucher.gift_voucher', 'voucher.gift_voucher.gift.apply_to_order', 'voucher.gift_voucher.gift.apply_to_items', 'voucher.loyalty_card', 'distribution.custom_event', 'distribution.order.paid', 'distribution.order.created', 'distribution.order.canceled', 'distribution.order.updated', 'reward_assignment.pay_with_points', 'global')") return value model_config = ConfigDict( diff --git a/voucherify/models/validation_rules_create_response_body.py b/voucherify/models/validation_rules_create_response_body.py index 130ff2a8..93ce20b2 100644 --- a/voucherify/models/validation_rules_create_response_body.py +++ b/voucherify/models/validation_rules_create_response_body.py @@ -35,7 +35,7 @@ class ValidationRulesCreateResponseBody(BaseModel): error: Optional[ValidationRulesCreateResponseBodyError] = None applicable_to: Optional[ValidationRulesCreateResponseBodyApplicableTo] = None type: Optional[StrictStr] = Field(default='expression', description="Type of validation rule.") - context_type: Optional[StrictStr] = Field(default='global', description="Validation rule context type. | **Context Type** | **Definition** | |:---|:---| | earning_rule.order.paid | | | earning_rule.custom_event | | | earning_rule.customer.segment.entered | | | campaign.discount_coupons | | | campaign.discount_coupons.discount.apply_to_order | | | campaign.discount_coupons.discount.apply_to_items | | | campaign.discount_coupons.discount.apply_to_items_proportionally | | | campaign.discount_coupons.discount.apply_to_items_proportionally_by_quantity | | | campaign.discount_coupons.discount.fixed.apply_to_items | | | campaign.gift_vouchers | | | campaign.gift_vouchers.gift.apply_to_order | | | campaign.gift_vouchers.gift.apply_to_items | | | campaign.referral_program | | | campaign.referral_program.discount.apply_to_order | | | campaign.referral_program.discount.apply_to_items | | | campaign.referral_program.discount.apply_to_items_proportionally | | | campaign.referral_program.discount.apply_to_items_proportionally_by_quantity | | | campaign.referral_program.discount.fixed.apply_to_items | | | campaign.promotion | | | campaign.promotion.discount.apply_to_order | | | campaign.promotion.discount.apply_to_items | | | campaign.promotion.discount.apply_to_items_proportionally | | | campaign.promotion.discount.apply_to_items_proportionally_by_quantity | | | campaign.promotion.discount.fixed.apply_to_items | | | campaign.loyalty_program | | | campaign.lucky_draw | | | voucher.discount_voucher | | | voucher.discount_voucher.discount.apply_to_order | | | voucher.discount_voucher.discount.apply_to_items | | | voucher.discount_voucher.discount.apply_to_items_proportionally | | | voucher.discount_voucher.discount.apply_to_items_proportionally_by_quantity | | | voucher.discount_voucher.discount.fixed.apply_to_items | | | voucher.gift_voucher | | | voucher.gift_voucher.gift.apply_to_order | | | voucher.gift_voucher.gift.apply_to_items | | | voucher.loyalty_card | | | voucher.lucky_draw_code | | | distribution.custom_event | | | reward_assignment.pay_with_points | | | global | |") + context_type: Optional[StrictStr] = Field(default='global', description="Validation rule context type. | **Context Type** | **Definition** | |:---|:---| | earning_rule.order.paid | | | earning_rule.custom_event | | | earning_rule.customer.segment.entered | | | campaign.discount_coupons | | | campaign.discount_coupons.discount.apply_to_order | | | campaign.discount_coupons.discount.apply_to_items | | | campaign.discount_coupons.discount.apply_to_items_proportionally | | | campaign.discount_coupons.discount.apply_to_items_proportionally_by_quantity | | | campaign.discount_coupons.discount.fixed.apply_to_items | | | campaign.gift_vouchers | | | campaign.gift_vouchers.gift.apply_to_order | | | campaign.gift_vouchers.gift.apply_to_items | | | campaign.referral_program | | | campaign.referral_program.discount.apply_to_order | | | campaign.referral_program.discount.apply_to_items | | | campaign.referral_program.discount.apply_to_items_proportionally | | | campaign.referral_program.discount.apply_to_items_proportionally_by_quantity | | | campaign.referral_program.discount.fixed.apply_to_items | | | campaign.promotion | | | campaign.promotion.discount.apply_to_order | | | campaign.promotion.discount.apply_to_items | | | campaign.promotion.discount.apply_to_items_proportionally | | | campaign.promotion.discount.apply_to_items_proportionally_by_quantity | | | campaign.promotion.discount.fixed.apply_to_items | | | campaign.loyalty_program | | | voucher.discount_voucher | | | voucher.discount_voucher.discount.apply_to_order | | | voucher.discount_voucher.discount.apply_to_items | | | voucher.discount_voucher.discount.apply_to_items_proportionally | | | voucher.discount_voucher.discount.apply_to_items_proportionally_by_quantity | | | voucher.discount_voucher.discount.fixed.apply_to_items | | | voucher.gift_voucher | | | voucher.gift_voucher.gift.apply_to_order | | | voucher.gift_voucher.gift.apply_to_items | | | voucher.loyalty_card | | | distribution.custom_event | | | reward_assignment.pay_with_points | | | global | |") id: Optional[StrictStr] = Field(default=None, description="Unique validation rule ID.") created_at: Optional[datetime] = Field(default=None, description="Timestamp representing the date and time when the validation rule was created. The value is shown in the ISO 8601 format.") updated_at: Optional[datetime] = Field(default=None, description="Timestamp representing the date and time when the validation rule was updated. The value is shown in the ISO 8601 format.") @@ -59,8 +59,8 @@ def context_type_validate_enum(cls, value): if value is None: return value - if value not in set(['earning_rule.order.paid', 'earning_rule.custom_event', 'earning_rule.customer.segment.entered', 'earning_rule.customer.tier.joined', 'earning_rule.customer.tier.left', 'earning_rule.customer.tier.upgraded', 'earning_rule.customer.tier.downgraded', 'earning_rule.customer.tier.prolonged', 'campaign.discount_coupons', 'campaign.discount_coupons.discount.apply_to_order', 'campaign.discount_coupons.discount.apply_to_items', 'campaign.discount_coupons.discount.apply_to_items_proportionally', 'campaign.discount_coupons.discount.apply_to_items_proportionally_by_quantity', 'campaign.discount_coupons.discount.apply_to_items_by_quantity', 'campaign.discount_coupons.discount.fixed.apply_to_items', 'campaign.discount_coupons.discount.percent.apply_to_items', 'campaign.gift_vouchers', 'campaign.gift_vouchers.gift.apply_to_order', 'campaign.gift_vouchers.gift.apply_to_items', 'campaign.referral_program', 'campaign.referral_program.discount.apply_to_order', 'campaign.referral_program.discount.apply_to_items', 'campaign.referral_program.discount.apply_to_items_proportionally', 'campaign.referral_program.discount.apply_to_items_proportionally_by_quantity', 'campaign.referral_program.discount.apply_to_items_by_quantity', 'campaign.referral_program.discount.fixed.apply_to_items', 'campaign.referral_program.discount.percent.apply_to_items', 'campaign.promotion', 'campaign.promotion.discount.apply_to_order', 'campaign.promotion.discount.apply_to_items', 'campaign.promotion.discount.apply_to_items_proportionally', 'campaign.promotion.discount.apply_to_items_proportionally_by_quantity', 'campaign.promotion.discount.apply_to_items_by_quantity', 'campaign.promotion.discount.fixed.apply_to_items', 'campaign.promotion.discount.percent.apply_to_items', 'campaign.loyalty_program', 'campaign.lucky_draw', 'voucher.discount_voucher', 'voucher.discount_voucher.discount.apply_to_order', 'voucher.discount_voucher.discount.apply_to_items', 'voucher.discount_voucher.discount.apply_to_items_proportionally', 'voucher.discount_voucher.discount.apply_to_items_proportionally_by_quantity', 'voucher.discount_voucher.discount.apply_to_items_by_quantity', 'voucher.discount_voucher.discount.fixed.apply_to_items', 'voucher.discount_voucher.discount.percent.apply_to_items', 'voucher.gift_voucher', 'voucher.gift_voucher.gift.apply_to_order', 'voucher.gift_voucher.gift.apply_to_items', 'voucher.loyalty_card', 'voucher.lucky_draw_code', 'distribution.custom_event', 'distribution.order.paid', 'distribution.order.created', 'distribution.order.canceled', 'distribution.order.updated', 'reward_assignment.pay_with_points', 'global']): - raise ValueError("must be one of enum values ('earning_rule.order.paid', 'earning_rule.custom_event', 'earning_rule.customer.segment.entered', 'earning_rule.customer.tier.joined', 'earning_rule.customer.tier.left', 'earning_rule.customer.tier.upgraded', 'earning_rule.customer.tier.downgraded', 'earning_rule.customer.tier.prolonged', 'campaign.discount_coupons', 'campaign.discount_coupons.discount.apply_to_order', 'campaign.discount_coupons.discount.apply_to_items', 'campaign.discount_coupons.discount.apply_to_items_proportionally', 'campaign.discount_coupons.discount.apply_to_items_proportionally_by_quantity', 'campaign.discount_coupons.discount.apply_to_items_by_quantity', 'campaign.discount_coupons.discount.fixed.apply_to_items', 'campaign.discount_coupons.discount.percent.apply_to_items', 'campaign.gift_vouchers', 'campaign.gift_vouchers.gift.apply_to_order', 'campaign.gift_vouchers.gift.apply_to_items', 'campaign.referral_program', 'campaign.referral_program.discount.apply_to_order', 'campaign.referral_program.discount.apply_to_items', 'campaign.referral_program.discount.apply_to_items_proportionally', 'campaign.referral_program.discount.apply_to_items_proportionally_by_quantity', 'campaign.referral_program.discount.apply_to_items_by_quantity', 'campaign.referral_program.discount.fixed.apply_to_items', 'campaign.referral_program.discount.percent.apply_to_items', 'campaign.promotion', 'campaign.promotion.discount.apply_to_order', 'campaign.promotion.discount.apply_to_items', 'campaign.promotion.discount.apply_to_items_proportionally', 'campaign.promotion.discount.apply_to_items_proportionally_by_quantity', 'campaign.promotion.discount.apply_to_items_by_quantity', 'campaign.promotion.discount.fixed.apply_to_items', 'campaign.promotion.discount.percent.apply_to_items', 'campaign.loyalty_program', 'campaign.lucky_draw', 'voucher.discount_voucher', 'voucher.discount_voucher.discount.apply_to_order', 'voucher.discount_voucher.discount.apply_to_items', 'voucher.discount_voucher.discount.apply_to_items_proportionally', 'voucher.discount_voucher.discount.apply_to_items_proportionally_by_quantity', 'voucher.discount_voucher.discount.apply_to_items_by_quantity', 'voucher.discount_voucher.discount.fixed.apply_to_items', 'voucher.discount_voucher.discount.percent.apply_to_items', 'voucher.gift_voucher', 'voucher.gift_voucher.gift.apply_to_order', 'voucher.gift_voucher.gift.apply_to_items', 'voucher.loyalty_card', 'voucher.lucky_draw_code', 'distribution.custom_event', 'distribution.order.paid', 'distribution.order.created', 'distribution.order.canceled', 'distribution.order.updated', 'reward_assignment.pay_with_points', 'global')") + if value not in set(['earning_rule.order.paid', 'earning_rule.custom_event', 'earning_rule.customer.segment.entered', 'earning_rule.customer.tier.joined', 'earning_rule.customer.tier.left', 'earning_rule.customer.tier.upgraded', 'earning_rule.customer.tier.downgraded', 'earning_rule.customer.tier.prolonged', 'campaign.discount_coupons', 'campaign.discount_coupons.discount.apply_to_order', 'campaign.discount_coupons.discount.apply_to_items', 'campaign.discount_coupons.discount.apply_to_items_proportionally', 'campaign.discount_coupons.discount.apply_to_items_proportionally_by_quantity', 'campaign.discount_coupons.discount.apply_to_items_by_quantity', 'campaign.discount_coupons.discount.fixed.apply_to_items', 'campaign.discount_coupons.discount.percent.apply_to_items', 'campaign.gift_vouchers', 'campaign.gift_vouchers.gift.apply_to_order', 'campaign.gift_vouchers.gift.apply_to_items', 'campaign.referral_program', 'campaign.referral_program.discount.apply_to_order', 'campaign.referral_program.discount.apply_to_items', 'campaign.referral_program.discount.apply_to_items_proportionally', 'campaign.referral_program.discount.apply_to_items_proportionally_by_quantity', 'campaign.referral_program.discount.apply_to_items_by_quantity', 'campaign.referral_program.discount.fixed.apply_to_items', 'campaign.referral_program.discount.percent.apply_to_items', 'campaign.promotion', 'campaign.promotion.discount.apply_to_order', 'campaign.promotion.discount.apply_to_items', 'campaign.promotion.discount.apply_to_items_proportionally', 'campaign.promotion.discount.apply_to_items_proportionally_by_quantity', 'campaign.promotion.discount.apply_to_items_by_quantity', 'campaign.promotion.discount.fixed.apply_to_items', 'campaign.promotion.discount.percent.apply_to_items', 'campaign.loyalty_program', 'voucher.discount_voucher', 'voucher.discount_voucher.discount.apply_to_order', 'voucher.discount_voucher.discount.apply_to_items', 'voucher.discount_voucher.discount.apply_to_items_proportionally', 'voucher.discount_voucher.discount.apply_to_items_proportionally_by_quantity', 'voucher.discount_voucher.discount.apply_to_items_by_quantity', 'voucher.discount_voucher.discount.fixed.apply_to_items', 'voucher.discount_voucher.discount.percent.apply_to_items', 'voucher.gift_voucher', 'voucher.gift_voucher.gift.apply_to_order', 'voucher.gift_voucher.gift.apply_to_items', 'voucher.loyalty_card', 'distribution.custom_event', 'distribution.order.paid', 'distribution.order.created', 'distribution.order.canceled', 'distribution.order.updated', 'reward_assignment.pay_with_points', 'global']): + raise ValueError("must be one of enum values ('earning_rule.order.paid', 'earning_rule.custom_event', 'earning_rule.customer.segment.entered', 'earning_rule.customer.tier.joined', 'earning_rule.customer.tier.left', 'earning_rule.customer.tier.upgraded', 'earning_rule.customer.tier.downgraded', 'earning_rule.customer.tier.prolonged', 'campaign.discount_coupons', 'campaign.discount_coupons.discount.apply_to_order', 'campaign.discount_coupons.discount.apply_to_items', 'campaign.discount_coupons.discount.apply_to_items_proportionally', 'campaign.discount_coupons.discount.apply_to_items_proportionally_by_quantity', 'campaign.discount_coupons.discount.apply_to_items_by_quantity', 'campaign.discount_coupons.discount.fixed.apply_to_items', 'campaign.discount_coupons.discount.percent.apply_to_items', 'campaign.gift_vouchers', 'campaign.gift_vouchers.gift.apply_to_order', 'campaign.gift_vouchers.gift.apply_to_items', 'campaign.referral_program', 'campaign.referral_program.discount.apply_to_order', 'campaign.referral_program.discount.apply_to_items', 'campaign.referral_program.discount.apply_to_items_proportionally', 'campaign.referral_program.discount.apply_to_items_proportionally_by_quantity', 'campaign.referral_program.discount.apply_to_items_by_quantity', 'campaign.referral_program.discount.fixed.apply_to_items', 'campaign.referral_program.discount.percent.apply_to_items', 'campaign.promotion', 'campaign.promotion.discount.apply_to_order', 'campaign.promotion.discount.apply_to_items', 'campaign.promotion.discount.apply_to_items_proportionally', 'campaign.promotion.discount.apply_to_items_proportionally_by_quantity', 'campaign.promotion.discount.apply_to_items_by_quantity', 'campaign.promotion.discount.fixed.apply_to_items', 'campaign.promotion.discount.percent.apply_to_items', 'campaign.loyalty_program', 'voucher.discount_voucher', 'voucher.discount_voucher.discount.apply_to_order', 'voucher.discount_voucher.discount.apply_to_items', 'voucher.discount_voucher.discount.apply_to_items_proportionally', 'voucher.discount_voucher.discount.apply_to_items_proportionally_by_quantity', 'voucher.discount_voucher.discount.apply_to_items_by_quantity', 'voucher.discount_voucher.discount.fixed.apply_to_items', 'voucher.discount_voucher.discount.percent.apply_to_items', 'voucher.gift_voucher', 'voucher.gift_voucher.gift.apply_to_order', 'voucher.gift_voucher.gift.apply_to_items', 'voucher.loyalty_card', 'distribution.custom_event', 'distribution.order.paid', 'distribution.order.created', 'distribution.order.canceled', 'distribution.order.updated', 'reward_assignment.pay_with_points', 'global')") return value model_config = ConfigDict( diff --git a/voucherify/models/validation_rules_get_response_body.py b/voucherify/models/validation_rules_get_response_body.py index 3ad93fc6..d7b54313 100644 --- a/voucherify/models/validation_rules_get_response_body.py +++ b/voucherify/models/validation_rules_get_response_body.py @@ -35,7 +35,7 @@ class ValidationRulesGetResponseBody(BaseModel): error: Optional[ValidationRulesGetResponseBodyError] = None applicable_to: Optional[ValidationRulesGetResponseBodyApplicableTo] = None type: Optional[StrictStr] = Field(default='expression', description="Type of validation rule.") - context_type: Optional[StrictStr] = Field(default='global', description="Validation rule context type. | **Context Type** | **Definition** | |:---|:---| | earning_rule.order.paid | | | earning_rule.custom_event | | | earning_rule.customer.segment.entered | | | campaign.discount_coupons | | | campaign.discount_coupons.discount.apply_to_order | | | campaign.discount_coupons.discount.apply_to_items | | | campaign.discount_coupons.discount.apply_to_items_proportionally | | | campaign.discount_coupons.discount.apply_to_items_proportionally_by_quantity | | | campaign.discount_coupons.discount.fixed.apply_to_items | | | campaign.gift_vouchers | | | campaign.gift_vouchers.gift.apply_to_order | | | campaign.gift_vouchers.gift.apply_to_items | | | campaign.referral_program | | | campaign.referral_program.discount.apply_to_order | | | campaign.referral_program.discount.apply_to_items | | | campaign.referral_program.discount.apply_to_items_proportionally | | | campaign.referral_program.discount.apply_to_items_proportionally_by_quantity | | | campaign.referral_program.discount.fixed.apply_to_items | | | campaign.promotion | | | campaign.promotion.discount.apply_to_order | | | campaign.promotion.discount.apply_to_items | | | campaign.promotion.discount.apply_to_items_proportionally | | | campaign.promotion.discount.apply_to_items_proportionally_by_quantity | | | campaign.promotion.discount.fixed.apply_to_items | | | campaign.loyalty_program | | | campaign.lucky_draw | | | voucher.discount_voucher | | | voucher.discount_voucher.discount.apply_to_order | | | voucher.discount_voucher.discount.apply_to_items | | | voucher.discount_voucher.discount.apply_to_items_proportionally | | | voucher.discount_voucher.discount.apply_to_items_proportionally_by_quantity | | | voucher.discount_voucher.discount.fixed.apply_to_items | | | voucher.gift_voucher | | | voucher.gift_voucher.gift.apply_to_order | | | voucher.gift_voucher.gift.apply_to_items | | | voucher.loyalty_card | | | voucher.lucky_draw_code | | | distribution.custom_event | | | reward_assignment.pay_with_points | | | global | |") + context_type: Optional[StrictStr] = Field(default='global', description="Validation rule context type. | **Context Type** | **Definition** | |:---|:---| | earning_rule.order.paid | | | earning_rule.custom_event | | | earning_rule.customer.segment.entered | | | campaign.discount_coupons | | | campaign.discount_coupons.discount.apply_to_order | | | campaign.discount_coupons.discount.apply_to_items | | | campaign.discount_coupons.discount.apply_to_items_proportionally | | | campaign.discount_coupons.discount.apply_to_items_proportionally_by_quantity | | | campaign.discount_coupons.discount.fixed.apply_to_items | | | campaign.gift_vouchers | | | campaign.gift_vouchers.gift.apply_to_order | | | campaign.gift_vouchers.gift.apply_to_items | | | campaign.referral_program | | | campaign.referral_program.discount.apply_to_order | | | campaign.referral_program.discount.apply_to_items | | | campaign.referral_program.discount.apply_to_items_proportionally | | | campaign.referral_program.discount.apply_to_items_proportionally_by_quantity | | | campaign.referral_program.discount.fixed.apply_to_items | | | campaign.promotion | | | campaign.promotion.discount.apply_to_order | | | campaign.promotion.discount.apply_to_items | | | campaign.promotion.discount.apply_to_items_proportionally | | | campaign.promotion.discount.apply_to_items_proportionally_by_quantity | | | campaign.promotion.discount.fixed.apply_to_items | | | campaign.loyalty_program | | | voucher.discount_voucher | | | voucher.discount_voucher.discount.apply_to_order | | | voucher.discount_voucher.discount.apply_to_items | | | voucher.discount_voucher.discount.apply_to_items_proportionally | | | voucher.discount_voucher.discount.apply_to_items_proportionally_by_quantity | | | voucher.discount_voucher.discount.fixed.apply_to_items | | | voucher.gift_voucher | | | voucher.gift_voucher.gift.apply_to_order | | | voucher.gift_voucher.gift.apply_to_items | | | voucher.loyalty_card | | | distribution.custom_event | | | reward_assignment.pay_with_points | | | global | |") id: Optional[StrictStr] = Field(default=None, description="Unique validation rule ID.") created_at: Optional[datetime] = Field(default=None, description="Timestamp representing the date and time when the validation rule was created. The value is shown in the ISO 8601 format.") updated_at: Optional[datetime] = Field(default=None, description="Timestamp representing the date and time when the validation rule was updated. The value is shown in the ISO 8601 format.") @@ -59,8 +59,8 @@ def context_type_validate_enum(cls, value): if value is None: return value - if value not in set(['earning_rule.order.paid', 'earning_rule.custom_event', 'earning_rule.customer.segment.entered', 'earning_rule.customer.tier.joined', 'earning_rule.customer.tier.left', 'earning_rule.customer.tier.upgraded', 'earning_rule.customer.tier.downgraded', 'earning_rule.customer.tier.prolonged', 'campaign.discount_coupons', 'campaign.discount_coupons.discount.apply_to_order', 'campaign.discount_coupons.discount.apply_to_items', 'campaign.discount_coupons.discount.apply_to_items_proportionally', 'campaign.discount_coupons.discount.apply_to_items_proportionally_by_quantity', 'campaign.discount_coupons.discount.apply_to_items_by_quantity', 'campaign.discount_coupons.discount.fixed.apply_to_items', 'campaign.discount_coupons.discount.percent.apply_to_items', 'campaign.gift_vouchers', 'campaign.gift_vouchers.gift.apply_to_order', 'campaign.gift_vouchers.gift.apply_to_items', 'campaign.referral_program', 'campaign.referral_program.discount.apply_to_order', 'campaign.referral_program.discount.apply_to_items', 'campaign.referral_program.discount.apply_to_items_proportionally', 'campaign.referral_program.discount.apply_to_items_proportionally_by_quantity', 'campaign.referral_program.discount.apply_to_items_by_quantity', 'campaign.referral_program.discount.fixed.apply_to_items', 'campaign.referral_program.discount.percent.apply_to_items', 'campaign.promotion', 'campaign.promotion.discount.apply_to_order', 'campaign.promotion.discount.apply_to_items', 'campaign.promotion.discount.apply_to_items_proportionally', 'campaign.promotion.discount.apply_to_items_proportionally_by_quantity', 'campaign.promotion.discount.apply_to_items_by_quantity', 'campaign.promotion.discount.fixed.apply_to_items', 'campaign.promotion.discount.percent.apply_to_items', 'campaign.loyalty_program', 'campaign.lucky_draw', 'voucher.discount_voucher', 'voucher.discount_voucher.discount.apply_to_order', 'voucher.discount_voucher.discount.apply_to_items', 'voucher.discount_voucher.discount.apply_to_items_proportionally', 'voucher.discount_voucher.discount.apply_to_items_proportionally_by_quantity', 'voucher.discount_voucher.discount.apply_to_items_by_quantity', 'voucher.discount_voucher.discount.fixed.apply_to_items', 'voucher.discount_voucher.discount.percent.apply_to_items', 'voucher.gift_voucher', 'voucher.gift_voucher.gift.apply_to_order', 'voucher.gift_voucher.gift.apply_to_items', 'voucher.loyalty_card', 'voucher.lucky_draw_code', 'distribution.custom_event', 'distribution.order.paid', 'distribution.order.created', 'distribution.order.canceled', 'distribution.order.updated', 'reward_assignment.pay_with_points', 'global']): - raise ValueError("must be one of enum values ('earning_rule.order.paid', 'earning_rule.custom_event', 'earning_rule.customer.segment.entered', 'earning_rule.customer.tier.joined', 'earning_rule.customer.tier.left', 'earning_rule.customer.tier.upgraded', 'earning_rule.customer.tier.downgraded', 'earning_rule.customer.tier.prolonged', 'campaign.discount_coupons', 'campaign.discount_coupons.discount.apply_to_order', 'campaign.discount_coupons.discount.apply_to_items', 'campaign.discount_coupons.discount.apply_to_items_proportionally', 'campaign.discount_coupons.discount.apply_to_items_proportionally_by_quantity', 'campaign.discount_coupons.discount.apply_to_items_by_quantity', 'campaign.discount_coupons.discount.fixed.apply_to_items', 'campaign.discount_coupons.discount.percent.apply_to_items', 'campaign.gift_vouchers', 'campaign.gift_vouchers.gift.apply_to_order', 'campaign.gift_vouchers.gift.apply_to_items', 'campaign.referral_program', 'campaign.referral_program.discount.apply_to_order', 'campaign.referral_program.discount.apply_to_items', 'campaign.referral_program.discount.apply_to_items_proportionally', 'campaign.referral_program.discount.apply_to_items_proportionally_by_quantity', 'campaign.referral_program.discount.apply_to_items_by_quantity', 'campaign.referral_program.discount.fixed.apply_to_items', 'campaign.referral_program.discount.percent.apply_to_items', 'campaign.promotion', 'campaign.promotion.discount.apply_to_order', 'campaign.promotion.discount.apply_to_items', 'campaign.promotion.discount.apply_to_items_proportionally', 'campaign.promotion.discount.apply_to_items_proportionally_by_quantity', 'campaign.promotion.discount.apply_to_items_by_quantity', 'campaign.promotion.discount.fixed.apply_to_items', 'campaign.promotion.discount.percent.apply_to_items', 'campaign.loyalty_program', 'campaign.lucky_draw', 'voucher.discount_voucher', 'voucher.discount_voucher.discount.apply_to_order', 'voucher.discount_voucher.discount.apply_to_items', 'voucher.discount_voucher.discount.apply_to_items_proportionally', 'voucher.discount_voucher.discount.apply_to_items_proportionally_by_quantity', 'voucher.discount_voucher.discount.apply_to_items_by_quantity', 'voucher.discount_voucher.discount.fixed.apply_to_items', 'voucher.discount_voucher.discount.percent.apply_to_items', 'voucher.gift_voucher', 'voucher.gift_voucher.gift.apply_to_order', 'voucher.gift_voucher.gift.apply_to_items', 'voucher.loyalty_card', 'voucher.lucky_draw_code', 'distribution.custom_event', 'distribution.order.paid', 'distribution.order.created', 'distribution.order.canceled', 'distribution.order.updated', 'reward_assignment.pay_with_points', 'global')") + if value not in set(['earning_rule.order.paid', 'earning_rule.custom_event', 'earning_rule.customer.segment.entered', 'earning_rule.customer.tier.joined', 'earning_rule.customer.tier.left', 'earning_rule.customer.tier.upgraded', 'earning_rule.customer.tier.downgraded', 'earning_rule.customer.tier.prolonged', 'campaign.discount_coupons', 'campaign.discount_coupons.discount.apply_to_order', 'campaign.discount_coupons.discount.apply_to_items', 'campaign.discount_coupons.discount.apply_to_items_proportionally', 'campaign.discount_coupons.discount.apply_to_items_proportionally_by_quantity', 'campaign.discount_coupons.discount.apply_to_items_by_quantity', 'campaign.discount_coupons.discount.fixed.apply_to_items', 'campaign.discount_coupons.discount.percent.apply_to_items', 'campaign.gift_vouchers', 'campaign.gift_vouchers.gift.apply_to_order', 'campaign.gift_vouchers.gift.apply_to_items', 'campaign.referral_program', 'campaign.referral_program.discount.apply_to_order', 'campaign.referral_program.discount.apply_to_items', 'campaign.referral_program.discount.apply_to_items_proportionally', 'campaign.referral_program.discount.apply_to_items_proportionally_by_quantity', 'campaign.referral_program.discount.apply_to_items_by_quantity', 'campaign.referral_program.discount.fixed.apply_to_items', 'campaign.referral_program.discount.percent.apply_to_items', 'campaign.promotion', 'campaign.promotion.discount.apply_to_order', 'campaign.promotion.discount.apply_to_items', 'campaign.promotion.discount.apply_to_items_proportionally', 'campaign.promotion.discount.apply_to_items_proportionally_by_quantity', 'campaign.promotion.discount.apply_to_items_by_quantity', 'campaign.promotion.discount.fixed.apply_to_items', 'campaign.promotion.discount.percent.apply_to_items', 'campaign.loyalty_program', 'voucher.discount_voucher', 'voucher.discount_voucher.discount.apply_to_order', 'voucher.discount_voucher.discount.apply_to_items', 'voucher.discount_voucher.discount.apply_to_items_proportionally', 'voucher.discount_voucher.discount.apply_to_items_proportionally_by_quantity', 'voucher.discount_voucher.discount.apply_to_items_by_quantity', 'voucher.discount_voucher.discount.fixed.apply_to_items', 'voucher.discount_voucher.discount.percent.apply_to_items', 'voucher.gift_voucher', 'voucher.gift_voucher.gift.apply_to_order', 'voucher.gift_voucher.gift.apply_to_items', 'voucher.loyalty_card', 'distribution.custom_event', 'distribution.order.paid', 'distribution.order.created', 'distribution.order.canceled', 'distribution.order.updated', 'reward_assignment.pay_with_points', 'global']): + raise ValueError("must be one of enum values ('earning_rule.order.paid', 'earning_rule.custom_event', 'earning_rule.customer.segment.entered', 'earning_rule.customer.tier.joined', 'earning_rule.customer.tier.left', 'earning_rule.customer.tier.upgraded', 'earning_rule.customer.tier.downgraded', 'earning_rule.customer.tier.prolonged', 'campaign.discount_coupons', 'campaign.discount_coupons.discount.apply_to_order', 'campaign.discount_coupons.discount.apply_to_items', 'campaign.discount_coupons.discount.apply_to_items_proportionally', 'campaign.discount_coupons.discount.apply_to_items_proportionally_by_quantity', 'campaign.discount_coupons.discount.apply_to_items_by_quantity', 'campaign.discount_coupons.discount.fixed.apply_to_items', 'campaign.discount_coupons.discount.percent.apply_to_items', 'campaign.gift_vouchers', 'campaign.gift_vouchers.gift.apply_to_order', 'campaign.gift_vouchers.gift.apply_to_items', 'campaign.referral_program', 'campaign.referral_program.discount.apply_to_order', 'campaign.referral_program.discount.apply_to_items', 'campaign.referral_program.discount.apply_to_items_proportionally', 'campaign.referral_program.discount.apply_to_items_proportionally_by_quantity', 'campaign.referral_program.discount.apply_to_items_by_quantity', 'campaign.referral_program.discount.fixed.apply_to_items', 'campaign.referral_program.discount.percent.apply_to_items', 'campaign.promotion', 'campaign.promotion.discount.apply_to_order', 'campaign.promotion.discount.apply_to_items', 'campaign.promotion.discount.apply_to_items_proportionally', 'campaign.promotion.discount.apply_to_items_proportionally_by_quantity', 'campaign.promotion.discount.apply_to_items_by_quantity', 'campaign.promotion.discount.fixed.apply_to_items', 'campaign.promotion.discount.percent.apply_to_items', 'campaign.loyalty_program', 'voucher.discount_voucher', 'voucher.discount_voucher.discount.apply_to_order', 'voucher.discount_voucher.discount.apply_to_items', 'voucher.discount_voucher.discount.apply_to_items_proportionally', 'voucher.discount_voucher.discount.apply_to_items_proportionally_by_quantity', 'voucher.discount_voucher.discount.apply_to_items_by_quantity', 'voucher.discount_voucher.discount.fixed.apply_to_items', 'voucher.discount_voucher.discount.percent.apply_to_items', 'voucher.gift_voucher', 'voucher.gift_voucher.gift.apply_to_order', 'voucher.gift_voucher.gift.apply_to_items', 'voucher.loyalty_card', 'distribution.custom_event', 'distribution.order.paid', 'distribution.order.created', 'distribution.order.canceled', 'distribution.order.updated', 'reward_assignment.pay_with_points', 'global')") return value model_config = ConfigDict( diff --git a/voucherify/models/validation_rules_update_request_body.py b/voucherify/models/validation_rules_update_request_body.py index 7245966d..93eae92b 100644 --- a/voucherify/models/validation_rules_update_request_body.py +++ b/voucherify/models/validation_rules_update_request_body.py @@ -34,7 +34,7 @@ class ValidationRulesUpdateRequestBody(BaseModel): error: Optional[ValidationRulesUpdateRequestBodyError] = None applicable_to: Optional[ValidationRulesUpdateRequestBodyApplicableTo] = None type: Optional[StrictStr] = Field(default='expression', description="Type of validation rule.") - context_type: Optional[StrictStr] = Field(default='global', description="Validation rule context type. | **Context Type** | **Definition** | |:---|:---| | earning_rule.order.paid | | | earning_rule.custom_event | | | earning_rule.customer.segment.entered | | | campaign.discount_coupons | | | campaign.discount_coupons.discount.apply_to_order | | | campaign.discount_coupons.discount.apply_to_items | | | campaign.discount_coupons.discount.apply_to_items_proportionally | | | campaign.discount_coupons.discount.apply_to_items_proportionally_by_quantity | | | campaign.discount_coupons.discount.fixed.apply_to_items | | | campaign.gift_vouchers | | | campaign.gift_vouchers.gift.apply_to_order | | | campaign.gift_vouchers.gift.apply_to_items | | | campaign.referral_program | | | campaign.referral_program.discount.apply_to_order | | | campaign.referral_program.discount.apply_to_items | | | campaign.referral_program.discount.apply_to_items_proportionally | | | campaign.referral_program.discount.apply_to_items_proportionally_by_quantity | | | campaign.referral_program.discount.fixed.apply_to_items | | | campaign.promotion | | | campaign.promotion.discount.apply_to_order | | | campaign.promotion.discount.apply_to_items | | | campaign.promotion.discount.apply_to_items_proportionally | | | campaign.promotion.discount.apply_to_items_proportionally_by_quantity | | | campaign.promotion.discount.fixed.apply_to_items | | | campaign.loyalty_program | | | campaign.lucky_draw | | | voucher.discount_voucher | | | voucher.discount_voucher.discount.apply_to_order | | | voucher.discount_voucher.discount.apply_to_items | | | voucher.discount_voucher.discount.apply_to_items_proportionally | | | voucher.discount_voucher.discount.apply_to_items_proportionally_by_quantity | | | voucher.discount_voucher.discount.fixed.apply_to_items | | | voucher.gift_voucher | | | voucher.gift_voucher.gift.apply_to_order | | | voucher.gift_voucher.gift.apply_to_items | | | voucher.loyalty_card | | | voucher.lucky_draw_code | | | distribution.custom_event | | | reward_assignment.pay_with_points | | | global | |") + context_type: Optional[StrictStr] = Field(default='global', description="Validation rule context type. | **Context Type** | **Definition** | |:---|:---| | earning_rule.order.paid | | | earning_rule.custom_event | | | earning_rule.customer.segment.entered | | | campaign.discount_coupons | | | campaign.discount_coupons.discount.apply_to_order | | | campaign.discount_coupons.discount.apply_to_items | | | campaign.discount_coupons.discount.apply_to_items_proportionally | | | campaign.discount_coupons.discount.apply_to_items_proportionally_by_quantity | | | campaign.discount_coupons.discount.fixed.apply_to_items | | | campaign.gift_vouchers | | | campaign.gift_vouchers.gift.apply_to_order | | | campaign.gift_vouchers.gift.apply_to_items | | | campaign.referral_program | | | campaign.referral_program.discount.apply_to_order | | | campaign.referral_program.discount.apply_to_items | | | campaign.referral_program.discount.apply_to_items_proportionally | | | campaign.referral_program.discount.apply_to_items_proportionally_by_quantity | | | campaign.referral_program.discount.fixed.apply_to_items | | | campaign.promotion | | | campaign.promotion.discount.apply_to_order | | | campaign.promotion.discount.apply_to_items | | | campaign.promotion.discount.apply_to_items_proportionally | | | campaign.promotion.discount.apply_to_items_proportionally_by_quantity | | | campaign.promotion.discount.fixed.apply_to_items | | | campaign.loyalty_program | | | voucher.discount_voucher | | | voucher.discount_voucher.discount.apply_to_order | | | voucher.discount_voucher.discount.apply_to_items | | | voucher.discount_voucher.discount.apply_to_items_proportionally | | | voucher.discount_voucher.discount.apply_to_items_proportionally_by_quantity | | | voucher.discount_voucher.discount.fixed.apply_to_items | | | voucher.gift_voucher | | | voucher.gift_voucher.gift.apply_to_order | | | voucher.gift_voucher.gift.apply_to_items | | | voucher.loyalty_card | | | distribution.custom_event | | | reward_assignment.pay_with_points | | | global | |") __properties: ClassVar[List[str]] = ["name", "rules", "error", "applicable_to", "type", "context_type"] @field_validator('type') @@ -53,8 +53,8 @@ def context_type_validate_enum(cls, value): if value is None: return value - if value not in set(['earning_rule.order.paid', 'earning_rule.custom_event', 'earning_rule.customer.segment.entered', 'earning_rule.customer.tier.joined', 'earning_rule.customer.tier.left', 'earning_rule.customer.tier.upgraded', 'earning_rule.customer.tier.downgraded', 'earning_rule.customer.tier.prolonged', 'campaign.discount_coupons', 'campaign.discount_coupons.discount.apply_to_order', 'campaign.discount_coupons.discount.apply_to_items', 'campaign.discount_coupons.discount.apply_to_items_proportionally', 'campaign.discount_coupons.discount.apply_to_items_proportionally_by_quantity', 'campaign.discount_coupons.discount.apply_to_items_by_quantity', 'campaign.discount_coupons.discount.fixed.apply_to_items', 'campaign.discount_coupons.discount.percent.apply_to_items', 'campaign.gift_vouchers', 'campaign.gift_vouchers.gift.apply_to_order', 'campaign.gift_vouchers.gift.apply_to_items', 'campaign.referral_program', 'campaign.referral_program.discount.apply_to_order', 'campaign.referral_program.discount.apply_to_items', 'campaign.referral_program.discount.apply_to_items_proportionally', 'campaign.referral_program.discount.apply_to_items_proportionally_by_quantity', 'campaign.referral_program.discount.apply_to_items_by_quantity', 'campaign.referral_program.discount.fixed.apply_to_items', 'campaign.referral_program.discount.percent.apply_to_items', 'campaign.promotion', 'campaign.promotion.discount.apply_to_order', 'campaign.promotion.discount.apply_to_items', 'campaign.promotion.discount.apply_to_items_proportionally', 'campaign.promotion.discount.apply_to_items_proportionally_by_quantity', 'campaign.promotion.discount.apply_to_items_by_quantity', 'campaign.promotion.discount.fixed.apply_to_items', 'campaign.promotion.discount.percent.apply_to_items', 'campaign.loyalty_program', 'campaign.lucky_draw', 'voucher.discount_voucher', 'voucher.discount_voucher.discount.apply_to_order', 'voucher.discount_voucher.discount.apply_to_items', 'voucher.discount_voucher.discount.apply_to_items_proportionally', 'voucher.discount_voucher.discount.apply_to_items_proportionally_by_quantity', 'voucher.discount_voucher.discount.apply_to_items_by_quantity', 'voucher.discount_voucher.discount.fixed.apply_to_items', 'voucher.discount_voucher.discount.percent.apply_to_items', 'voucher.gift_voucher', 'voucher.gift_voucher.gift.apply_to_order', 'voucher.gift_voucher.gift.apply_to_items', 'voucher.loyalty_card', 'voucher.lucky_draw_code', 'distribution.custom_event', 'distribution.order.paid', 'distribution.order.created', 'distribution.order.canceled', 'distribution.order.updated', 'reward_assignment.pay_with_points', 'global']): - raise ValueError("must be one of enum values ('earning_rule.order.paid', 'earning_rule.custom_event', 'earning_rule.customer.segment.entered', 'earning_rule.customer.tier.joined', 'earning_rule.customer.tier.left', 'earning_rule.customer.tier.upgraded', 'earning_rule.customer.tier.downgraded', 'earning_rule.customer.tier.prolonged', 'campaign.discount_coupons', 'campaign.discount_coupons.discount.apply_to_order', 'campaign.discount_coupons.discount.apply_to_items', 'campaign.discount_coupons.discount.apply_to_items_proportionally', 'campaign.discount_coupons.discount.apply_to_items_proportionally_by_quantity', 'campaign.discount_coupons.discount.apply_to_items_by_quantity', 'campaign.discount_coupons.discount.fixed.apply_to_items', 'campaign.discount_coupons.discount.percent.apply_to_items', 'campaign.gift_vouchers', 'campaign.gift_vouchers.gift.apply_to_order', 'campaign.gift_vouchers.gift.apply_to_items', 'campaign.referral_program', 'campaign.referral_program.discount.apply_to_order', 'campaign.referral_program.discount.apply_to_items', 'campaign.referral_program.discount.apply_to_items_proportionally', 'campaign.referral_program.discount.apply_to_items_proportionally_by_quantity', 'campaign.referral_program.discount.apply_to_items_by_quantity', 'campaign.referral_program.discount.fixed.apply_to_items', 'campaign.referral_program.discount.percent.apply_to_items', 'campaign.promotion', 'campaign.promotion.discount.apply_to_order', 'campaign.promotion.discount.apply_to_items', 'campaign.promotion.discount.apply_to_items_proportionally', 'campaign.promotion.discount.apply_to_items_proportionally_by_quantity', 'campaign.promotion.discount.apply_to_items_by_quantity', 'campaign.promotion.discount.fixed.apply_to_items', 'campaign.promotion.discount.percent.apply_to_items', 'campaign.loyalty_program', 'campaign.lucky_draw', 'voucher.discount_voucher', 'voucher.discount_voucher.discount.apply_to_order', 'voucher.discount_voucher.discount.apply_to_items', 'voucher.discount_voucher.discount.apply_to_items_proportionally', 'voucher.discount_voucher.discount.apply_to_items_proportionally_by_quantity', 'voucher.discount_voucher.discount.apply_to_items_by_quantity', 'voucher.discount_voucher.discount.fixed.apply_to_items', 'voucher.discount_voucher.discount.percent.apply_to_items', 'voucher.gift_voucher', 'voucher.gift_voucher.gift.apply_to_order', 'voucher.gift_voucher.gift.apply_to_items', 'voucher.loyalty_card', 'voucher.lucky_draw_code', 'distribution.custom_event', 'distribution.order.paid', 'distribution.order.created', 'distribution.order.canceled', 'distribution.order.updated', 'reward_assignment.pay_with_points', 'global')") + if value not in set(['earning_rule.order.paid', 'earning_rule.custom_event', 'earning_rule.customer.segment.entered', 'earning_rule.customer.tier.joined', 'earning_rule.customer.tier.left', 'earning_rule.customer.tier.upgraded', 'earning_rule.customer.tier.downgraded', 'earning_rule.customer.tier.prolonged', 'campaign.discount_coupons', 'campaign.discount_coupons.discount.apply_to_order', 'campaign.discount_coupons.discount.apply_to_items', 'campaign.discount_coupons.discount.apply_to_items_proportionally', 'campaign.discount_coupons.discount.apply_to_items_proportionally_by_quantity', 'campaign.discount_coupons.discount.apply_to_items_by_quantity', 'campaign.discount_coupons.discount.fixed.apply_to_items', 'campaign.discount_coupons.discount.percent.apply_to_items', 'campaign.gift_vouchers', 'campaign.gift_vouchers.gift.apply_to_order', 'campaign.gift_vouchers.gift.apply_to_items', 'campaign.referral_program', 'campaign.referral_program.discount.apply_to_order', 'campaign.referral_program.discount.apply_to_items', 'campaign.referral_program.discount.apply_to_items_proportionally', 'campaign.referral_program.discount.apply_to_items_proportionally_by_quantity', 'campaign.referral_program.discount.apply_to_items_by_quantity', 'campaign.referral_program.discount.fixed.apply_to_items', 'campaign.referral_program.discount.percent.apply_to_items', 'campaign.promotion', 'campaign.promotion.discount.apply_to_order', 'campaign.promotion.discount.apply_to_items', 'campaign.promotion.discount.apply_to_items_proportionally', 'campaign.promotion.discount.apply_to_items_proportionally_by_quantity', 'campaign.promotion.discount.apply_to_items_by_quantity', 'campaign.promotion.discount.fixed.apply_to_items', 'campaign.promotion.discount.percent.apply_to_items', 'campaign.loyalty_program', 'voucher.discount_voucher', 'voucher.discount_voucher.discount.apply_to_order', 'voucher.discount_voucher.discount.apply_to_items', 'voucher.discount_voucher.discount.apply_to_items_proportionally', 'voucher.discount_voucher.discount.apply_to_items_proportionally_by_quantity', 'voucher.discount_voucher.discount.apply_to_items_by_quantity', 'voucher.discount_voucher.discount.fixed.apply_to_items', 'voucher.discount_voucher.discount.percent.apply_to_items', 'voucher.gift_voucher', 'voucher.gift_voucher.gift.apply_to_order', 'voucher.gift_voucher.gift.apply_to_items', 'voucher.loyalty_card', 'distribution.custom_event', 'distribution.order.paid', 'distribution.order.created', 'distribution.order.canceled', 'distribution.order.updated', 'reward_assignment.pay_with_points', 'global']): + raise ValueError("must be one of enum values ('earning_rule.order.paid', 'earning_rule.custom_event', 'earning_rule.customer.segment.entered', 'earning_rule.customer.tier.joined', 'earning_rule.customer.tier.left', 'earning_rule.customer.tier.upgraded', 'earning_rule.customer.tier.downgraded', 'earning_rule.customer.tier.prolonged', 'campaign.discount_coupons', 'campaign.discount_coupons.discount.apply_to_order', 'campaign.discount_coupons.discount.apply_to_items', 'campaign.discount_coupons.discount.apply_to_items_proportionally', 'campaign.discount_coupons.discount.apply_to_items_proportionally_by_quantity', 'campaign.discount_coupons.discount.apply_to_items_by_quantity', 'campaign.discount_coupons.discount.fixed.apply_to_items', 'campaign.discount_coupons.discount.percent.apply_to_items', 'campaign.gift_vouchers', 'campaign.gift_vouchers.gift.apply_to_order', 'campaign.gift_vouchers.gift.apply_to_items', 'campaign.referral_program', 'campaign.referral_program.discount.apply_to_order', 'campaign.referral_program.discount.apply_to_items', 'campaign.referral_program.discount.apply_to_items_proportionally', 'campaign.referral_program.discount.apply_to_items_proportionally_by_quantity', 'campaign.referral_program.discount.apply_to_items_by_quantity', 'campaign.referral_program.discount.fixed.apply_to_items', 'campaign.referral_program.discount.percent.apply_to_items', 'campaign.promotion', 'campaign.promotion.discount.apply_to_order', 'campaign.promotion.discount.apply_to_items', 'campaign.promotion.discount.apply_to_items_proportionally', 'campaign.promotion.discount.apply_to_items_proportionally_by_quantity', 'campaign.promotion.discount.apply_to_items_by_quantity', 'campaign.promotion.discount.fixed.apply_to_items', 'campaign.promotion.discount.percent.apply_to_items', 'campaign.loyalty_program', 'voucher.discount_voucher', 'voucher.discount_voucher.discount.apply_to_order', 'voucher.discount_voucher.discount.apply_to_items', 'voucher.discount_voucher.discount.apply_to_items_proportionally', 'voucher.discount_voucher.discount.apply_to_items_proportionally_by_quantity', 'voucher.discount_voucher.discount.apply_to_items_by_quantity', 'voucher.discount_voucher.discount.fixed.apply_to_items', 'voucher.discount_voucher.discount.percent.apply_to_items', 'voucher.gift_voucher', 'voucher.gift_voucher.gift.apply_to_order', 'voucher.gift_voucher.gift.apply_to_items', 'voucher.loyalty_card', 'distribution.custom_event', 'distribution.order.paid', 'distribution.order.created', 'distribution.order.canceled', 'distribution.order.updated', 'reward_assignment.pay_with_points', 'global')") return value model_config = ConfigDict( diff --git a/voucherify/models/validation_rules_update_response_body.py b/voucherify/models/validation_rules_update_response_body.py index a82aa7db..79e66d7e 100644 --- a/voucherify/models/validation_rules_update_response_body.py +++ b/voucherify/models/validation_rules_update_response_body.py @@ -35,7 +35,7 @@ class ValidationRulesUpdateResponseBody(BaseModel): error: Optional[ValidationRulesUpdateResponseBodyError] = None applicable_to: Optional[ValidationRulesUpdateResponseBodyApplicableTo] = None type: Optional[StrictStr] = Field(default='expression', description="Type of validation rule.") - context_type: Optional[StrictStr] = Field(default='global', description="Validation rule context type. | **Context Type** | **Definition** | |:---|:---| | earning_rule.order.paid | | | earning_rule.custom_event | | | earning_rule.customer.segment.entered | | | campaign.discount_coupons | | | campaign.discount_coupons.discount.apply_to_order | | | campaign.discount_coupons.discount.apply_to_items | | | campaign.discount_coupons.discount.apply_to_items_proportionally | | | campaign.discount_coupons.discount.apply_to_items_proportionally_by_quantity | | | campaign.discount_coupons.discount.fixed.apply_to_items | | | campaign.gift_vouchers | | | campaign.gift_vouchers.gift.apply_to_order | | | campaign.gift_vouchers.gift.apply_to_items | | | campaign.referral_program | | | campaign.referral_program.discount.apply_to_order | | | campaign.referral_program.discount.apply_to_items | | | campaign.referral_program.discount.apply_to_items_proportionally | | | campaign.referral_program.discount.apply_to_items_proportionally_by_quantity | | | campaign.referral_program.discount.fixed.apply_to_items | | | campaign.promotion | | | campaign.promotion.discount.apply_to_order | | | campaign.promotion.discount.apply_to_items | | | campaign.promotion.discount.apply_to_items_proportionally | | | campaign.promotion.discount.apply_to_items_proportionally_by_quantity | | | campaign.promotion.discount.fixed.apply_to_items | | | campaign.loyalty_program | | | campaign.lucky_draw | | | voucher.discount_voucher | | | voucher.discount_voucher.discount.apply_to_order | | | voucher.discount_voucher.discount.apply_to_items | | | voucher.discount_voucher.discount.apply_to_items_proportionally | | | voucher.discount_voucher.discount.apply_to_items_proportionally_by_quantity | | | voucher.discount_voucher.discount.fixed.apply_to_items | | | voucher.gift_voucher | | | voucher.gift_voucher.gift.apply_to_order | | | voucher.gift_voucher.gift.apply_to_items | | | voucher.loyalty_card | | | voucher.lucky_draw_code | | | distribution.custom_event | | | reward_assignment.pay_with_points | | | global | |") + context_type: Optional[StrictStr] = Field(default='global', description="Validation rule context type. | **Context Type** | **Definition** | |:---|:---| | earning_rule.order.paid | | | earning_rule.custom_event | | | earning_rule.customer.segment.entered | | | campaign.discount_coupons | | | campaign.discount_coupons.discount.apply_to_order | | | campaign.discount_coupons.discount.apply_to_items | | | campaign.discount_coupons.discount.apply_to_items_proportionally | | | campaign.discount_coupons.discount.apply_to_items_proportionally_by_quantity | | | campaign.discount_coupons.discount.fixed.apply_to_items | | | campaign.gift_vouchers | | | campaign.gift_vouchers.gift.apply_to_order | | | campaign.gift_vouchers.gift.apply_to_items | | | campaign.referral_program | | | campaign.referral_program.discount.apply_to_order | | | campaign.referral_program.discount.apply_to_items | | | campaign.referral_program.discount.apply_to_items_proportionally | | | campaign.referral_program.discount.apply_to_items_proportionally_by_quantity | | | campaign.referral_program.discount.fixed.apply_to_items | | | campaign.promotion | | | campaign.promotion.discount.apply_to_order | | | campaign.promotion.discount.apply_to_items | | | campaign.promotion.discount.apply_to_items_proportionally | | | campaign.promotion.discount.apply_to_items_proportionally_by_quantity | | | campaign.promotion.discount.fixed.apply_to_items | | | campaign.loyalty_program | | | voucher.discount_voucher | | | voucher.discount_voucher.discount.apply_to_order | | | voucher.discount_voucher.discount.apply_to_items | | | voucher.discount_voucher.discount.apply_to_items_proportionally | | | voucher.discount_voucher.discount.apply_to_items_proportionally_by_quantity | | | voucher.discount_voucher.discount.fixed.apply_to_items | | | voucher.gift_voucher | | | voucher.gift_voucher.gift.apply_to_order | | | voucher.gift_voucher.gift.apply_to_items | | | voucher.loyalty_card | | | distribution.custom_event | | | reward_assignment.pay_with_points | | | global | |") id: Optional[StrictStr] = Field(default=None, description="Unique validation rule ID.") created_at: Optional[datetime] = Field(default=None, description="Timestamp representing the date and time when the validation rule was created. The value is shown in the ISO 8601 format.") updated_at: Optional[datetime] = Field(default=None, description="Timestamp representing the date and time when the validation rule was updated. The value is shown in the ISO 8601 format.") @@ -59,8 +59,8 @@ def context_type_validate_enum(cls, value): if value is None: return value - if value not in set(['earning_rule.order.paid', 'earning_rule.custom_event', 'earning_rule.customer.segment.entered', 'earning_rule.customer.tier.joined', 'earning_rule.customer.tier.left', 'earning_rule.customer.tier.upgraded', 'earning_rule.customer.tier.downgraded', 'earning_rule.customer.tier.prolonged', 'campaign.discount_coupons', 'campaign.discount_coupons.discount.apply_to_order', 'campaign.discount_coupons.discount.apply_to_items', 'campaign.discount_coupons.discount.apply_to_items_proportionally', 'campaign.discount_coupons.discount.apply_to_items_proportionally_by_quantity', 'campaign.discount_coupons.discount.apply_to_items_by_quantity', 'campaign.discount_coupons.discount.fixed.apply_to_items', 'campaign.discount_coupons.discount.percent.apply_to_items', 'campaign.gift_vouchers', 'campaign.gift_vouchers.gift.apply_to_order', 'campaign.gift_vouchers.gift.apply_to_items', 'campaign.referral_program', 'campaign.referral_program.discount.apply_to_order', 'campaign.referral_program.discount.apply_to_items', 'campaign.referral_program.discount.apply_to_items_proportionally', 'campaign.referral_program.discount.apply_to_items_proportionally_by_quantity', 'campaign.referral_program.discount.apply_to_items_by_quantity', 'campaign.referral_program.discount.fixed.apply_to_items', 'campaign.referral_program.discount.percent.apply_to_items', 'campaign.promotion', 'campaign.promotion.discount.apply_to_order', 'campaign.promotion.discount.apply_to_items', 'campaign.promotion.discount.apply_to_items_proportionally', 'campaign.promotion.discount.apply_to_items_proportionally_by_quantity', 'campaign.promotion.discount.apply_to_items_by_quantity', 'campaign.promotion.discount.fixed.apply_to_items', 'campaign.promotion.discount.percent.apply_to_items', 'campaign.loyalty_program', 'campaign.lucky_draw', 'voucher.discount_voucher', 'voucher.discount_voucher.discount.apply_to_order', 'voucher.discount_voucher.discount.apply_to_items', 'voucher.discount_voucher.discount.apply_to_items_proportionally', 'voucher.discount_voucher.discount.apply_to_items_proportionally_by_quantity', 'voucher.discount_voucher.discount.apply_to_items_by_quantity', 'voucher.discount_voucher.discount.fixed.apply_to_items', 'voucher.discount_voucher.discount.percent.apply_to_items', 'voucher.gift_voucher', 'voucher.gift_voucher.gift.apply_to_order', 'voucher.gift_voucher.gift.apply_to_items', 'voucher.loyalty_card', 'voucher.lucky_draw_code', 'distribution.custom_event', 'distribution.order.paid', 'distribution.order.created', 'distribution.order.canceled', 'distribution.order.updated', 'reward_assignment.pay_with_points', 'global']): - raise ValueError("must be one of enum values ('earning_rule.order.paid', 'earning_rule.custom_event', 'earning_rule.customer.segment.entered', 'earning_rule.customer.tier.joined', 'earning_rule.customer.tier.left', 'earning_rule.customer.tier.upgraded', 'earning_rule.customer.tier.downgraded', 'earning_rule.customer.tier.prolonged', 'campaign.discount_coupons', 'campaign.discount_coupons.discount.apply_to_order', 'campaign.discount_coupons.discount.apply_to_items', 'campaign.discount_coupons.discount.apply_to_items_proportionally', 'campaign.discount_coupons.discount.apply_to_items_proportionally_by_quantity', 'campaign.discount_coupons.discount.apply_to_items_by_quantity', 'campaign.discount_coupons.discount.fixed.apply_to_items', 'campaign.discount_coupons.discount.percent.apply_to_items', 'campaign.gift_vouchers', 'campaign.gift_vouchers.gift.apply_to_order', 'campaign.gift_vouchers.gift.apply_to_items', 'campaign.referral_program', 'campaign.referral_program.discount.apply_to_order', 'campaign.referral_program.discount.apply_to_items', 'campaign.referral_program.discount.apply_to_items_proportionally', 'campaign.referral_program.discount.apply_to_items_proportionally_by_quantity', 'campaign.referral_program.discount.apply_to_items_by_quantity', 'campaign.referral_program.discount.fixed.apply_to_items', 'campaign.referral_program.discount.percent.apply_to_items', 'campaign.promotion', 'campaign.promotion.discount.apply_to_order', 'campaign.promotion.discount.apply_to_items', 'campaign.promotion.discount.apply_to_items_proportionally', 'campaign.promotion.discount.apply_to_items_proportionally_by_quantity', 'campaign.promotion.discount.apply_to_items_by_quantity', 'campaign.promotion.discount.fixed.apply_to_items', 'campaign.promotion.discount.percent.apply_to_items', 'campaign.loyalty_program', 'campaign.lucky_draw', 'voucher.discount_voucher', 'voucher.discount_voucher.discount.apply_to_order', 'voucher.discount_voucher.discount.apply_to_items', 'voucher.discount_voucher.discount.apply_to_items_proportionally', 'voucher.discount_voucher.discount.apply_to_items_proportionally_by_quantity', 'voucher.discount_voucher.discount.apply_to_items_by_quantity', 'voucher.discount_voucher.discount.fixed.apply_to_items', 'voucher.discount_voucher.discount.percent.apply_to_items', 'voucher.gift_voucher', 'voucher.gift_voucher.gift.apply_to_order', 'voucher.gift_voucher.gift.apply_to_items', 'voucher.loyalty_card', 'voucher.lucky_draw_code', 'distribution.custom_event', 'distribution.order.paid', 'distribution.order.created', 'distribution.order.canceled', 'distribution.order.updated', 'reward_assignment.pay_with_points', 'global')") + if value not in set(['earning_rule.order.paid', 'earning_rule.custom_event', 'earning_rule.customer.segment.entered', 'earning_rule.customer.tier.joined', 'earning_rule.customer.tier.left', 'earning_rule.customer.tier.upgraded', 'earning_rule.customer.tier.downgraded', 'earning_rule.customer.tier.prolonged', 'campaign.discount_coupons', 'campaign.discount_coupons.discount.apply_to_order', 'campaign.discount_coupons.discount.apply_to_items', 'campaign.discount_coupons.discount.apply_to_items_proportionally', 'campaign.discount_coupons.discount.apply_to_items_proportionally_by_quantity', 'campaign.discount_coupons.discount.apply_to_items_by_quantity', 'campaign.discount_coupons.discount.fixed.apply_to_items', 'campaign.discount_coupons.discount.percent.apply_to_items', 'campaign.gift_vouchers', 'campaign.gift_vouchers.gift.apply_to_order', 'campaign.gift_vouchers.gift.apply_to_items', 'campaign.referral_program', 'campaign.referral_program.discount.apply_to_order', 'campaign.referral_program.discount.apply_to_items', 'campaign.referral_program.discount.apply_to_items_proportionally', 'campaign.referral_program.discount.apply_to_items_proportionally_by_quantity', 'campaign.referral_program.discount.apply_to_items_by_quantity', 'campaign.referral_program.discount.fixed.apply_to_items', 'campaign.referral_program.discount.percent.apply_to_items', 'campaign.promotion', 'campaign.promotion.discount.apply_to_order', 'campaign.promotion.discount.apply_to_items', 'campaign.promotion.discount.apply_to_items_proportionally', 'campaign.promotion.discount.apply_to_items_proportionally_by_quantity', 'campaign.promotion.discount.apply_to_items_by_quantity', 'campaign.promotion.discount.fixed.apply_to_items', 'campaign.promotion.discount.percent.apply_to_items', 'campaign.loyalty_program', 'voucher.discount_voucher', 'voucher.discount_voucher.discount.apply_to_order', 'voucher.discount_voucher.discount.apply_to_items', 'voucher.discount_voucher.discount.apply_to_items_proportionally', 'voucher.discount_voucher.discount.apply_to_items_proportionally_by_quantity', 'voucher.discount_voucher.discount.apply_to_items_by_quantity', 'voucher.discount_voucher.discount.fixed.apply_to_items', 'voucher.discount_voucher.discount.percent.apply_to_items', 'voucher.gift_voucher', 'voucher.gift_voucher.gift.apply_to_order', 'voucher.gift_voucher.gift.apply_to_items', 'voucher.loyalty_card', 'distribution.custom_event', 'distribution.order.paid', 'distribution.order.created', 'distribution.order.canceled', 'distribution.order.updated', 'reward_assignment.pay_with_points', 'global']): + raise ValueError("must be one of enum values ('earning_rule.order.paid', 'earning_rule.custom_event', 'earning_rule.customer.segment.entered', 'earning_rule.customer.tier.joined', 'earning_rule.customer.tier.left', 'earning_rule.customer.tier.upgraded', 'earning_rule.customer.tier.downgraded', 'earning_rule.customer.tier.prolonged', 'campaign.discount_coupons', 'campaign.discount_coupons.discount.apply_to_order', 'campaign.discount_coupons.discount.apply_to_items', 'campaign.discount_coupons.discount.apply_to_items_proportionally', 'campaign.discount_coupons.discount.apply_to_items_proportionally_by_quantity', 'campaign.discount_coupons.discount.apply_to_items_by_quantity', 'campaign.discount_coupons.discount.fixed.apply_to_items', 'campaign.discount_coupons.discount.percent.apply_to_items', 'campaign.gift_vouchers', 'campaign.gift_vouchers.gift.apply_to_order', 'campaign.gift_vouchers.gift.apply_to_items', 'campaign.referral_program', 'campaign.referral_program.discount.apply_to_order', 'campaign.referral_program.discount.apply_to_items', 'campaign.referral_program.discount.apply_to_items_proportionally', 'campaign.referral_program.discount.apply_to_items_proportionally_by_quantity', 'campaign.referral_program.discount.apply_to_items_by_quantity', 'campaign.referral_program.discount.fixed.apply_to_items', 'campaign.referral_program.discount.percent.apply_to_items', 'campaign.promotion', 'campaign.promotion.discount.apply_to_order', 'campaign.promotion.discount.apply_to_items', 'campaign.promotion.discount.apply_to_items_proportionally', 'campaign.promotion.discount.apply_to_items_proportionally_by_quantity', 'campaign.promotion.discount.apply_to_items_by_quantity', 'campaign.promotion.discount.fixed.apply_to_items', 'campaign.promotion.discount.percent.apply_to_items', 'campaign.loyalty_program', 'voucher.discount_voucher', 'voucher.discount_voucher.discount.apply_to_order', 'voucher.discount_voucher.discount.apply_to_items', 'voucher.discount_voucher.discount.apply_to_items_proportionally', 'voucher.discount_voucher.discount.apply_to_items_proportionally_by_quantity', 'voucher.discount_voucher.discount.apply_to_items_by_quantity', 'voucher.discount_voucher.discount.fixed.apply_to_items', 'voucher.discount_voucher.discount.percent.apply_to_items', 'voucher.gift_voucher', 'voucher.gift_voucher.gift.apply_to_order', 'voucher.gift_voucher.gift.apply_to_items', 'voucher.loyalty_card', 'distribution.custom_event', 'distribution.order.paid', 'distribution.order.created', 'distribution.order.canceled', 'distribution.order.updated', 'reward_assignment.pay_with_points', 'global')") return value model_config = ConfigDict(