diff --git a/README.md b/README.md index a8700596..b693c20f 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ The API is available at the same hostname as these docs. For example, if you are This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [OpenAPI-spec](https://www.openapis.org/) from a remote server, you can easily generate an API client. - API version: 1.0.0 -- Package version: 2.0.0 +- Package version: 2.1.0 - Build package: org.openapitools.codegen.languages.GoClientExperimentalCodegen ## Installation @@ -341,10 +341,10 @@ Class | Method | HTTP request | Description *IntegrationApi* | [**DeleteCouponReservation**](docs/IntegrationApi.md#deletecouponreservation) | **Delete** /v1/coupon_reservations/{couponValue} | Delete coupon reservations *IntegrationApi* | [**DeleteCustomerData**](docs/IntegrationApi.md#deletecustomerdata) | **Delete** /v1/customer_data/{integrationId} | Delete the personal data of a customer. *IntegrationApi* | [**GetCustomerInventory**](docs/IntegrationApi.md#getcustomerinventory) | **Get** /v1/customer_profiles/{integrationId}/inventory | Get an inventory of all data associated with a specific customer profile. -*IntegrationApi* | [**GetReservedCoupons**](docs/IntegrationApi.md#getreservedcoupons) | **Get** /v1/coupon_reservations/coupons/{integrationId} | Get all valid reserved coupons *IntegrationApi* | [**GetReservedCustomers**](docs/IntegrationApi.md#getreservedcustomers) | **Get** /v1/coupon_reservations/customerprofiles/{couponValue} | Get the users that have this coupon reserved *IntegrationApi* | [**TrackEvent**](docs/IntegrationApi.md#trackevent) | **Post** /v1/events | Track an Event *IntegrationApi* | [**UpdateCustomerProfile**](docs/IntegrationApi.md#updatecustomerprofile) | **Put** /v1/customer_profiles/{integrationId} | Update a Customer Profile +*IntegrationApi* | [**UpdateCustomerProfileV2**](docs/IntegrationApi.md#updatecustomerprofilev2) | **Put** /v2/customer_profiles/{customerProfileId} | Update a Customer Profile *IntegrationApi* | [**UpdateCustomerSession**](docs/IntegrationApi.md#updatecustomersession) | **Put** /v1/customer_sessions/{customerSessionId} | Update a Customer Session *IntegrationApi* | [**UpdateCustomerSessionV2**](docs/IntegrationApi.md#updatecustomersessionv2) | **Put** /v2/customer_sessions/{customerSessionId} | Update a Customer Session *ManagementApi* | [**AddLoyaltyPoints**](docs/ManagementApi.md#addloyaltypoints) | **Put** /v1/loyalty_programs/{programID}/profile/{integrationID}/add_points | Add points in a certain loyalty program for the specified customer @@ -385,7 +385,6 @@ Class | Method | HTTP request | Description *ManagementApi* | [**GetCampaign**](docs/ManagementApi.md#getcampaign) | **Get** /v1/applications/{applicationId}/campaigns/{campaignId} | Get a Campaign *ManagementApi* | [**GetCampaignAnalytics**](docs/ManagementApi.md#getcampaignanalytics) | **Get** /v1/applications/{applicationId}/campaigns/{campaignId}/analytics | Get analytics of campaigns *ManagementApi* | [**GetCampaignByAttributes**](docs/ManagementApi.md#getcampaignbyattributes) | **Post** /v1/applications/{applicationId}/campaigns_search | Get a list of all campaigns that match the given attributes -*ManagementApi* | [**GetCampaignSet**](docs/ManagementApi.md#getcampaignset) | **Get** /v1/applications/{applicationId}/campaign_set | List CampaignSet *ManagementApi* | [**GetCampaigns**](docs/ManagementApi.md#getcampaigns) | **Get** /v1/applications/{applicationId}/campaigns | List your Campaigns *ManagementApi* | [**GetChanges**](docs/ManagementApi.md#getchanges) | **Get** /v1/changes | Get audit log for an account *ManagementApi* | [**GetCoupons**](docs/ManagementApi.md#getcoupons) | **Get** /v1/applications/{applicationId}/campaigns/{campaignId}/coupons | List Coupons @@ -425,7 +424,6 @@ Class | Method | HTTP request | Description *ManagementApi* | [**UpdateAdditionalCost**](docs/ManagementApi.md#updateadditionalcost) | **Put** /v1/additional_costs/{additionalCostId} | Update an additional cost *ManagementApi* | [**UpdateAttribute**](docs/ManagementApi.md#updateattribute) | **Put** /v1/attributes/{attributeId} | Update a custom attribute *ManagementApi* | [**UpdateCampaign**](docs/ManagementApi.md#updatecampaign) | **Put** /v1/applications/{applicationId}/campaigns/{campaignId} | Update a Campaign -*ManagementApi* | [**UpdateCampaignSet**](docs/ManagementApi.md#updatecampaignset) | **Put** /v1/applications/{applicationId}/campaign_set | Update a Campaign Set *ManagementApi* | [**UpdateCoupon**](docs/ManagementApi.md#updatecoupon) | **Put** /v1/applications/{applicationId}/campaigns/{campaignId}/coupons/{couponId} | Update a Coupon *ManagementApi* | [**UpdateCouponBatch**](docs/ManagementApi.md#updatecouponbatch) | **Put** /v1/applications/{applicationId}/campaigns/{campaignId}/coupons | Update a Batch of Coupons *ManagementApi* | [**UpdateRuleset**](docs/ManagementApi.md#updateruleset) | **Put** /v1/applications/{applicationId}/campaigns/{campaignId}/rulesets/{rulesetId} | Update a Ruleset @@ -487,6 +485,7 @@ Class | Method | HTTP request | Description - [CustomerInventory](docs/CustomerInventory.md) - [CustomerProfile](docs/CustomerProfile.md) - [CustomerProfileSearchQuery](docs/CustomerProfileSearchQuery.md) + - [CustomerProfileUpdate](docs/CustomerProfileUpdate.md) - [CustomerSession](docs/CustomerSession.md) - [CustomerSessionV2](docs/CustomerSessionV2.md) - [DeductLoyaltyPointsEffectProps](docs/DeductLoyaltyPointsEffectProps.md) diff --git a/api/openapi.yaml b/api/openapi.yaml index 3bf4390b..d9606dcf 100644 --- a/api/openapi.yaml +++ b/api/openapi.yaml @@ -66,6 +66,12 @@ paths: [Rules]: /Getting-Started/entities#campaigns-rulesets-and-coupons operationId: updateCustomerProfile parameters: + - description: Flag to indicate whether to skip persisting the changes or not + (Will not persist if set to 'true'). + in: query + name: dry + schema: + type: boolean - description: The custom identifier for this profile, must be unique within the account. in: path @@ -109,6 +115,12 @@ paths: [Customer Session]: /Getting-Started/entities#customer-session operationId: updateCustomerSession parameters: + - description: Flag to indicate whether to skip persisting the changes or not + (Will not persist if set to 'true'). + in: query + name: dry + schema: + type: boolean - description: The custom identifier for this session, must be unique within the account. in: path @@ -147,6 +159,13 @@ paths: Updating a customer profile will return a response with the full integration state. This includes the current state of the customer profile, the customer session, the event that was recorded, and an array of effects that took place. operationId: trackEvent + parameters: + - description: Flag to indicate whether to skip persisting the changes or not + (Will not persist if set to 'true'). + in: query + name: dry + schema: + type: boolean requestBody: content: application/json: @@ -300,37 +319,11 @@ paths: summary: Get the users that have this coupon reserved tags: - integration - /v1/coupon_reservations/coupons/{integrationId}: - get: - description: | - Returns all coupons this user is subscribed to that are valid and usable - operationId: getReservedCoupons - parameters: - - description: The custom identifier for this profile, must be unique within - the account. - in: path - name: integrationId - required: true - schema: - type: string - responses: - "200": - content: - application/json: - schema: - $ref: '#/components/schemas/inline_response_200_1' - description: OK - security: - - api_key_v1: [] - - integration_auth: [] - summary: Get all valid reserved coupons - tags: - - integration /v1/customer_profiles/{integrationId}/inventory: get: description: Get information regarding entities referencing this customer profile's - integrationId. Currently we support customer profile information and referral - codes. In the future, this will be expanded with coupon codes and loyalty + integrationId. Currently we support customer profile information, referral + codes and reserved coupons. In the future, this will be expanded with loyalty points. operationId: getCustomerInventory parameters: @@ -353,6 +346,12 @@ paths: name: referrals schema: type: boolean + - description: optional flag to decide if you would like coupon information + in the response + in: query + name: coupons + schema: + type: boolean responses: "200": content: @@ -382,6 +381,12 @@ paths: [Customer Session]: /Getting-Started/entities#customer-session operationId: updateCustomerSessionV2 parameters: + - description: Flag to indicate whether to skip persisting the changes or not + (Will not persist if set to 'true'). + in: query + name: dry + schema: + type: boolean - description: The custom identifier for this session, must be unique within the account. in: path @@ -408,6 +413,43 @@ paths: tags: - integration x-codegen-request-body-name: body + /v2/customer_profiles/{customerProfileId}: + put: + description: "Update (or create) a [Customer Profile][]. \n\nThe `integrationId`\ + \ may be any identifier that will remain stable for the customer. For example,\ + \ you might use a database ID, an email, or a phone number as the `integrationId`.\ + \ It is vital that this ID **not** change over time, so **don't** use any\ + \ identifier that the customer can update themselves. E.g. if your application\ + \ allows a customer to update their e-mail address, you should instead use\ + \ a database ID.\n\n[Customer Profile]: /Getting-Started/entities#customer-profile\n" + operationId: updateCustomerProfileV2 + parameters: + - description: The custom identifier for this profile, must be unique within + the account. + in: path + name: customerProfileId + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/NewCustomerProfile' + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/CustomerProfileUpdate' + description: OK + security: + - api_key_v1: [] + summary: Update a Customer Profile + tags: + - integration + x-codegen-request-body-name: body /v1/applications: get: description: List all application in the current account. @@ -437,7 +479,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/inline_response_200_2' + $ref: '#/components/schemas/inline_response_200_1' description: OK summary: List Applications tags: @@ -534,7 +576,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/inline_response_200_3' + $ref: '#/components/schemas/inline_response_200_2' description: OK summary: List your Campaigns tags: @@ -564,50 +606,6 @@ paths: tags: - management x-codegen-request-body-name: body - /v1/applications/{applicationId}/campaign_set: - get: - operationId: getCampaignSet - parameters: - - in: path - name: applicationId - required: true - schema: - type: integer - responses: - "200": - content: - application/json: - schema: - $ref: '#/components/schemas/CampaignSet' - description: OK - summary: List CampaignSet - tags: - - management - put: - operationId: updateCampaignSet - parameters: - - in: path - name: applicationId - required: true - schema: - type: integer - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/NewCampaignSet' - required: true - responses: - "200": - content: - application/json: - schema: - $ref: '#/components/schemas/CampaignSet' - description: OK - summary: Update a Campaign Set - tags: - - management - x-codegen-request-body-name: body /v1/applications/{applicationId}/campaigns/{campaignId}: delete: operationId: deleteCampaign @@ -708,7 +706,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/inline_response_200_3' + $ref: '#/components/schemas/inline_response_200_2' description: OK summary: Copy the campaign into every specified application tags: @@ -768,7 +766,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/inline_response_200_3' + $ref: '#/components/schemas/inline_response_200_2' description: OK summary: Get a list of all campaigns that match the given attributes tags: @@ -812,7 +810,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/inline_response_200_4' + $ref: '#/components/schemas/inline_response_200_3' description: OK summary: List Campaign Rulesets tags: @@ -1180,7 +1178,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/inline_response_200_1' + $ref: '#/components/schemas/inline_response_200_4' description: OK summary: List Coupons tags: @@ -1218,7 +1216,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/inline_response_200_1' + $ref: '#/components/schemas/inline_response_200_4' description: OK "204": content: {} @@ -1538,7 +1536,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/inline_response_200_1' + $ref: '#/components/schemas/inline_response_200_4' description: OK summary: Get a list of the coupons that match the given attributes tags: @@ -1663,7 +1661,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/inline_response_200_1' + $ref: '#/components/schemas/inline_response_200_4' description: OK summary: Get a list of the coupons that match the given attributes in all active campaigns of an application @@ -1781,7 +1779,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/inline_response_200_1' + $ref: '#/components/schemas/inline_response_200_4' description: OK summary: Get a list of the coupons that match the given attributes tags: @@ -2023,7 +2021,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/inline_response_200_1' + $ref: '#/components/schemas/inline_response_200_4' description: OK summary: Get a list of the coupons that match the given attributes in all active campaigns of an application @@ -4569,6 +4567,12 @@ components: maximum: 999999 minimum: 0 type: integer + discountLimit: + description: | + The amount of discounts that can be given with this coupon code. + maximum: 999999 + minimum: 0 + type: number startDate: description: Timestamp at which point the coupon becomes valid. format: date-time @@ -4708,6 +4712,14 @@ components: items: $ref: '#/components/schemas/LimitConfig' type: array + campaignPriority: + description: Default priority for campaigns created in this application, + can be one of (universal, stackable, exclusive) + enum: + - universal + - stackable + - exclusive + type: string attributesSettings: $ref: '#/components/schemas/AttributesSettings' required: @@ -4750,13 +4762,19 @@ components: items: $ref: '#/components/schemas/LimitConfig' type: array + campaignPriority: + description: Default priority for campaigns created in this application, + can be one of (universal, stackable, exclusive) + enum: + - universal + - stackable + - exclusive + type: string attributesSettings: $ref: '#/components/schemas/AttributesSettings' key: description: Hex key for HMAC-signing API calls as coming from this application (16 hex digits) - maxLength: 16 - minLength: 16 pattern: ^[a-fA-F0-9]{16}$ type: string required: @@ -4780,6 +4798,7 @@ components: - coupons caseSensitivity: sensitive accountId: 1 + campaignPriority: universal loyaltyPrograms: - accountID: 5 defaultValidity: defaultValidity @@ -4864,6 +4883,14 @@ components: items: $ref: '#/components/schemas/LimitConfig' type: array + campaignPriority: + description: Default priority for campaigns created in this application, + can be one of (universal, stackable, exclusive) + enum: + - universal + - stackable + - exclusive + type: string attributesSettings: $ref: '#/components/schemas/AttributesSettings' loyaltyPrograms: @@ -5559,17 +5586,6 @@ components: type: object CampaignSet: description: "" - example: - set: - elements: - - type: type - - type: type - name: name - type: SET - operator: ALL - created: 2000-01-23T04:56:07.000+00:00 - id: 0 - applicationId: 6 properties: id: description: Unique ID for this entity. @@ -5581,6 +5597,10 @@ components: applicationId: description: The ID of the application that owns this entity. type: integer + version: + description: Version of the campaign set + minimum: 1 + type: integer set: $ref: '#/components/schemas/CampaignSetBranchNode' required: @@ -5588,10 +5608,9 @@ components: - created - id - set + - version type: object CampaignSetNode: - example: - type: type properties: type: type: string @@ -5599,13 +5618,6 @@ components: - type type: object CampaignSetBranchNode: - example: - elements: - - type: type - - type: type - name: name - type: SET - operator: ALL properties: type: description: Indicates the node type @@ -5648,24 +5660,20 @@ components: type: object NewCampaignSet: description: "" - example: - set: - elements: - - type: type - - type: type - name: name - type: SET - operator: ALL - applicationId: 0 properties: applicationId: description: The ID of the application that owns this entity. type: integer + version: + description: Version of the campaign set + minimum: 1 + type: integer set: $ref: '#/components/schemas/CampaignSetBranchNode' required: - applicationId - set + - version type: object NewReferral: example: @@ -5756,12 +5764,13 @@ components: usageCounter: description: The number of times this referral code has been successfully used. - title: Referral Code Usages + title: Referral code Usages type: integer usageLimit: description: | The number of times a referral code can be used. This can be set to 0 for no limit, but any campaign usage limits will still apply. minimum: 0 + title: Referral code Usage Limit type: integer required: - advocateProfileIntegrationId @@ -5858,8 +5867,9 @@ components: - validCharacters - validCharacters usageLimit: 80082 - numberOfCoupons: 6 + numberOfCoupons: 1 attributes: '{}' + discountLimit: 602745.015561422 startDate: 2000-01-23T04:56:07.000+00:00 properties: usageLimit: @@ -5868,6 +5878,12 @@ components: maximum: 999999 minimum: 0 type: integer + discountLimit: + description: | + The amount of discounts that can be given with this coupon code. + maximum: 999999 + minimum: 0 + type: number startDate: description: Timestamp at which point the coupon becomes valid. format: date-time @@ -5917,6 +5933,7 @@ components: recipientIntegrationId: recipientIntegrationId usageLimit: 80082 attributes: '{}' + discountLimit: 602745.015561422 startDate: 2000-01-23T04:56:07.000+00:00 properties: usageLimit: @@ -5925,6 +5942,12 @@ components: maximum: 999999 minimum: 0 type: integer + discountLimit: + description: | + The amount of discounts that can be given with this coupon code. + maximum: 999999 + minimum: 0 + type: number startDate: description: Timestamp at which point the coupon becomes valid. format: date-time @@ -5950,6 +5973,7 @@ components: usageLimit: 80082 attributes: '{}' batchID: batchID + discountLimit: 602745.015561422 startDate: 2000-01-23T04:56:07.000+00:00 properties: usageLimit: @@ -5958,6 +5982,12 @@ components: maximum: 999999 minimum: 0 type: integer + discountLimit: + description: | + The amount of discounts that can be given with this coupon code. + maximum: 999999 + minimum: 0 + type: number startDate: description: Timestamp at which point the coupon becomes valid. format: date-time @@ -5985,16 +6015,19 @@ components: created: 2000-01-23T04:56:07.000+00:00 campaignId: 6 usageLimit: 594488 - referralId: 3 - usageCounter: 6 + referralId: 0 + usageCounter: 3 batchId: batchId + discountCounter: 3.0937452626664474 expiryDate: 2000-01-23T04:56:07.000+00:00 - importId: 3 + importId: 7 reservation: true attributes: '{}' id: 6 value: value + discountLimit: 670401.2593930737 startDate: 2000-01-23T04:56:07.000+00:00 + discountRemainder: 7.143538047012306 properties: id: description: Unique ID for this entity. @@ -6018,6 +6051,12 @@ components: maximum: 999999 minimum: 0 type: integer + discountLimit: + description: | + The amount of discounts that can be given with this coupon code. + maximum: 999999 + minimum: 0 + type: number startDate: description: Timestamp at which point the coupon becomes valid. format: date-time @@ -6031,6 +6070,15 @@ components: description: The number of times this coupon has been successfully used. title: Number of coupon usages type: integer + discountCounter: + description: The amount of discounts given on rules redeeming this coupon. + Only usable if a coupon discount budget was set for this coupon. + title: Discounts Given + type: number + discountRemainder: + description: The remaining discount this coupon can give. + title: Coupon Discount Remainder + type: number attributes: description: Arbitrary properties associated with this item properties: {} @@ -6042,8 +6090,9 @@ components: title: Advocate ID type: integer recipientIntegrationId: - description: The integration ID of a referred customer profile. - title: Friend ID + description: The Integration ID of the customer that is allowed to redeem + this coupon. + title: Recipient ID type: string importId: description: The ID of the Import which created this coupon. @@ -6054,7 +6103,7 @@ components: set to true the coupon reservation is used to mark it as a favourite, if set to false the coupon reservation is used as a requirement of usage. This value defaults to true if not specified. - title: reservation status + title: Reservation Status type: boolean batchId: description: The id of the batch the coupon belongs to. @@ -6633,6 +6682,7 @@ components: subLedgerID: subLedgerID customerSessionID: customerSessionID type: addition + userID: 5 programID: 6 properties: created: @@ -6664,6 +6714,10 @@ components: description: This specifies if we are adding loyalty points to the main ledger or a subledger type: string + userID: + description: This is the ID of the user who created this entry, if the addition + or subtraction was done manually. + type: integer required: - amount - created @@ -6688,6 +6742,7 @@ components: subLedgerID: subLedgerID customerSessionID: customerSessionID type: addition + userID: 5 programID: 6 - expiryDate: 2000-01-23T04:56:07.000+00:00 eventID: 1 @@ -6698,6 +6753,7 @@ components: subLedgerID: subLedgerID customerSessionID: customerSessionID type: addition + userID: 5 programID: 6 transactions: - expiryDate: 2000-01-23T04:56:07.000+00:00 @@ -6709,6 +6765,7 @@ components: subLedgerID: subLedgerID customerSessionID: customerSessionID type: addition + userID: 5 programID: 6 - expiryDate: 2000-01-23T04:56:07.000+00:00 eventID: 1 @@ -6719,6 +6776,7 @@ components: subLedgerID: subLedgerID customerSessionID: customerSessionID type: addition + userID: 5 programID: 6 subLedgers: key: @@ -6733,6 +6791,7 @@ components: subLedgerID: subLedgerID customerSessionID: customerSessionID type: addition + userID: 5 programID: 6 - expiryDate: 2000-01-23T04:56:07.000+00:00 eventID: 1 @@ -6743,6 +6802,7 @@ components: subLedgerID: subLedgerID customerSessionID: customerSessionID type: addition + userID: 5 programID: 6 transactions: - expiryDate: 2000-01-23T04:56:07.000+00:00 @@ -6754,6 +6814,7 @@ components: subLedgerID: subLedgerID customerSessionID: customerSessionID type: addition + userID: 5 programID: 6 - expiryDate: 2000-01-23T04:56:07.000+00:00 eventID: 1 @@ -6764,6 +6825,7 @@ components: subLedgerID: subLedgerID customerSessionID: customerSessionID type: addition + userID: 5 programID: 6 properties: ledger: @@ -6790,6 +6852,7 @@ components: subLedgerID: subLedgerID customerSessionID: customerSessionID type: addition + userID: 5 programID: 6 - expiryDate: 2000-01-23T04:56:07.000+00:00 eventID: 1 @@ -6800,6 +6863,7 @@ components: subLedgerID: subLedgerID customerSessionID: customerSessionID type: addition + userID: 5 programID: 6 transactions: - expiryDate: 2000-01-23T04:56:07.000+00:00 @@ -6811,6 +6875,7 @@ components: subLedgerID: subLedgerID customerSessionID: customerSessionID type: addition + userID: 5 programID: 6 - expiryDate: 2000-01-23T04:56:07.000+00:00 eventID: 1 @@ -6821,6 +6886,7 @@ components: subLedgerID: subLedgerID customerSessionID: customerSessionID type: addition + userID: 5 programID: 6 properties: total: @@ -7013,8 +7079,64 @@ components: - lastActivity - totalSales type: object + CustomerProfileUpdate: + example: + customerProfile: + accountId: 1 + closedSessions: 1 + created: 2000-01-23T04:56:07.000+00:00 + integrationId: integrationId + attributes: '{}' + totalSales: 6.84685269835264 + lastActivity: 2000-01-23T04:56:07.000+00:00 + loyaltyMemberships: + - joined: 2000-01-23T04:56:07.000+00:00 + loyaltyProgramId: 7 + - joined: 2000-01-23T04:56:07.000+00:00 + loyaltyProgramId: 7 + properties: + customerProfile: + $ref: '#/components/schemas/CustomerProfile' + required: + - customerProfile + type: object CustomerInventory: example: + coupons: + - recipientIntegrationId: recipientIntegrationId + created: 2000-01-23T04:56:07.000+00:00 + campaignId: 6 + usageLimit: 594488 + referralId: 0 + usageCounter: 3 + batchId: batchId + discountCounter: 3.0937452626664474 + expiryDate: 2000-01-23T04:56:07.000+00:00 + importId: 7 + reservation: true + attributes: '{}' + id: 6 + value: value + discountLimit: 670401.2593930737 + startDate: 2000-01-23T04:56:07.000+00:00 + discountRemainder: 7.143538047012306 + - recipientIntegrationId: recipientIntegrationId + created: 2000-01-23T04:56:07.000+00:00 + campaignId: 6 + usageLimit: 594488 + referralId: 0 + usageCounter: 3 + batchId: batchId + discountCounter: 3.0937452626664474 + expiryDate: 2000-01-23T04:56:07.000+00:00 + importId: 7 + reservation: true + attributes: '{}' + id: 6 + value: value + discountLimit: 670401.2593930737 + startDate: 2000-01-23T04:56:07.000+00:00 + discountRemainder: 7.143538047012306 referrals: - expiryDate: 2000-01-23T04:56:07.000+00:00 code: code @@ -7056,6 +7178,10 @@ components: items: $ref: '#/components/schemas/Referral' type: array + coupons: + items: + $ref: '#/components/schemas/Coupon' + type: array type: object NewCustomerSession: description: "" @@ -7897,16 +8023,19 @@ components: created: 2000-01-23T04:56:07.000+00:00 campaignId: 6 usageLimit: 594488 - referralId: 3 - usageCounter: 6 + referralId: 0 + usageCounter: 3 batchId: batchId + discountCounter: 3.0937452626664474 expiryDate: 2000-01-23T04:56:07.000+00:00 - importId: 3 + importId: 7 reservation: true attributes: '{}' id: 6 value: value + discountLimit: 670401.2593930737 startDate: 2000-01-23T04:56:07.000+00:00 + discountRemainder: 7.143538047012306 session: coupon: coupon created: 2000-01-23T04:56:07.000+00:00 @@ -8173,30 +8302,36 @@ components: created: 2000-01-23T04:56:07.000+00:00 campaignId: 6 usageLimit: 594488 - referralId: 3 - usageCounter: 6 + referralId: 0 + usageCounter: 3 batchId: batchId + discountCounter: 3.0937452626664474 expiryDate: 2000-01-23T04:56:07.000+00:00 - importId: 3 + importId: 7 reservation: true attributes: '{}' id: 6 value: value + discountLimit: 670401.2593930737 startDate: 2000-01-23T04:56:07.000+00:00 + discountRemainder: 7.143538047012306 - recipientIntegrationId: recipientIntegrationId created: 2000-01-23T04:56:07.000+00:00 campaignId: 6 usageLimit: 594488 - referralId: 3 - usageCounter: 6 + referralId: 0 + usageCounter: 3 batchId: batchId + discountCounter: 3.0937452626664474 expiryDate: 2000-01-23T04:56:07.000+00:00 - importId: 3 + importId: 7 reservation: true attributes: '{}' id: 6 value: value + discountLimit: 670401.2593930737 startDate: 2000-01-23T04:56:07.000+00:00 + discountRemainder: 7.143538047012306 customerProfile: accountId: 1 closedSessions: 1 @@ -8321,30 +8456,36 @@ components: created: 2000-01-23T04:56:07.000+00:00 campaignId: 6 usageLimit: 594488 - referralId: 3 - usageCounter: 6 + referralId: 0 + usageCounter: 3 batchId: batchId + discountCounter: 3.0937452626664474 expiryDate: 2000-01-23T04:56:07.000+00:00 - importId: 3 + importId: 7 reservation: true attributes: '{}' id: 6 value: value + discountLimit: 670401.2593930737 startDate: 2000-01-23T04:56:07.000+00:00 + discountRemainder: 7.143538047012306 - recipientIntegrationId: recipientIntegrationId created: 2000-01-23T04:56:07.000+00:00 campaignId: 6 usageLimit: 594488 - referralId: 3 - usageCounter: 6 + referralId: 0 + usageCounter: 3 batchId: batchId + discountCounter: 3.0937452626664474 expiryDate: 2000-01-23T04:56:07.000+00:00 - importId: 3 + importId: 7 reservation: true attributes: '{}' id: 6 value: value + discountLimit: 670401.2593930737 startDate: 2000-01-23T04:56:07.000+00:00 + discountRemainder: 7.143538047012306 createdReferrals: - expiryDate: 2000-01-23T04:56:07.000+00:00 code: code @@ -8582,6 +8723,7 @@ components: - integrationId - referral - state + - total type: object ApplicationEvent: description: "" @@ -11111,48 +11253,6 @@ components: - data - totalResultSize inline_response_200_1: - example: - data: - - recipientIntegrationId: recipientIntegrationId - created: 2000-01-23T04:56:07.000+00:00 - campaignId: 6 - usageLimit: 594488 - referralId: 3 - usageCounter: 6 - batchId: batchId - expiryDate: 2000-01-23T04:56:07.000+00:00 - importId: 3 - reservation: true - attributes: '{}' - id: 6 - value: value - startDate: 2000-01-23T04:56:07.000+00:00 - - recipientIntegrationId: recipientIntegrationId - created: 2000-01-23T04:56:07.000+00:00 - campaignId: 6 - usageLimit: 594488 - referralId: 3 - usageCounter: 6 - batchId: batchId - expiryDate: 2000-01-23T04:56:07.000+00:00 - importId: 3 - reservation: true - attributes: '{}' - id: 6 - value: value - startDate: 2000-01-23T04:56:07.000+00:00 - totalResultSize: 0 - properties: - totalResultSize: - type: integer - data: - items: - $ref: '#/components/schemas/Coupon' - type: array - required: - - data - - totalResultSize - inline_response_200_2: example: data: - created: 2000-01-23T04:56:07.000+00:00 @@ -11168,6 +11268,7 @@ components: - coupons caseSensitivity: sensitive accountId: 1 + campaignPriority: universal loyaltyPrograms: - accountID: 5 defaultValidity: defaultValidity @@ -11218,6 +11319,7 @@ components: - coupons caseSensitivity: sensitive accountId: 1 + campaignPriority: universal loyaltyPrograms: - accountID: 5 defaultValidity: defaultValidity @@ -11266,7 +11368,7 @@ components: required: - data - totalResultSize - inline_response_200_3: + inline_response_200_2: example: data: - discountCount: 1 @@ -11382,7 +11484,7 @@ components: required: - data - totalResultSize - inline_response_200_4: + inline_response_200_3: example: data: - rbVersion: rbVersion @@ -11498,6 +11600,54 @@ components: required: - data - totalResultSize + inline_response_200_4: + example: + data: + - recipientIntegrationId: recipientIntegrationId + created: 2000-01-23T04:56:07.000+00:00 + campaignId: 6 + usageLimit: 594488 + referralId: 0 + usageCounter: 3 + batchId: batchId + discountCounter: 3.0937452626664474 + expiryDate: 2000-01-23T04:56:07.000+00:00 + importId: 7 + reservation: true + attributes: '{}' + id: 6 + value: value + discountLimit: 670401.2593930737 + startDate: 2000-01-23T04:56:07.000+00:00 + discountRemainder: 7.143538047012306 + - recipientIntegrationId: recipientIntegrationId + created: 2000-01-23T04:56:07.000+00:00 + campaignId: 6 + usageLimit: 594488 + referralId: 0 + usageCounter: 3 + batchId: batchId + discountCounter: 3.0937452626664474 + expiryDate: 2000-01-23T04:56:07.000+00:00 + importId: 7 + reservation: true + attributes: '{}' + id: 6 + value: value + discountLimit: 670401.2593930737 + startDate: 2000-01-23T04:56:07.000+00:00 + discountRemainder: 7.143538047012306 + totalResultSize: 0 + properties: + totalResultSize: + type: integer + data: + items: + $ref: '#/components/schemas/Coupon' + type: array + required: + - data + - totalResultSize inline_response_200_5: example: data: @@ -11505,30 +11655,36 @@ components: created: 2000-01-23T04:56:07.000+00:00 campaignId: 6 usageLimit: 594488 - referralId: 3 - usageCounter: 6 + referralId: 0 + usageCounter: 3 batchId: batchId + discountCounter: 3.0937452626664474 expiryDate: 2000-01-23T04:56:07.000+00:00 - importId: 3 + importId: 7 reservation: true attributes: '{}' id: 6 value: value + discountLimit: 670401.2593930737 startDate: 2000-01-23T04:56:07.000+00:00 + discountRemainder: 7.143538047012306 - recipientIntegrationId: recipientIntegrationId created: 2000-01-23T04:56:07.000+00:00 campaignId: 6 usageLimit: 594488 - referralId: 3 - usageCounter: 6 + referralId: 0 + usageCounter: 3 batchId: batchId + discountCounter: 3.0937452626664474 expiryDate: 2000-01-23T04:56:07.000+00:00 - importId: 3 + importId: 7 reservation: true attributes: '{}' id: 6 value: value + discountLimit: 670401.2593930737 startDate: 2000-01-23T04:56:07.000+00:00 + discountRemainder: 7.143538047012306 hasMore: true properties: hasMore: diff --git a/api_integration.go b/api_integration.go index 99cfa7bc..58d8f550 100644 --- a/api_integration.go +++ b/api_integration.go @@ -577,6 +577,7 @@ type apiGetCustomerInventoryRequest struct { integrationId string profile *bool referrals *bool + coupons *bool } func (r apiGetCustomerInventoryRequest) Profile(profile bool) apiGetCustomerInventoryRequest { @@ -589,9 +590,14 @@ func (r apiGetCustomerInventoryRequest) Referrals(referrals bool) apiGetCustomer return r } +func (r apiGetCustomerInventoryRequest) Coupons(coupons bool) apiGetCustomerInventoryRequest { + r.coupons = &coupons + return r +} + /* GetCustomerInventory Get an inventory of all data associated with a specific customer profile. -Get information regarding entities referencing this customer profile's integrationId. Currently we support customer profile information and referral codes. In the future, this will be expanded with coupon codes and loyalty points. +Get information regarding entities referencing this customer profile's integrationId. Currently we support customer profile information, referral codes and reserved coupons. In the future, this will be expanded with loyalty points. * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param integrationId The custom identifier for this profile, must be unique within the account. @return apiGetCustomerInventoryRequest @@ -636,6 +642,9 @@ func (r apiGetCustomerInventoryRequest) Execute() (CustomerInventory, *_nethttp. if r.referrals != nil { localVarQueryParams.Add("referrals", parameterToString(*r.referrals, "")) } + if r.coupons != nil { + localVarQueryParams.Add("coupons", parameterToString(*r.coupons, "")) + } // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -726,49 +735,49 @@ func (r apiGetCustomerInventoryRequest) Execute() (CustomerInventory, *_nethttp. return localVarReturnValue, localVarHTTPResponse, nil } -type apiGetReservedCouponsRequest struct { - ctx _context.Context - apiService *IntegrationApiService - integrationId string +type apiGetReservedCustomersRequest struct { + ctx _context.Context + apiService *IntegrationApiService + couponValue string } /* -GetReservedCoupons Get all valid reserved coupons -Returns all coupons this user is subscribed to that are valid and usable +GetReservedCustomers Get the users that have this coupon reserved +Returns all users that have this coupon marked as reserved * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param integrationId The custom identifier for this profile, must be unique within the account. -@return apiGetReservedCouponsRequest + * @param couponValue The value of a coupon +@return apiGetReservedCustomersRequest */ -func (a *IntegrationApiService) GetReservedCoupons(ctx _context.Context, integrationId string) apiGetReservedCouponsRequest { - return apiGetReservedCouponsRequest{ - apiService: a, - ctx: ctx, - integrationId: integrationId, +func (a *IntegrationApiService) GetReservedCustomers(ctx _context.Context, couponValue string) apiGetReservedCustomersRequest { + return apiGetReservedCustomersRequest{ + apiService: a, + ctx: ctx, + couponValue: couponValue, } } /* Execute executes the request - @return InlineResponse2001 + @return InlineResponse200 */ -func (r apiGetReservedCouponsRequest) Execute() (InlineResponse2001, *_nethttp.Response, error) { +func (r apiGetReservedCustomersRequest) Execute() (InlineResponse200, *_nethttp.Response, error) { var ( localVarHTTPMethod = _nethttp.MethodGet localVarPostBody interface{} localVarFormFileName string localVarFileName string localVarFileBytes []byte - localVarReturnValue InlineResponse2001 + localVarReturnValue InlineResponse200 ) - localBasePath, err := r.apiService.client.cfg.ServerURLWithContext(r.ctx, "IntegrationApiService.GetReservedCoupons") + localBasePath, err := r.apiService.client.cfg.ServerURLWithContext(r.ctx, "IntegrationApiService.GetReservedCustomers") if err != nil { return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/v1/coupon_reservations/coupons/{integrationId}" - localVarPath = strings.Replace(localVarPath, "{"+"integrationId"+"}", _neturl.QueryEscape(parameterToString(r.integrationId, "")), -1) + localVarPath := localBasePath + "/v1/coupon_reservations/customerprofiles/{couponValue}" + localVarPath = strings.Replace(localVarPath, "{"+"couponValue"+"}", _neturl.QueryEscape(parameterToString(r.couponValue, "")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -841,7 +850,7 @@ func (r apiGetReservedCouponsRequest) Execute() (InlineResponse2001, *_nethttp.R error: localVarHTTPResponse.Status, } if localVarHTTPResponse.StatusCode == 200 { - var v InlineResponse2001 + var v InlineResponse200 err = r.apiService.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() @@ -864,56 +873,77 @@ func (r apiGetReservedCouponsRequest) Execute() (InlineResponse2001, *_nethttp.R return localVarReturnValue, localVarHTTPResponse, nil } -type apiGetReservedCustomersRequest struct { - ctx _context.Context - apiService *IntegrationApiService - couponValue string +type apiTrackEventRequest struct { + ctx _context.Context + apiService *IntegrationApiService + body *NewEvent + dry *bool +} + +func (r apiTrackEventRequest) Body(body NewEvent) apiTrackEventRequest { + r.body = &body + return r +} + +func (r apiTrackEventRequest) Dry(dry bool) apiTrackEventRequest { + r.dry = &dry + return r } /* -GetReservedCustomers Get the users that have this coupon reserved -Returns all users that have this coupon marked as reserved +TrackEvent Track an Event +Records an arbitrary event in a customer session. For example, an integration might record an event when a user updates their payment information. + +The `sessionId` body parameter is required, an event is always part of a session. Much like updating a customer session, if either the profile or the session do not exist, a new empty one will be created. Note that if the specified session already exists, it must belong to the same `profileId` or an error will be returned. + +As with customer sessions, you can use an empty string for `profileId` to indicate that this is an anonymous session. + +Updating a customer profile will return a response with the full integration state. This includes the current state of the customer profile, the customer session, the event that was recorded, and an array of effects that took place. * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param couponValue The value of a coupon -@return apiGetReservedCustomersRequest +@return apiTrackEventRequest */ -func (a *IntegrationApiService) GetReservedCustomers(ctx _context.Context, couponValue string) apiGetReservedCustomersRequest { - return apiGetReservedCustomersRequest{ - apiService: a, - ctx: ctx, - couponValue: couponValue, +func (a *IntegrationApiService) TrackEvent(ctx _context.Context) apiTrackEventRequest { + return apiTrackEventRequest{ + apiService: a, + ctx: ctx, } } /* Execute executes the request - @return InlineResponse200 + @return IntegrationState */ -func (r apiGetReservedCustomersRequest) Execute() (InlineResponse200, *_nethttp.Response, error) { +func (r apiTrackEventRequest) Execute() (IntegrationState, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = _nethttp.MethodPost localVarPostBody interface{} localVarFormFileName string localVarFileName string localVarFileBytes []byte - localVarReturnValue InlineResponse200 + localVarReturnValue IntegrationState ) - localBasePath, err := r.apiService.client.cfg.ServerURLWithContext(r.ctx, "IntegrationApiService.GetReservedCustomers") + localBasePath, err := r.apiService.client.cfg.ServerURLWithContext(r.ctx, "IntegrationApiService.TrackEvent") if err != nil { return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/v1/coupon_reservations/customerprofiles/{couponValue}" - localVarPath = strings.Replace(localVarPath, "{"+"couponValue"+"}", _neturl.QueryEscape(parameterToString(r.couponValue, "")), -1) + localVarPath := localBasePath + "/v1/events" localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} + if r.body == nil { + return localVarReturnValue, nil, reportError("body is required and must be specified") + } + + if r.dry != nil { + localVarQueryParams.Add("dry", parameterToString(*r.dry, "")) + } // to determine the Content-Type header - localVarHTTPContentTypes := []string{} + localVarHTTPContentTypes := []string{"application/json"} // set Content-Type header localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) @@ -929,6 +959,8 @@ func (r apiGetReservedCustomersRequest) Execute() (InlineResponse200, *_nethttp. if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } + // body params + localVarPostBody = r.body if r.ctx != nil { // API Key Authentication if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { @@ -978,8 +1010,8 @@ func (r apiGetReservedCustomersRequest) Execute() (InlineResponse200, *_nethttp. body: localVarBody, error: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 200 { - var v InlineResponse200 + if localVarHTTPResponse.StatusCode == 201 { + var v IntegrationState err = r.apiService.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() @@ -1002,34 +1034,44 @@ func (r apiGetReservedCustomersRequest) Execute() (InlineResponse200, *_nethttp. return localVarReturnValue, localVarHTTPResponse, nil } -type apiTrackEventRequest struct { - ctx _context.Context - apiService *IntegrationApiService - body *NewEvent +type apiUpdateCustomerProfileRequest struct { + ctx _context.Context + apiService *IntegrationApiService + integrationId string + body *NewCustomerProfile + dry *bool } -func (r apiTrackEventRequest) Body(body NewEvent) apiTrackEventRequest { +func (r apiUpdateCustomerProfileRequest) Body(body NewCustomerProfile) apiUpdateCustomerProfileRequest { r.body = &body return r } -/* -TrackEvent Track an Event -Records an arbitrary event in a customer session. For example, an integration might record an event when a user updates their payment information. +func (r apiUpdateCustomerProfileRequest) Dry(dry bool) apiUpdateCustomerProfileRequest { + r.dry = &dry + return r +} -The `sessionId` body parameter is required, an event is always part of a session. Much like updating a customer session, if either the profile or the session do not exist, a new empty one will be created. Note that if the specified session already exists, it must belong to the same `profileId` or an error will be returned. +/* +UpdateCustomerProfile Update a Customer Profile +Update (or create) a [Customer Profile][]. This profile information can then be matched and/or updated by campaign [Rules][]. -As with customer sessions, you can use an empty string for `profileId` to indicate that this is an anonymous session. +The `integrationId` may be any identifier that will remain stable for the customer. For example, you might use a database ID, an email, or a phone number as the `integrationId`. It is vital that this ID **not** change over time, so **don't** use any identifier that the customer can update themselves. E.g. if your application allows a customer to update their e-mail address, you should instead use a database ID. Updating a customer profile will return a response with the full integration state. This includes the current state of the customer profile, the customer session, the event that was recorded, and an array of effects that took place. +[Customer Profile]: /Getting-Started/entities#customer-profile +[Rules]: /Getting-Started/entities#campaigns-rulesets-and-coupons + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). -@return apiTrackEventRequest + * @param integrationId The custom identifier for this profile, must be unique within the account. +@return apiUpdateCustomerProfileRequest */ -func (a *IntegrationApiService) TrackEvent(ctx _context.Context) apiTrackEventRequest { - return apiTrackEventRequest{ - apiService: a, - ctx: ctx, +func (a *IntegrationApiService) UpdateCustomerProfile(ctx _context.Context, integrationId string) apiUpdateCustomerProfileRequest { + return apiUpdateCustomerProfileRequest{ + apiService: a, + ctx: ctx, + integrationId: integrationId, } } @@ -1037,9 +1079,9 @@ func (a *IntegrationApiService) TrackEvent(ctx _context.Context) apiTrackEventRe Execute executes the request @return IntegrationState */ -func (r apiTrackEventRequest) Execute() (IntegrationState, *_nethttp.Response, error) { +func (r apiUpdateCustomerProfileRequest) Execute() (IntegrationState, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost + localVarHTTPMethod = _nethttp.MethodPut localVarPostBody interface{} localVarFormFileName string localVarFileName string @@ -1047,12 +1089,13 @@ func (r apiTrackEventRequest) Execute() (IntegrationState, *_nethttp.Response, e localVarReturnValue IntegrationState ) - localBasePath, err := r.apiService.client.cfg.ServerURLWithContext(r.ctx, "IntegrationApiService.TrackEvent") + localBasePath, err := r.apiService.client.cfg.ServerURLWithContext(r.ctx, "IntegrationApiService.UpdateCustomerProfile") if err != nil { return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/v1/events" + localVarPath := localBasePath + "/v1/customer_profiles/{integrationId}" + localVarPath = strings.Replace(localVarPath, "{"+"integrationId"+"}", _neturl.QueryEscape(parameterToString(r.integrationId, "")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -1062,6 +1105,9 @@ func (r apiTrackEventRequest) Execute() (IntegrationState, *_nethttp.Response, e return localVarReturnValue, nil, reportError("body is required and must be specified") } + if r.dry != nil { + localVarQueryParams.Add("dry", parameterToString(*r.dry, "")) + } // to determine the Content-Type header localVarHTTPContentTypes := []string{"application/json"} @@ -1130,7 +1176,7 @@ func (r apiTrackEventRequest) Execute() (IntegrationState, *_nethttp.Response, e body: localVarBody, error: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 201 { + if localVarHTTPResponse.StatusCode == 200 { var v IntegrationState err = r.apiService.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -1154,62 +1200,59 @@ func (r apiTrackEventRequest) Execute() (IntegrationState, *_nethttp.Response, e return localVarReturnValue, localVarHTTPResponse, nil } -type apiUpdateCustomerProfileRequest struct { - ctx _context.Context - apiService *IntegrationApiService - integrationId string - body *NewCustomerProfile +type apiUpdateCustomerProfileV2Request struct { + ctx _context.Context + apiService *IntegrationApiService + customerProfileId string + body *NewCustomerProfile } -func (r apiUpdateCustomerProfileRequest) Body(body NewCustomerProfile) apiUpdateCustomerProfileRequest { +func (r apiUpdateCustomerProfileV2Request) Body(body NewCustomerProfile) apiUpdateCustomerProfileV2Request { r.body = &body return r } /* -UpdateCustomerProfile Update a Customer Profile -Update (or create) a [Customer Profile][]. This profile information can then be matched and/or updated by campaign [Rules][]. +UpdateCustomerProfileV2 Update a Customer Profile +Update (or create) a [Customer Profile][]. The `integrationId` may be any identifier that will remain stable for the customer. For example, you might use a database ID, an email, or a phone number as the `integrationId`. It is vital that this ID **not** change over time, so **don't** use any identifier that the customer can update themselves. E.g. if your application allows a customer to update their e-mail address, you should instead use a database ID. -Updating a customer profile will return a response with the full integration state. This includes the current state of the customer profile, the customer session, the event that was recorded, and an array of effects that took place. - [Customer Profile]: /Getting-Started/entities#customer-profile -[Rules]: /Getting-Started/entities#campaigns-rulesets-and-coupons * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param integrationId The custom identifier for this profile, must be unique within the account. -@return apiUpdateCustomerProfileRequest + * @param customerProfileId The custom identifier for this profile, must be unique within the account. +@return apiUpdateCustomerProfileV2Request */ -func (a *IntegrationApiService) UpdateCustomerProfile(ctx _context.Context, integrationId string) apiUpdateCustomerProfileRequest { - return apiUpdateCustomerProfileRequest{ - apiService: a, - ctx: ctx, - integrationId: integrationId, +func (a *IntegrationApiService) UpdateCustomerProfileV2(ctx _context.Context, customerProfileId string) apiUpdateCustomerProfileV2Request { + return apiUpdateCustomerProfileV2Request{ + apiService: a, + ctx: ctx, + customerProfileId: customerProfileId, } } /* Execute executes the request - @return IntegrationState + @return CustomerProfileUpdate */ -func (r apiUpdateCustomerProfileRequest) Execute() (IntegrationState, *_nethttp.Response, error) { +func (r apiUpdateCustomerProfileV2Request) Execute() (CustomerProfileUpdate, *_nethttp.Response, error) { var ( localVarHTTPMethod = _nethttp.MethodPut localVarPostBody interface{} localVarFormFileName string localVarFileName string localVarFileBytes []byte - localVarReturnValue IntegrationState + localVarReturnValue CustomerProfileUpdate ) - localBasePath, err := r.apiService.client.cfg.ServerURLWithContext(r.ctx, "IntegrationApiService.UpdateCustomerProfile") + localBasePath, err := r.apiService.client.cfg.ServerURLWithContext(r.ctx, "IntegrationApiService.UpdateCustomerProfileV2") if err != nil { return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/v1/customer_profiles/{integrationId}" - localVarPath = strings.Replace(localVarPath, "{"+"integrationId"+"}", _neturl.QueryEscape(parameterToString(r.integrationId, "")), -1) + localVarPath := localBasePath + "/v2/customer_profiles/{customerProfileId}" + localVarPath = strings.Replace(localVarPath, "{"+"customerProfileId"+"}", _neturl.QueryEscape(parameterToString(r.customerProfileId, "")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -1252,20 +1295,6 @@ func (r apiUpdateCustomerProfileRequest) Execute() (IntegrationState, *_nethttp. } } } - if r.ctx != nil { - // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { - if auth, ok := auth["Content-Signature"]; ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["Content-Signature"] = key - } - } - } req, err := r.apiService.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return localVarReturnValue, nil, err @@ -1288,7 +1317,7 @@ func (r apiUpdateCustomerProfileRequest) Execute() (IntegrationState, *_nethttp. error: localVarHTTPResponse.Status, } if localVarHTTPResponse.StatusCode == 200 { - var v IntegrationState + var v CustomerProfileUpdate err = r.apiService.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() @@ -1316,6 +1345,7 @@ type apiUpdateCustomerSessionRequest struct { apiService *IntegrationApiService customerSessionId string body *NewCustomerSession + dry *bool } func (r apiUpdateCustomerSessionRequest) Body(body NewCustomerSession) apiUpdateCustomerSessionRequest { @@ -1323,6 +1353,11 @@ func (r apiUpdateCustomerSessionRequest) Body(body NewCustomerSession) apiUpdate return r } +func (r apiUpdateCustomerSessionRequest) Dry(dry bool) apiUpdateCustomerSessionRequest { + r.dry = &dry + return r +} + /* UpdateCustomerSession Update a Customer Session Update (or create) a [Customer Session][]. For example, the items in a customers cart are part of a session. @@ -1379,6 +1414,9 @@ func (r apiUpdateCustomerSessionRequest) Execute() (IntegrationState, *_nethttp. return localVarReturnValue, nil, reportError("body is required and must be specified") } + if r.dry != nil { + localVarQueryParams.Add("dry", parameterToString(*r.dry, "")) + } // to determine the Content-Type header localVarHTTPContentTypes := []string{"application/json"} @@ -1476,6 +1514,7 @@ type apiUpdateCustomerSessionV2Request struct { apiService *IntegrationApiService customerSessionId string body *IntegrationRequest + dry *bool } func (r apiUpdateCustomerSessionV2Request) Body(body IntegrationRequest) apiUpdateCustomerSessionV2Request { @@ -1483,6 +1522,11 @@ func (r apiUpdateCustomerSessionV2Request) Body(body IntegrationRequest) apiUpda return r } +func (r apiUpdateCustomerSessionV2Request) Dry(dry bool) apiUpdateCustomerSessionV2Request { + r.dry = &dry + return r +} + /* UpdateCustomerSessionV2 Update a Customer Session Update (or create) a [Customer Session][]. For example, the items in a customers cart are part of a session. @@ -1539,6 +1583,9 @@ func (r apiUpdateCustomerSessionV2Request) Execute() (IntegrationStateV2, *_neth return localVarReturnValue, nil, reportError("body is required and must be specified") } + if r.dry != nil { + localVarQueryParams.Add("dry", parameterToString(*r.dry, "")) + } // to determine the Content-Type header localVarHTTPContentTypes := []string{"application/json"} diff --git a/api_management.go b/api_management.go index 88f51be4..2bb51e21 100644 --- a/api_management.go +++ b/api_management.go @@ -177,16 +177,16 @@ func (a *ManagementApiService) CopyCampaignToApplications(ctx _context.Context, /* Execute executes the request - @return InlineResponse2003 + @return InlineResponse2002 */ -func (r apiCopyCampaignToApplicationsRequest) Execute() (InlineResponse2003, *_nethttp.Response, error) { +func (r apiCopyCampaignToApplicationsRequest) Execute() (InlineResponse2002, *_nethttp.Response, error) { var ( localVarHTTPMethod = _nethttp.MethodPost localVarPostBody interface{} localVarFormFileName string localVarFileName string localVarFileBytes []byte - localVarReturnValue InlineResponse2003 + localVarReturnValue InlineResponse2002 ) localBasePath, err := r.apiService.client.cfg.ServerURLWithContext(r.ctx, "ManagementApiService.CopyCampaignToApplications") @@ -261,7 +261,7 @@ func (r apiCopyCampaignToApplicationsRequest) Execute() (InlineResponse2003, *_n error: localVarHTTPResponse.Status, } if localVarHTTPResponse.StatusCode == 200 { - var v InlineResponse2003 + var v InlineResponse2002 err = r.apiService.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() @@ -724,16 +724,16 @@ func (a *ManagementApiService) CreateCoupons(ctx _context.Context, applicationId /* Execute executes the request - @return InlineResponse2001 + @return InlineResponse2004 */ -func (r apiCreateCouponsRequest) Execute() (InlineResponse2001, *_nethttp.Response, error) { +func (r apiCreateCouponsRequest) Execute() (InlineResponse2004, *_nethttp.Response, error) { var ( localVarHTTPMethod = _nethttp.MethodPost localVarPostBody interface{} localVarFormFileName string localVarFileName string localVarFileBytes []byte - localVarReturnValue InlineResponse2001 + localVarReturnValue InlineResponse2004 ) localBasePath, err := r.apiService.client.cfg.ServerURLWithContext(r.ctx, "ManagementApiService.CreateCoupons") @@ -811,7 +811,7 @@ func (r apiCreateCouponsRequest) Execute() (InlineResponse2001, *_nethttp.Respon error: localVarHTTPResponse.Status, } if localVarHTTPResponse.StatusCode == 200 { - var v InlineResponse2001 + var v InlineResponse2004 err = r.apiService.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() @@ -4777,16 +4777,16 @@ func (a *ManagementApiService) GetApplications(ctx _context.Context) apiGetAppli /* Execute executes the request - @return InlineResponse2002 + @return InlineResponse2001 */ -func (r apiGetApplicationsRequest) Execute() (InlineResponse2002, *_nethttp.Response, error) { +func (r apiGetApplicationsRequest) Execute() (InlineResponse2001, *_nethttp.Response, error) { var ( localVarHTTPMethod = _nethttp.MethodGet localVarPostBody interface{} localVarFormFileName string localVarFileName string localVarFileBytes []byte - localVarReturnValue InlineResponse2002 + localVarReturnValue InlineResponse2001 ) localBasePath, err := r.apiService.client.cfg.ServerURLWithContext(r.ctx, "ManagementApiService.GetApplications") @@ -4862,7 +4862,7 @@ func (r apiGetApplicationsRequest) Execute() (InlineResponse2002, *_nethttp.Resp error: localVarHTTPResponse.Status, } if localVarHTTPResponse.StatusCode == 200 { - var v InlineResponse2002 + var v InlineResponse2001 err = r.apiService.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() @@ -5493,16 +5493,16 @@ func (a *ManagementApiService) GetCampaignByAttributes(ctx _context.Context, app /* Execute executes the request - @return InlineResponse2003 + @return InlineResponse2002 */ -func (r apiGetCampaignByAttributesRequest) Execute() (InlineResponse2003, *_nethttp.Response, error) { +func (r apiGetCampaignByAttributesRequest) Execute() (InlineResponse2002, *_nethttp.Response, error) { var ( localVarHTTPMethod = _nethttp.MethodPost localVarPostBody interface{} localVarFormFileName string localVarFileName string localVarFileBytes []byte - localVarReturnValue InlineResponse2003 + localVarReturnValue InlineResponse2002 ) localBasePath, err := r.apiService.client.cfg.ServerURLWithContext(r.ctx, "ManagementApiService.GetCampaignByAttributes") @@ -5588,129 +5588,7 @@ func (r apiGetCampaignByAttributesRequest) Execute() (InlineResponse2003, *_neth error: localVarHTTPResponse.Status, } if localVarHTTPResponse.StatusCode == 200 { - var v InlineResponse2003 - err = r.apiService.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.model = v - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = r.apiService.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} - -type apiGetCampaignSetRequest struct { - ctx _context.Context - apiService *ManagementApiService - applicationId int32 -} - -/* -GetCampaignSet List CampaignSet - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param applicationId -@return apiGetCampaignSetRequest -*/ -func (a *ManagementApiService) GetCampaignSet(ctx _context.Context, applicationId int32) apiGetCampaignSetRequest { - return apiGetCampaignSetRequest{ - apiService: a, - ctx: ctx, - applicationId: applicationId, - } -} - -/* -Execute executes the request - @return CampaignSet -*/ -func (r apiGetCampaignSetRequest) Execute() (CampaignSet, *_nethttp.Response, error) { - var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue CampaignSet - ) - - localBasePath, err := r.apiService.client.cfg.ServerURLWithContext(r.ctx, "ManagementApiService.GetCampaignSet") - if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/v1/applications/{applicationId}/campaign_set" - localVarPath = strings.Replace(localVarPath, "{"+"applicationId"+"}", _neturl.QueryEscape(parameterToString(r.applicationId, "")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} - - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - if r.ctx != nil { - // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { - if auth, ok := auth["Authorization"]; ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["Authorization"] = key - } - } - } - req, err := r.apiService.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := r.apiService.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 200 { - var v CampaignSet + var v InlineResponse2002 err = r.apiService.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() @@ -5803,16 +5681,16 @@ func (a *ManagementApiService) GetCampaigns(ctx _context.Context, applicationId /* Execute executes the request - @return InlineResponse2003 + @return InlineResponse2002 */ -func (r apiGetCampaignsRequest) Execute() (InlineResponse2003, *_nethttp.Response, error) { +func (r apiGetCampaignsRequest) Execute() (InlineResponse2002, *_nethttp.Response, error) { var ( localVarHTTPMethod = _nethttp.MethodGet localVarPostBody interface{} localVarFormFileName string localVarFileName string localVarFileBytes []byte - localVarReturnValue InlineResponse2003 + localVarReturnValue InlineResponse2002 ) localBasePath, err := r.apiService.client.cfg.ServerURLWithContext(r.ctx, "ManagementApiService.GetCampaigns") @@ -5904,7 +5782,7 @@ func (r apiGetCampaignsRequest) Execute() (InlineResponse2003, *_nethttp.Respons error: localVarHTTPResponse.Status, } if localVarHTTPResponse.StatusCode == 200 { - var v InlineResponse2003 + var v InlineResponse2002 err = r.apiService.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() @@ -6239,16 +6117,16 @@ func (a *ManagementApiService) GetCoupons(ctx _context.Context, applicationId in /* Execute executes the request - @return InlineResponse2001 + @return InlineResponse2004 */ -func (r apiGetCouponsRequest) Execute() (InlineResponse2001, *_nethttp.Response, error) { +func (r apiGetCouponsRequest) Execute() (InlineResponse2004, *_nethttp.Response, error) { var ( localVarHTTPMethod = _nethttp.MethodGet localVarPostBody interface{} localVarFormFileName string localVarFileName string localVarFileBytes []byte - localVarReturnValue InlineResponse2001 + localVarReturnValue InlineResponse2004 ) localBasePath, err := r.apiService.client.cfg.ServerURLWithContext(r.ctx, "ManagementApiService.GetCoupons") @@ -6365,7 +6243,7 @@ func (r apiGetCouponsRequest) Execute() (InlineResponse2001, *_nethttp.Response, error: localVarHTTPResponse.Status, } if localVarHTTPResponse.StatusCode == 200 { - var v InlineResponse2001 + var v InlineResponse2004 err = r.apiService.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() @@ -6495,16 +6373,16 @@ func (a *ManagementApiService) GetCouponsByAttributes(ctx _context.Context, appl /* Execute executes the request - @return InlineResponse2001 + @return InlineResponse2004 */ -func (r apiGetCouponsByAttributesRequest) Execute() (InlineResponse2001, *_nethttp.Response, error) { +func (r apiGetCouponsByAttributesRequest) Execute() (InlineResponse2004, *_nethttp.Response, error) { var ( localVarHTTPMethod = _nethttp.MethodPost localVarPostBody interface{} localVarFormFileName string localVarFileName string localVarFileBytes []byte - localVarReturnValue InlineResponse2001 + localVarReturnValue InlineResponse2004 ) localBasePath, err := r.apiService.client.cfg.ServerURLWithContext(r.ctx, "ManagementApiService.GetCouponsByAttributes") @@ -6615,7 +6493,7 @@ func (r apiGetCouponsByAttributesRequest) Execute() (InlineResponse2001, *_netht error: localVarHTTPResponse.Status, } if localVarHTTPResponse.StatusCode == 200 { - var v InlineResponse2001 + var v InlineResponse2004 err = r.apiService.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() @@ -6746,16 +6624,16 @@ func (a *ManagementApiService) GetCouponsByAttributesApplicationWide(ctx _contex /* Execute executes the request - @return InlineResponse2001 + @return InlineResponse2004 */ -func (r apiGetCouponsByAttributesApplicationWideRequest) Execute() (InlineResponse2001, *_nethttp.Response, error) { +func (r apiGetCouponsByAttributesApplicationWideRequest) Execute() (InlineResponse2004, *_nethttp.Response, error) { var ( localVarHTTPMethod = _nethttp.MethodPost localVarPostBody interface{} localVarFormFileName string localVarFileName string localVarFileBytes []byte - localVarReturnValue InlineResponse2001 + localVarReturnValue InlineResponse2004 ) localBasePath, err := r.apiService.client.cfg.ServerURLWithContext(r.ctx, "ManagementApiService.GetCouponsByAttributesApplicationWide") @@ -6868,7 +6746,7 @@ func (r apiGetCouponsByAttributesApplicationWideRequest) Execute() (InlineRespon error: localVarHTTPResponse.Status, } if localVarHTTPResponse.StatusCode == 200 { - var v InlineResponse2001 + var v InlineResponse2004 err = r.apiService.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() @@ -9831,16 +9709,16 @@ func (a *ManagementApiService) GetRulesets(ctx _context.Context, applicationId i /* Execute executes the request - @return InlineResponse2004 + @return InlineResponse2003 */ -func (r apiGetRulesetsRequest) Execute() (InlineResponse2004, *_nethttp.Response, error) { +func (r apiGetRulesetsRequest) Execute() (InlineResponse2003, *_nethttp.Response, error) { var ( localVarHTTPMethod = _nethttp.MethodGet localVarPostBody interface{} localVarFormFileName string localVarFileName string localVarFileBytes []byte - localVarReturnValue InlineResponse2004 + localVarReturnValue InlineResponse2003 ) localBasePath, err := r.apiService.client.cfg.ServerURLWithContext(r.ctx, "ManagementApiService.GetRulesets") @@ -9918,7 +9796,7 @@ func (r apiGetRulesetsRequest) Execute() (InlineResponse2004, *_nethttp.Response error: localVarHTTPResponse.Status, } if localVarHTTPResponse.StatusCode == 200 { - var v InlineResponse2004 + var v InlineResponse2003 err = r.apiService.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() @@ -11254,16 +11132,16 @@ func (a *ManagementApiService) SearchCouponsAdvanced(ctx _context.Context, appli /* Execute executes the request - @return InlineResponse2001 + @return InlineResponse2004 */ -func (r apiSearchCouponsAdvancedRequest) Execute() (InlineResponse2001, *_nethttp.Response, error) { +func (r apiSearchCouponsAdvancedRequest) Execute() (InlineResponse2004, *_nethttp.Response, error) { var ( localVarHTTPMethod = _nethttp.MethodPost localVarPostBody interface{} localVarFormFileName string localVarFileName string localVarFileBytes []byte - localVarReturnValue InlineResponse2001 + localVarReturnValue InlineResponse2004 ) localBasePath, err := r.apiService.client.cfg.ServerURLWithContext(r.ctx, "ManagementApiService.SearchCouponsAdvanced") @@ -11374,7 +11252,7 @@ func (r apiSearchCouponsAdvancedRequest) Execute() (InlineResponse2001, *_nethtt error: localVarHTTPResponse.Status, } if localVarHTTPResponse.StatusCode == 200 { - var v InlineResponse2001 + var v InlineResponse2004 err = r.apiService.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() @@ -11505,16 +11383,16 @@ func (a *ManagementApiService) SearchCouponsAdvancedApplicationWide(ctx _context /* Execute executes the request - @return InlineResponse2001 + @return InlineResponse2004 */ -func (r apiSearchCouponsAdvancedApplicationWideRequest) Execute() (InlineResponse2001, *_nethttp.Response, error) { +func (r apiSearchCouponsAdvancedApplicationWideRequest) Execute() (InlineResponse2004, *_nethttp.Response, error) { var ( localVarHTTPMethod = _nethttp.MethodPost localVarPostBody interface{} localVarFormFileName string localVarFileName string localVarFileBytes []byte - localVarReturnValue InlineResponse2001 + localVarReturnValue InlineResponse2004 ) localBasePath, err := r.apiService.client.cfg.ServerURLWithContext(r.ctx, "ManagementApiService.SearchCouponsAdvancedApplicationWide") @@ -11627,7 +11505,7 @@ func (r apiSearchCouponsAdvancedApplicationWideRequest) Execute() (InlineRespons error: localVarHTTPResponse.Status, } if localVarHTTPResponse.StatusCode == 200 { - var v InlineResponse2001 + var v InlineResponse2004 err = r.apiService.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() @@ -12563,140 +12441,6 @@ func (r apiUpdateCampaignRequest) Execute() (Campaign, *_nethttp.Response, error return localVarReturnValue, localVarHTTPResponse, nil } -type apiUpdateCampaignSetRequest struct { - ctx _context.Context - apiService *ManagementApiService - applicationId int32 - body *NewCampaignSet -} - -func (r apiUpdateCampaignSetRequest) Body(body NewCampaignSet) apiUpdateCampaignSetRequest { - r.body = &body - return r -} - -/* -UpdateCampaignSet Update a Campaign Set - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param applicationId -@return apiUpdateCampaignSetRequest -*/ -func (a *ManagementApiService) UpdateCampaignSet(ctx _context.Context, applicationId int32) apiUpdateCampaignSetRequest { - return apiUpdateCampaignSetRequest{ - apiService: a, - ctx: ctx, - applicationId: applicationId, - } -} - -/* -Execute executes the request - @return CampaignSet -*/ -func (r apiUpdateCampaignSetRequest) Execute() (CampaignSet, *_nethttp.Response, error) { - var ( - localVarHTTPMethod = _nethttp.MethodPut - localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue CampaignSet - ) - - localBasePath, err := r.apiService.client.cfg.ServerURLWithContext(r.ctx, "ManagementApiService.UpdateCampaignSet") - if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/v1/applications/{applicationId}/campaign_set" - localVarPath = strings.Replace(localVarPath, "{"+"applicationId"+"}", _neturl.QueryEscape(parameterToString(r.applicationId, "")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} - - if r.body == nil { - return localVarReturnValue, nil, reportError("body is required and must be specified") - } - - // to determine the Content-Type header - localVarHTTPContentTypes := []string{"application/json"} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - // body params - localVarPostBody = r.body - if r.ctx != nil { - // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { - if auth, ok := auth["Authorization"]; ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["Authorization"] = key - } - } - } - req, err := r.apiService.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := r.apiService.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 200 { - var v CampaignSet - err = r.apiService.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.model = v - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = r.apiService.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} - type apiUpdateCouponRequest struct { ctx _context.Context apiService *ManagementApiService diff --git a/configuration.go b/configuration.go index 3c7209ff..b89bad86 100644 --- a/configuration.go +++ b/configuration.go @@ -97,7 +97,7 @@ type Configuration struct { func NewConfiguration() *Configuration { cfg := &Configuration{ DefaultHeader: make(map[string]string), - UserAgent: "OpenAPI-Generator/2.0.0/go", + UserAgent: "OpenAPI-Generator/2.1.0/go", Debug: false, Servers: ServerConfigurations{ { diff --git a/docs/Application.md b/docs/Application.md index 265b67bc..eb3bb0ef 100644 --- a/docs/Application.md +++ b/docs/Application.md @@ -15,6 +15,7 @@ Name | Type | Description | Notes **CaseSensitivity** | Pointer to **string** | A string indicating how should campaigns in this application deal with case sensitivity on coupon codes. | [optional] **Attributes** | Pointer to [**map[string]interface{}**](.md) | Arbitrary properties associated with this campaign | [optional] **Limits** | Pointer to [**[]LimitConfig**](LimitConfig.md) | Default limits for campaigns created in this application | [optional] +**CampaignPriority** | Pointer to **string** | Default priority for campaigns created in this application, can be one of (universal, stackable, exclusive) | [optional] **AttributesSettings** | Pointer to [**AttributesSettings**](AttributesSettings.md) | | [optional] **LoyaltyPrograms** | Pointer to [**[]LoyaltyProgram**](LoyaltyProgram.md) | An array containing all the loyalty programs to which this application is subscribed | @@ -295,6 +296,31 @@ HasLimits returns a boolean if a field has been set. SetLimits gets a reference to the given []LimitConfig and assigns it to the Limits field. +### GetCampaignPriority + +`func (o *Application) GetCampaignPriority() string` + +GetCampaignPriority returns the CampaignPriority field if non-nil, zero value otherwise. + +### GetCampaignPriorityOk + +`func (o *Application) GetCampaignPriorityOk() (string, bool)` + +GetCampaignPriorityOk returns a tuple with the CampaignPriority field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasCampaignPriority + +`func (o *Application) HasCampaignPriority() bool` + +HasCampaignPriority returns a boolean if a field has been set. + +### SetCampaignPriority + +`func (o *Application) SetCampaignPriority(v string)` + +SetCampaignPriority gets a reference to the given string and assigns it to the CampaignPriority field. + ### GetAttributesSettings `func (o *Application) GetAttributesSettings() AttributesSettings` diff --git a/docs/ApplicationSession.md b/docs/ApplicationSession.md index 488fb98c..739786e1 100644 --- a/docs/ApplicationSession.md +++ b/docs/ApplicationSession.md @@ -15,7 +15,7 @@ Name | Type | Description | Notes **State** | Pointer to **string** | Indicating if the customer session is in progress (\"open\"), \"closed\", or \"cancelled\". | **CartItems** | Pointer to [**[]CartItem**](CartItem.md) | Serialized JSON representation. | **Discounts** | Pointer to **map[string]float32** | A map of labelled discount values, in the same currency as the session. | -**Total** | Pointer to **float32** | The total sum of the session before any discounts applied. | [optional] +**Total** | Pointer to **float32** | The total sum of the session before any discounts applied. | **Attributes** | Pointer to [**map[string]interface{}**](.md) | Arbitrary properties associated with this item | [optional] ## Methods diff --git a/docs/CampaignSet.md b/docs/CampaignSet.md index b2a3643a..f3ec87bd 100644 --- a/docs/CampaignSet.md +++ b/docs/CampaignSet.md @@ -7,6 +7,7 @@ Name | Type | Description | Notes **Id** | Pointer to **int32** | Unique ID for this entity. | **Created** | Pointer to [**time.Time**](time.Time.md) | The exact moment this entity was created. | **ApplicationId** | Pointer to **int32** | The ID of the application that owns this entity. | +**Version** | Pointer to **int32** | Version of the campaign set | **Set** | Pointer to [**CampaignSetBranchNode**](CampaignSetBranchNode.md) | | ## Methods @@ -86,6 +87,31 @@ HasApplicationId returns a boolean if a field has been set. SetApplicationId gets a reference to the given int32 and assigns it to the ApplicationId field. +### GetVersion + +`func (o *CampaignSet) GetVersion() int32` + +GetVersion returns the Version field if non-nil, zero value otherwise. + +### GetVersionOk + +`func (o *CampaignSet) GetVersionOk() (int32, bool)` + +GetVersionOk returns a tuple with the Version field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasVersion + +`func (o *CampaignSet) HasVersion() bool` + +HasVersion returns a boolean if a field has been set. + +### SetVersion + +`func (o *CampaignSet) SetVersion(v int32)` + +SetVersion gets a reference to the given int32 and assigns it to the Version field. + ### GetSet `func (o *CampaignSet) GetSet() CampaignSetBranchNode` diff --git a/docs/Coupon.md b/docs/Coupon.md index c19b3e4a..9e3409d2 100644 --- a/docs/Coupon.md +++ b/docs/Coupon.md @@ -9,12 +9,15 @@ Name | Type | Description | Notes **CampaignId** | Pointer to **int32** | The ID of the campaign that owns this entity. | **Value** | Pointer to **string** | The actual coupon code. | **UsageLimit** | Pointer to **int32** | The number of times a coupon code can be redeemed. This can be set to 0 for no limit, but any campaign usage limits will still apply. | +**DiscountLimit** | Pointer to **float32** | The amount of discounts that can be given with this coupon code. | [optional] **StartDate** | Pointer to [**time.Time**](time.Time.md) | Timestamp at which point the coupon becomes valid. | [optional] **ExpiryDate** | Pointer to [**time.Time**](time.Time.md) | Expiry date of the coupon. Coupon never expires if this is omitted, zero, or negative. | [optional] **UsageCounter** | Pointer to **int32** | The number of times this coupon has been successfully used. | +**DiscountCounter** | Pointer to **float32** | The amount of discounts given on rules redeeming this coupon. Only usable if a coupon discount budget was set for this coupon. | [optional] +**DiscountRemainder** | Pointer to **float32** | The remaining discount this coupon can give. | [optional] **Attributes** | Pointer to [**map[string]interface{}**](.md) | Arbitrary properties associated with this item | [optional] **ReferralId** | Pointer to **int32** | The integration ID of the referring customer (if any) for whom this coupon was created as an effect. | [optional] -**RecipientIntegrationId** | Pointer to **string** | The integration ID of a referred customer profile. | [optional] +**RecipientIntegrationId** | Pointer to **string** | The Integration ID of the customer that is allowed to redeem this coupon. | [optional] **ImportId** | Pointer to **int32** | The ID of the Import which created this coupon. | [optional] **Reservation** | Pointer to **bool** | This value controls what reservations mean to a coupon. If set to true the coupon reservation is used to mark it as a favourite, if set to false the coupon reservation is used as a requirement of usage. This value defaults to true if not specified. | [optional] **BatchId** | Pointer to **string** | The id of the batch the coupon belongs to. | [optional] @@ -146,6 +149,31 @@ HasUsageLimit returns a boolean if a field has been set. SetUsageLimit gets a reference to the given int32 and assigns it to the UsageLimit field. +### GetDiscountLimit + +`func (o *Coupon) GetDiscountLimit() float32` + +GetDiscountLimit returns the DiscountLimit field if non-nil, zero value otherwise. + +### GetDiscountLimitOk + +`func (o *Coupon) GetDiscountLimitOk() (float32, bool)` + +GetDiscountLimitOk returns a tuple with the DiscountLimit field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasDiscountLimit + +`func (o *Coupon) HasDiscountLimit() bool` + +HasDiscountLimit returns a boolean if a field has been set. + +### SetDiscountLimit + +`func (o *Coupon) SetDiscountLimit(v float32)` + +SetDiscountLimit gets a reference to the given float32 and assigns it to the DiscountLimit field. + ### GetStartDate `func (o *Coupon) GetStartDate() time.Time` @@ -221,6 +249,56 @@ HasUsageCounter returns a boolean if a field has been set. SetUsageCounter gets a reference to the given int32 and assigns it to the UsageCounter field. +### GetDiscountCounter + +`func (o *Coupon) GetDiscountCounter() float32` + +GetDiscountCounter returns the DiscountCounter field if non-nil, zero value otherwise. + +### GetDiscountCounterOk + +`func (o *Coupon) GetDiscountCounterOk() (float32, bool)` + +GetDiscountCounterOk returns a tuple with the DiscountCounter field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasDiscountCounter + +`func (o *Coupon) HasDiscountCounter() bool` + +HasDiscountCounter returns a boolean if a field has been set. + +### SetDiscountCounter + +`func (o *Coupon) SetDiscountCounter(v float32)` + +SetDiscountCounter gets a reference to the given float32 and assigns it to the DiscountCounter field. + +### GetDiscountRemainder + +`func (o *Coupon) GetDiscountRemainder() float32` + +GetDiscountRemainder returns the DiscountRemainder field if non-nil, zero value otherwise. + +### GetDiscountRemainderOk + +`func (o *Coupon) GetDiscountRemainderOk() (float32, bool)` + +GetDiscountRemainderOk returns a tuple with the DiscountRemainder field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasDiscountRemainder + +`func (o *Coupon) HasDiscountRemainder() bool` + +HasDiscountRemainder returns a boolean if a field has been set. + +### SetDiscountRemainder + +`func (o *Coupon) SetDiscountRemainder(v float32)` + +SetDiscountRemainder gets a reference to the given float32 and assigns it to the DiscountRemainder field. + ### GetAttributes `func (o *Coupon) GetAttributes() map[string]interface{}` diff --git a/docs/CouponConstraints.md b/docs/CouponConstraints.md index fad17a8c..a16cbbe2 100644 --- a/docs/CouponConstraints.md +++ b/docs/CouponConstraints.md @@ -5,6 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **UsageLimit** | Pointer to **int32** | The number of times a coupon code can be redeemed. This can be set to 0 for no limit, but any campaign usage limits will still apply. | [optional] +**DiscountLimit** | Pointer to **float32** | The amount of discounts that can be given with this coupon code. | [optional] **StartDate** | Pointer to [**time.Time**](time.Time.md) | Timestamp at which point the coupon becomes valid. | [optional] **ExpiryDate** | Pointer to [**time.Time**](time.Time.md) | Expiry date of the coupon. Coupon never expires if this is omitted, zero, or negative. | [optional] @@ -35,6 +36,31 @@ HasUsageLimit returns a boolean if a field has been set. SetUsageLimit gets a reference to the given int32 and assigns it to the UsageLimit field. +### GetDiscountLimit + +`func (o *CouponConstraints) GetDiscountLimit() float32` + +GetDiscountLimit returns the DiscountLimit field if non-nil, zero value otherwise. + +### GetDiscountLimitOk + +`func (o *CouponConstraints) GetDiscountLimitOk() (float32, bool)` + +GetDiscountLimitOk returns a tuple with the DiscountLimit field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasDiscountLimit + +`func (o *CouponConstraints) HasDiscountLimit() bool` + +HasDiscountLimit returns a boolean if a field has been set. + +### SetDiscountLimit + +`func (o *CouponConstraints) SetDiscountLimit(v float32)` + +SetDiscountLimit gets a reference to the given float32 and assigns it to the DiscountLimit field. + ### GetStartDate `func (o *CouponConstraints) GetStartDate() time.Time` diff --git a/docs/CustomerInventory.md b/docs/CustomerInventory.md index fe0101f6..607cd96b 100644 --- a/docs/CustomerInventory.md +++ b/docs/CustomerInventory.md @@ -6,6 +6,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **Profile** | Pointer to [**CustomerProfile**](CustomerProfile.md) | | [optional] **Referrals** | Pointer to [**[]Referral**](Referral.md) | | [optional] +**Coupons** | Pointer to [**[]Coupon**](Coupon.md) | | [optional] ## Methods @@ -59,6 +60,31 @@ HasReferrals returns a boolean if a field has been set. SetReferrals gets a reference to the given []Referral and assigns it to the Referrals field. +### GetCoupons + +`func (o *CustomerInventory) GetCoupons() []Coupon` + +GetCoupons returns the Coupons field if non-nil, zero value otherwise. + +### GetCouponsOk + +`func (o *CustomerInventory) GetCouponsOk() ([]Coupon, bool)` + +GetCouponsOk returns a tuple with the Coupons field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasCoupons + +`func (o *CustomerInventory) HasCoupons() bool` + +HasCoupons returns a boolean if a field has been set. + +### SetCoupons + +`func (o *CustomerInventory) SetCoupons(v []Coupon)` + +SetCoupons gets a reference to the given []Coupon and assigns it to the Coupons field. + [[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/CustomerProfileUpdate.md b/docs/CustomerProfileUpdate.md new file mode 100644 index 00000000..54fbf619 --- /dev/null +++ b/docs/CustomerProfileUpdate.md @@ -0,0 +1,39 @@ +# CustomerProfileUpdate + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**CustomerProfile** | Pointer to [**CustomerProfile**](CustomerProfile.md) | | + +## Methods + +### GetCustomerProfile + +`func (o *CustomerProfileUpdate) GetCustomerProfile() CustomerProfile` + +GetCustomerProfile returns the CustomerProfile field if non-nil, zero value otherwise. + +### GetCustomerProfileOk + +`func (o *CustomerProfileUpdate) GetCustomerProfileOk() (CustomerProfile, bool)` + +GetCustomerProfileOk returns a tuple with the CustomerProfile field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasCustomerProfile + +`func (o *CustomerProfileUpdate) HasCustomerProfile() bool` + +HasCustomerProfile returns a boolean if a field has been set. + +### SetCustomerProfile + +`func (o *CustomerProfileUpdate) SetCustomerProfile(v CustomerProfile)` + +SetCustomerProfile gets a reference to the given CustomerProfile and assigns it to the CustomerProfile field. + + +[[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/InlineResponse2001.md b/docs/InlineResponse2001.md index f20e977d..0dd82c2d 100644 --- a/docs/InlineResponse2001.md +++ b/docs/InlineResponse2001.md @@ -5,7 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **TotalResultSize** | Pointer to **int32** | | -**Data** | Pointer to [**[]Coupon**](Coupon.md) | | +**Data** | Pointer to [**[]Application**](Application.md) | | ## Methods @@ -36,13 +36,13 @@ SetTotalResultSize gets a reference to the given int32 and assigns it to the Tot ### GetData -`func (o *InlineResponse2001) GetData() []Coupon` +`func (o *InlineResponse2001) GetData() []Application` GetData returns the Data field if non-nil, zero value otherwise. ### GetDataOk -`func (o *InlineResponse2001) GetDataOk() ([]Coupon, bool)` +`func (o *InlineResponse2001) GetDataOk() ([]Application, bool)` GetDataOk returns a tuple with the Data field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. @@ -55,9 +55,9 @@ HasData returns a boolean if a field has been set. ### SetData -`func (o *InlineResponse2001) SetData(v []Coupon)` +`func (o *InlineResponse2001) SetData(v []Application)` -SetData gets a reference to the given []Coupon and assigns it to the Data field. +SetData gets a reference to the given []Application and assigns it to the Data field. [[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/InlineResponse2002.md b/docs/InlineResponse2002.md index 306641b0..48583436 100644 --- a/docs/InlineResponse2002.md +++ b/docs/InlineResponse2002.md @@ -5,7 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **TotalResultSize** | Pointer to **int32** | | -**Data** | Pointer to [**[]Application**](Application.md) | | +**Data** | Pointer to [**[]Campaign**](Campaign.md) | | ## Methods @@ -36,13 +36,13 @@ SetTotalResultSize gets a reference to the given int32 and assigns it to the Tot ### GetData -`func (o *InlineResponse2002) GetData() []Application` +`func (o *InlineResponse2002) GetData() []Campaign` GetData returns the Data field if non-nil, zero value otherwise. ### GetDataOk -`func (o *InlineResponse2002) GetDataOk() ([]Application, bool)` +`func (o *InlineResponse2002) GetDataOk() ([]Campaign, bool)` GetDataOk returns a tuple with the Data field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. @@ -55,9 +55,9 @@ HasData returns a boolean if a field has been set. ### SetData -`func (o *InlineResponse2002) SetData(v []Application)` +`func (o *InlineResponse2002) SetData(v []Campaign)` -SetData gets a reference to the given []Application and assigns it to the Data field. +SetData gets a reference to the given []Campaign and assigns it to the Data field. [[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/InlineResponse2003.md b/docs/InlineResponse2003.md index e5d221a1..2ea5d68d 100644 --- a/docs/InlineResponse2003.md +++ b/docs/InlineResponse2003.md @@ -5,7 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **TotalResultSize** | Pointer to **int32** | | -**Data** | Pointer to [**[]Campaign**](Campaign.md) | | +**Data** | Pointer to [**[]Ruleset**](Ruleset.md) | | ## Methods @@ -36,13 +36,13 @@ SetTotalResultSize gets a reference to the given int32 and assigns it to the Tot ### GetData -`func (o *InlineResponse2003) GetData() []Campaign` +`func (o *InlineResponse2003) GetData() []Ruleset` GetData returns the Data field if non-nil, zero value otherwise. ### GetDataOk -`func (o *InlineResponse2003) GetDataOk() ([]Campaign, bool)` +`func (o *InlineResponse2003) GetDataOk() ([]Ruleset, bool)` GetDataOk returns a tuple with the Data field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. @@ -55,9 +55,9 @@ HasData returns a boolean if a field has been set. ### SetData -`func (o *InlineResponse2003) SetData(v []Campaign)` +`func (o *InlineResponse2003) SetData(v []Ruleset)` -SetData gets a reference to the given []Campaign and assigns it to the Data field. +SetData gets a reference to the given []Ruleset and assigns it to the Data field. [[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/InlineResponse2004.md b/docs/InlineResponse2004.md index 4f0bf311..795ecc41 100644 --- a/docs/InlineResponse2004.md +++ b/docs/InlineResponse2004.md @@ -5,7 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **TotalResultSize** | Pointer to **int32** | | -**Data** | Pointer to [**[]Ruleset**](Ruleset.md) | | +**Data** | Pointer to [**[]Coupon**](Coupon.md) | | ## Methods @@ -36,13 +36,13 @@ SetTotalResultSize gets a reference to the given int32 and assigns it to the Tot ### GetData -`func (o *InlineResponse2004) GetData() []Ruleset` +`func (o *InlineResponse2004) GetData() []Coupon` GetData returns the Data field if non-nil, zero value otherwise. ### GetDataOk -`func (o *InlineResponse2004) GetDataOk() ([]Ruleset, bool)` +`func (o *InlineResponse2004) GetDataOk() ([]Coupon, bool)` GetDataOk returns a tuple with the Data field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. @@ -55,9 +55,9 @@ HasData returns a boolean if a field has been set. ### SetData -`func (o *InlineResponse2004) SetData(v []Ruleset)` +`func (o *InlineResponse2004) SetData(v []Coupon)` -SetData gets a reference to the given []Ruleset and assigns it to the Data field. +SetData gets a reference to the given []Coupon and assigns it to the Data field. [[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/IntegrationApi.md b/docs/IntegrationApi.md index 70515ccf..ced34321 100644 --- a/docs/IntegrationApi.md +++ b/docs/IntegrationApi.md @@ -9,10 +9,10 @@ Method | HTTP request | Description [**DeleteCouponReservation**](IntegrationApi.md#DeleteCouponReservation) | **Delete** /v1/coupon_reservations/{couponValue} | Delete coupon reservations [**DeleteCustomerData**](IntegrationApi.md#DeleteCustomerData) | **Delete** /v1/customer_data/{integrationId} | Delete the personal data of a customer. [**GetCustomerInventory**](IntegrationApi.md#GetCustomerInventory) | **Get** /v1/customer_profiles/{integrationId}/inventory | Get an inventory of all data associated with a specific customer profile. -[**GetReservedCoupons**](IntegrationApi.md#GetReservedCoupons) | **Get** /v1/coupon_reservations/coupons/{integrationId} | Get all valid reserved coupons [**GetReservedCustomers**](IntegrationApi.md#GetReservedCustomers) | **Get** /v1/coupon_reservations/customerprofiles/{couponValue} | Get the users that have this coupon reserved [**TrackEvent**](IntegrationApi.md#TrackEvent) | **Post** /v1/events | Track an Event [**UpdateCustomerProfile**](IntegrationApi.md#UpdateCustomerProfile) | **Put** /v1/customer_profiles/{integrationId} | Update a Customer Profile +[**UpdateCustomerProfileV2**](IntegrationApi.md#UpdateCustomerProfileV2) | **Put** /v2/customer_profiles/{customerProfileId} | Update a Customer Profile [**UpdateCustomerSession**](IntegrationApi.md#UpdateCustomerSession) | **Put** /v1/customer_sessions/{customerSessionId} | Update a Customer Session [**UpdateCustomerSessionV2**](IntegrationApi.md#UpdateCustomerSessionV2) | **Put** /v2/customer_sessions/{customerSessionId} | Update a Customer Session @@ -190,7 +190,7 @@ Name | Type | Description | Notes ## GetCustomerInventory -> CustomerInventory GetCustomerInventory(ctx, integrationId).Profile(profile).Referrals(referrals).Execute() +> CustomerInventory GetCustomerInventory(ctx, integrationId).Profile(profile).Referrals(referrals).Coupons(coupons).Execute() Get an inventory of all data associated with a specific customer profile. @@ -214,6 +214,7 @@ Name | Type | Description | Notes **profile** | **bool** | optional flag to decide if you would like customer profile information in the response | **referrals** | **bool** | optional flag to decide if you would like referral information in the response | + **coupons** | **bool** | optional flag to decide if you would like coupon information in the response | ### Return type @@ -233,11 +234,11 @@ Name | Type | Description | Notes [[Back to README]](../README.md) -## GetReservedCoupons +## GetReservedCustomers -> InlineResponse2001 GetReservedCoupons(ctx, integrationId).Execute() +> InlineResponse200 GetReservedCustomers(ctx, couponValue).Execute() -Get all valid reserved coupons +Get the users that have this coupon reserved @@ -247,11 +248,11 @@ Get all valid reserved coupons Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**integrationId** | **string** | The custom identifier for this profile, must be unique within the account. | +**couponValue** | **string** | The value of a coupon | ### Other Parameters -Other parameters are passed through a pointer to a apiGetReservedCouponsRequest struct via the builder pattern +Other parameters are passed through a pointer to a apiGetReservedCustomersRequest struct via the builder pattern Name | Type | Description | Notes @@ -260,7 +261,7 @@ Name | Type | Description | Notes ### Return type -[**InlineResponse2001**](inline_response_200_1.md) +[**InlineResponse200**](inline_response_200.md) ### Authorization @@ -276,34 +277,31 @@ Name | Type | Description | Notes [[Back to README]](../README.md) -## GetReservedCustomers +## TrackEvent -> InlineResponse200 GetReservedCustomers(ctx, couponValue).Execute() +> IntegrationState TrackEvent(ctx).Body(body).Dry(dry).Execute() -Get the users that have this coupon reserved +Track an Event ### Path Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**couponValue** | **string** | The value of a coupon | ### Other Parameters -Other parameters are passed through a pointer to a apiGetReservedCustomersRequest struct via the builder pattern +Other parameters are passed through a pointer to a apiTrackEventRequest struct via the builder pattern Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - + **body** | [**NewEvent**](NewEvent.md) | | + **dry** | **bool** | Flag to indicate whether to skip persisting the changes or not (Will not persist if set to 'true'). | ### Return type -[**InlineResponse200**](inline_response_200.md) +[**IntegrationState**](IntegrationState.md) ### Authorization @@ -311,7 +309,7 @@ Name | Type | Description | Notes ### HTTP request headers -- **Content-Type**: Not defined +- **Content-Type**: application/json - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) @@ -319,26 +317,32 @@ Name | Type | Description | Notes [[Back to README]](../README.md) -## TrackEvent +## UpdateCustomerProfile -> IntegrationState TrackEvent(ctx).Body(body).Execute() +> IntegrationState UpdateCustomerProfile(ctx, integrationId).Body(body).Dry(dry).Execute() -Track an Event +Update a Customer Profile ### Path Parameters +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**integrationId** | **string** | The custom identifier for this profile, must be unique within the account. | ### Other Parameters -Other parameters are passed through a pointer to a apiTrackEventRequest struct via the builder pattern +Other parameters are passed through a pointer to a apiUpdateCustomerProfileRequest struct via the builder pattern Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**NewEvent**](NewEvent.md) | | + + **body** | [**NewCustomerProfile**](NewCustomerProfile.md) | | + **dry** | **bool** | Flag to indicate whether to skip persisting the changes or not (Will not persist if set to 'true'). | ### Return type @@ -358,9 +362,9 @@ Name | Type | Description | Notes [[Back to README]](../README.md) -## UpdateCustomerProfile +## UpdateCustomerProfileV2 -> IntegrationState UpdateCustomerProfile(ctx, integrationId).Body(body).Execute() +> CustomerProfileUpdate UpdateCustomerProfileV2(ctx, customerProfileId).Body(body).Execute() Update a Customer Profile @@ -372,11 +376,11 @@ Update a Customer Profile Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**integrationId** | **string** | The custom identifier for this profile, must be unique within the account. | +**customerProfileId** | **string** | The custom identifier for this profile, must be unique within the account. | ### Other Parameters -Other parameters are passed through a pointer to a apiUpdateCustomerProfileRequest struct via the builder pattern +Other parameters are passed through a pointer to a apiUpdateCustomerProfileV2Request struct via the builder pattern Name | Type | Description | Notes @@ -386,11 +390,11 @@ Name | Type | Description | Notes ### Return type -[**IntegrationState**](IntegrationState.md) +[**CustomerProfileUpdate**](CustomerProfileUpdate.md) ### Authorization -[api_key_v1](../README.md#api_key_v1), [integration_auth](../README.md#integration_auth) +[api_key_v1](../README.md#api_key_v1) ### HTTP request headers @@ -404,7 +408,7 @@ Name | Type | Description | Notes ## UpdateCustomerSession -> IntegrationState UpdateCustomerSession(ctx, customerSessionId).Body(body).Execute() +> IntegrationState UpdateCustomerSession(ctx, customerSessionId).Body(body).Dry(dry).Execute() Update a Customer Session @@ -427,6 +431,7 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **body** | [**NewCustomerSession**](NewCustomerSession.md) | | + **dry** | **bool** | Flag to indicate whether to skip persisting the changes or not (Will not persist if set to 'true'). | ### Return type @@ -448,7 +453,7 @@ Name | Type | Description | Notes ## UpdateCustomerSessionV2 -> IntegrationStateV2 UpdateCustomerSessionV2(ctx, customerSessionId).Body(body).Execute() +> IntegrationStateV2 UpdateCustomerSessionV2(ctx, customerSessionId).Body(body).Dry(dry).Execute() Update a Customer Session @@ -471,6 +476,7 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **body** | [**IntegrationRequest**](IntegrationRequest.md) | | + **dry** | **bool** | Flag to indicate whether to skip persisting the changes or not (Will not persist if set to 'true'). | ### Return type diff --git a/docs/LoyaltyLedgerEntry.md b/docs/LoyaltyLedgerEntry.md index 8b3818c6..16b72bef 100644 --- a/docs/LoyaltyLedgerEntry.md +++ b/docs/LoyaltyLedgerEntry.md @@ -14,6 +14,7 @@ Name | Type | Description | Notes **ExpiryDate** | Pointer to [**time.Time**](time.Time.md) | | [optional] **Name** | Pointer to **string** | A name referencing the condition or effect that added this entry, or the specific name provided in an API call. | **SubLedgerID** | Pointer to **string** | This specifies if we are adding loyalty points to the main ledger or a subledger | +**UserID** | Pointer to **int32** | This is the ID of the user who created this entry, if the addition or subtraction was done manually. | [optional] ## Methods @@ -267,6 +268,31 @@ HasSubLedgerID returns a boolean if a field has been set. SetSubLedgerID gets a reference to the given string and assigns it to the SubLedgerID field. +### GetUserID + +`func (o *LoyaltyLedgerEntry) GetUserID() int32` + +GetUserID returns the UserID field if non-nil, zero value otherwise. + +### GetUserIDOk + +`func (o *LoyaltyLedgerEntry) GetUserIDOk() (int32, bool)` + +GetUserIDOk returns a tuple with the UserID field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasUserID + +`func (o *LoyaltyLedgerEntry) HasUserID() bool` + +HasUserID returns a boolean if a field has been set. + +### SetUserID + +`func (o *LoyaltyLedgerEntry) SetUserID(v int32)` + +SetUserID gets a reference to the given int32 and assigns it to the UserID field. + [[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/ManagementApi.md b/docs/ManagementApi.md index e61bc299..236932d4 100644 --- a/docs/ManagementApi.md +++ b/docs/ManagementApi.md @@ -42,7 +42,6 @@ Method | HTTP request | Description [**GetCampaign**](ManagementApi.md#GetCampaign) | **Get** /v1/applications/{applicationId}/campaigns/{campaignId} | Get a Campaign [**GetCampaignAnalytics**](ManagementApi.md#GetCampaignAnalytics) | **Get** /v1/applications/{applicationId}/campaigns/{campaignId}/analytics | Get analytics of campaigns [**GetCampaignByAttributes**](ManagementApi.md#GetCampaignByAttributes) | **Post** /v1/applications/{applicationId}/campaigns_search | Get a list of all campaigns that match the given attributes -[**GetCampaignSet**](ManagementApi.md#GetCampaignSet) | **Get** /v1/applications/{applicationId}/campaign_set | List CampaignSet [**GetCampaigns**](ManagementApi.md#GetCampaigns) | **Get** /v1/applications/{applicationId}/campaigns | List your Campaigns [**GetChanges**](ManagementApi.md#GetChanges) | **Get** /v1/changes | Get audit log for an account [**GetCoupons**](ManagementApi.md#GetCoupons) | **Get** /v1/applications/{applicationId}/campaigns/{campaignId}/coupons | List Coupons @@ -82,7 +81,6 @@ Method | HTTP request | Description [**UpdateAdditionalCost**](ManagementApi.md#UpdateAdditionalCost) | **Put** /v1/additional_costs/{additionalCostId} | Update an additional cost [**UpdateAttribute**](ManagementApi.md#UpdateAttribute) | **Put** /v1/attributes/{attributeId} | Update a custom attribute [**UpdateCampaign**](ManagementApi.md#UpdateCampaign) | **Put** /v1/applications/{applicationId}/campaigns/{campaignId} | Update a Campaign -[**UpdateCampaignSet**](ManagementApi.md#UpdateCampaignSet) | **Put** /v1/applications/{applicationId}/campaign_set | Update a Campaign Set [**UpdateCoupon**](ManagementApi.md#UpdateCoupon) | **Put** /v1/applications/{applicationId}/campaigns/{campaignId}/coupons/{couponId} | Update a Coupon [**UpdateCouponBatch**](ManagementApi.md#UpdateCouponBatch) | **Put** /v1/applications/{applicationId}/campaigns/{campaignId}/coupons | Update a Batch of Coupons [**UpdateRuleset**](ManagementApi.md#UpdateRuleset) | **Put** /v1/applications/{applicationId}/campaigns/{campaignId}/rulesets/{rulesetId} | Update a Ruleset @@ -135,7 +133,7 @@ Name | Type | Description | Notes ## CopyCampaignToApplications -> InlineResponse2003 CopyCampaignToApplications(ctx, applicationId, campaignId).Body(body).Execute() +> InlineResponse2002 CopyCampaignToApplications(ctx, applicationId, campaignId).Body(body).Execute() Copy the campaign into every specified application @@ -163,7 +161,7 @@ Name | Type | Description | Notes ### Return type -[**InlineResponse2003**](inline_response_200_3.md) +[**InlineResponse2002**](inline_response_200_2.md) ### Authorization @@ -301,7 +299,7 @@ Name | Type | Description | Notes ## CreateCoupons -> InlineResponse2001 CreateCoupons(ctx, applicationId, campaignId).Body(body).Silent(silent).Execute() +> InlineResponse2004 CreateCoupons(ctx, applicationId, campaignId).Body(body).Silent(silent).Execute() Create Coupons @@ -330,7 +328,7 @@ Name | Type | Description | Notes ### Return type -[**InlineResponse2001**](inline_response_200_1.md) +[**InlineResponse2004**](inline_response_200_4.md) ### Authorization @@ -1509,7 +1507,7 @@ Name | Type | Description | Notes ## GetApplications -> InlineResponse2002 GetApplications(ctx).PageSize(pageSize).Skip(skip).Sort(sort).Execute() +> InlineResponse2001 GetApplications(ctx).PageSize(pageSize).Skip(skip).Sort(sort).Execute() List Applications @@ -1532,7 +1530,7 @@ Name | Type | Description | Notes ### Return type -[**InlineResponse2002**](inline_response_200_2.md) +[**InlineResponse2001**](inline_response_200_1.md) ### Authorization @@ -1723,7 +1721,7 @@ Name | Type | Description | Notes ## GetCampaignByAttributes -> InlineResponse2003 GetCampaignByAttributes(ctx, applicationId).Body(body).PageSize(pageSize).Skip(skip).Sort(sort).CampaignState(campaignState).Execute() +> InlineResponse2002 GetCampaignByAttributes(ctx, applicationId).Body(body).PageSize(pageSize).Skip(skip).Sort(sort).CampaignState(campaignState).Execute() Get a list of all campaigns that match the given attributes @@ -1753,7 +1751,7 @@ Name | Type | Description | Notes ### Return type -[**InlineResponse2003**](inline_response_200_3.md) +[**InlineResponse2002**](inline_response_200_2.md) ### Authorization @@ -1769,50 +1767,9 @@ Name | Type | Description | Notes [[Back to README]](../README.md) -## GetCampaignSet - -> CampaignSet GetCampaignSet(ctx, applicationId).Execute() - -List CampaignSet - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**applicationId** | **int32** | | - -### Other Parameters - -Other parameters are passed through a pointer to a apiGetCampaignSetRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - -### Return type - -[**CampaignSet**](CampaignSet.md) - -### Authorization - -[manager_auth](../README.md#manager_auth) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[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) - - ## GetCampaigns -> InlineResponse2003 GetCampaigns(ctx, applicationId).PageSize(pageSize).Skip(skip).Sort(sort).CampaignState(campaignState).Name(name).Tags(tags).CreatedBefore(createdBefore).CreatedAfter(createdAfter).Execute() +> InlineResponse2002 GetCampaigns(ctx, applicationId).PageSize(pageSize).Skip(skip).Sort(sort).CampaignState(campaignState).Name(name).Tags(tags).CreatedBefore(createdBefore).CreatedAfter(createdAfter).Execute() List your Campaigns @@ -1843,7 +1800,7 @@ Name | Type | Description | Notes ### Return type -[**InlineResponse2003**](inline_response_200_3.md) +[**InlineResponse2002**](inline_response_200_2.md) ### Authorization @@ -1907,7 +1864,7 @@ Name | Type | Description | Notes ## GetCoupons -> InlineResponse2001 GetCoupons(ctx, applicationId, campaignId).PageSize(pageSize).Skip(skip).Sort(sort).Value(value).CreatedBefore(createdBefore).CreatedAfter(createdAfter).StartsAfter(startsAfter).StartsBefore(startsBefore).ExpiresAfter(expiresAfter).ExpiresBefore(expiresBefore).Valid(valid).BatchId(batchId).Usable(usable).ReferralId(referralId).RecipientIntegrationId(recipientIntegrationId).ExactMatch(exactMatch).Execute() +> InlineResponse2004 GetCoupons(ctx, applicationId, campaignId).PageSize(pageSize).Skip(skip).Sort(sort).Value(value).CreatedBefore(createdBefore).CreatedAfter(createdAfter).StartsAfter(startsAfter).StartsBefore(startsBefore).ExpiresAfter(expiresAfter).ExpiresBefore(expiresBefore).Valid(valid).BatchId(batchId).Usable(usable).ReferralId(referralId).RecipientIntegrationId(recipientIntegrationId).ExactMatch(exactMatch).Execute() List Coupons @@ -1948,7 +1905,7 @@ Name | Type | Description | Notes ### Return type -[**InlineResponse2001**](inline_response_200_1.md) +[**InlineResponse2004**](inline_response_200_4.md) ### Authorization @@ -1966,7 +1923,7 @@ Name | Type | Description | Notes ## GetCouponsByAttributes -> InlineResponse2001 GetCouponsByAttributes(ctx, applicationId, campaignId).Body(body).PageSize(pageSize).Skip(skip).Sort(sort).Value(value).CreatedBefore(createdBefore).CreatedAfter(createdAfter).Valid(valid).Usable(usable).ReferralId(referralId).RecipientIntegrationId(recipientIntegrationId).ExactMatch(exactMatch).BatchId(batchId).Execute() +> InlineResponse2004 GetCouponsByAttributes(ctx, applicationId, campaignId).Body(body).PageSize(pageSize).Skip(skip).Sort(sort).Value(value).CreatedBefore(createdBefore).CreatedAfter(createdAfter).Valid(valid).Usable(usable).ReferralId(referralId).RecipientIntegrationId(recipientIntegrationId).ExactMatch(exactMatch).BatchId(batchId).Execute() Get a list of the coupons that match the given attributes @@ -2006,7 +1963,7 @@ Name | Type | Description | Notes ### Return type -[**InlineResponse2001**](inline_response_200_1.md) +[**InlineResponse2004**](inline_response_200_4.md) ### Authorization @@ -2024,7 +1981,7 @@ Name | Type | Description | Notes ## GetCouponsByAttributesApplicationWide -> InlineResponse2001 GetCouponsByAttributesApplicationWide(ctx, applicationId).Body(body).PageSize(pageSize).Skip(skip).Sort(sort).Value(value).CreatedBefore(createdBefore).CreatedAfter(createdAfter).Valid(valid).Usable(usable).ReferralId(referralId).RecipientIntegrationId(recipientIntegrationId).BatchId(batchId).ExactMatch(exactMatch).CampaignState(campaignState).Execute() +> InlineResponse2004 GetCouponsByAttributesApplicationWide(ctx, applicationId).Body(body).PageSize(pageSize).Skip(skip).Sort(sort).Value(value).CreatedBefore(createdBefore).CreatedAfter(createdAfter).Valid(valid).Usable(usable).ReferralId(referralId).RecipientIntegrationId(recipientIntegrationId).BatchId(batchId).ExactMatch(exactMatch).CampaignState(campaignState).Execute() Get a list of the coupons that match the given attributes in all active campaigns of an application @@ -2063,7 +2020,7 @@ Name | Type | Description | Notes ### Return type -[**InlineResponse2001**](inline_response_200_1.md) +[**InlineResponse2004**](inline_response_200_4.md) ### Authorization @@ -2895,7 +2852,7 @@ Name | Type | Description | Notes ## GetRulesets -> InlineResponse2004 GetRulesets(ctx, applicationId, campaignId).PageSize(pageSize).Skip(skip).Sort(sort).Execute() +> InlineResponse2003 GetRulesets(ctx, applicationId, campaignId).PageSize(pageSize).Skip(skip).Sort(sort).Execute() List Campaign Rulesets @@ -2923,7 +2880,7 @@ Name | Type | Description | Notes ### Return type -[**InlineResponse2004**](inline_response_200_4.md) +[**InlineResponse2003**](inline_response_200_3.md) ### Authorization @@ -3284,7 +3241,7 @@ Name | Type | Description | Notes ## SearchCouponsAdvanced -> InlineResponse2001 SearchCouponsAdvanced(ctx, applicationId, campaignId).Body(body).PageSize(pageSize).Skip(skip).Sort(sort).Value(value).CreatedBefore(createdBefore).CreatedAfter(createdAfter).Valid(valid).Usable(usable).ReferralId(referralId).RecipientIntegrationId(recipientIntegrationId).ExactMatch(exactMatch).BatchId(batchId).Execute() +> InlineResponse2004 SearchCouponsAdvanced(ctx, applicationId, campaignId).Body(body).PageSize(pageSize).Skip(skip).Sort(sort).Value(value).CreatedBefore(createdBefore).CreatedAfter(createdAfter).Valid(valid).Usable(usable).ReferralId(referralId).RecipientIntegrationId(recipientIntegrationId).ExactMatch(exactMatch).BatchId(batchId).Execute() Get a list of the coupons that match the given attributes @@ -3324,7 +3281,7 @@ Name | Type | Description | Notes ### Return type -[**InlineResponse2001**](inline_response_200_1.md) +[**InlineResponse2004**](inline_response_200_4.md) ### Authorization @@ -3342,7 +3299,7 @@ Name | Type | Description | Notes ## SearchCouponsAdvancedApplicationWide -> InlineResponse2001 SearchCouponsAdvancedApplicationWide(ctx, applicationId).Body(body).PageSize(pageSize).Skip(skip).Sort(sort).Value(value).CreatedBefore(createdBefore).CreatedAfter(createdAfter).Valid(valid).Usable(usable).ReferralId(referralId).RecipientIntegrationId(recipientIntegrationId).BatchId(batchId).ExactMatch(exactMatch).CampaignState(campaignState).Execute() +> InlineResponse2004 SearchCouponsAdvancedApplicationWide(ctx, applicationId).Body(body).PageSize(pageSize).Skip(skip).Sort(sort).Value(value).CreatedBefore(createdBefore).CreatedAfter(createdAfter).Valid(valid).Usable(usable).ReferralId(referralId).RecipientIntegrationId(recipientIntegrationId).BatchId(batchId).ExactMatch(exactMatch).CampaignState(campaignState).Execute() Get a list of the coupons that match the given attributes in all active campaigns of an application @@ -3381,7 +3338,7 @@ Name | Type | Description | Notes ### Return type -[**InlineResponse2001**](inline_response_200_1.md) +[**InlineResponse2004**](inline_response_200_4.md) ### Authorization @@ -3644,48 +3601,6 @@ Name | Type | Description | Notes [[Back to README]](../README.md) -## UpdateCampaignSet - -> CampaignSet UpdateCampaignSet(ctx, applicationId).Body(body).Execute() - -Update a Campaign Set - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**applicationId** | **int32** | | - -### Other Parameters - -Other parameters are passed through a pointer to a apiUpdateCampaignSetRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - **body** | [**NewCampaignSet**](NewCampaignSet.md) | | - -### Return type - -[**CampaignSet**](CampaignSet.md) - -### Authorization - -[manager_auth](../README.md#manager_auth) - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/json - -[[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) - - ## UpdateCoupon > Coupon UpdateCoupon(ctx, applicationId, campaignId, couponId).Body(body).Execute() diff --git a/docs/NewApplication.md b/docs/NewApplication.md index bc3ae07a..19fb3deb 100644 --- a/docs/NewApplication.md +++ b/docs/NewApplication.md @@ -11,6 +11,7 @@ Name | Type | Description | Notes **CaseSensitivity** | Pointer to **string** | A string indicating how should campaigns in this application deal with case sensitivity on coupon codes. | [optional] **Attributes** | Pointer to [**map[string]interface{}**](.md) | Arbitrary properties associated with this campaign | [optional] **Limits** | Pointer to [**[]LimitConfig**](LimitConfig.md) | Default limits for campaigns created in this application | [optional] +**CampaignPriority** | Pointer to **string** | Default priority for campaigns created in this application, can be one of (universal, stackable, exclusive) | [optional] **AttributesSettings** | Pointer to [**AttributesSettings**](AttributesSettings.md) | | [optional] **Key** | Pointer to **string** | Hex key for HMAC-signing API calls as coming from this application (16 hex digits) | [optional] @@ -191,6 +192,31 @@ HasLimits returns a boolean if a field has been set. SetLimits gets a reference to the given []LimitConfig and assigns it to the Limits field. +### GetCampaignPriority + +`func (o *NewApplication) GetCampaignPriority() string` + +GetCampaignPriority returns the CampaignPriority field if non-nil, zero value otherwise. + +### GetCampaignPriorityOk + +`func (o *NewApplication) GetCampaignPriorityOk() (string, bool)` + +GetCampaignPriorityOk returns a tuple with the CampaignPriority field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasCampaignPriority + +`func (o *NewApplication) HasCampaignPriority() bool` + +HasCampaignPriority returns a boolean if a field has been set. + +### SetCampaignPriority + +`func (o *NewApplication) SetCampaignPriority(v string)` + +SetCampaignPriority gets a reference to the given string and assigns it to the CampaignPriority field. + ### GetAttributesSettings `func (o *NewApplication) GetAttributesSettings() AttributesSettings` diff --git a/docs/NewCampaignSet.md b/docs/NewCampaignSet.md index 6b14f2a1..8d7d2159 100644 --- a/docs/NewCampaignSet.md +++ b/docs/NewCampaignSet.md @@ -5,6 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **ApplicationId** | Pointer to **int32** | The ID of the application that owns this entity. | +**Version** | Pointer to **int32** | Version of the campaign set | **Set** | Pointer to [**CampaignSetBranchNode**](CampaignSetBranchNode.md) | | ## Methods @@ -34,6 +35,31 @@ HasApplicationId returns a boolean if a field has been set. SetApplicationId gets a reference to the given int32 and assigns it to the ApplicationId field. +### GetVersion + +`func (o *NewCampaignSet) GetVersion() int32` + +GetVersion returns the Version field if non-nil, zero value otherwise. + +### GetVersionOk + +`func (o *NewCampaignSet) GetVersionOk() (int32, bool)` + +GetVersionOk returns a tuple with the Version field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasVersion + +`func (o *NewCampaignSet) HasVersion() bool` + +HasVersion returns a boolean if a field has been set. + +### SetVersion + +`func (o *NewCampaignSet) SetVersion(v int32)` + +SetVersion gets a reference to the given int32 and assigns it to the Version field. + ### GetSet `func (o *NewCampaignSet) GetSet() CampaignSetBranchNode` diff --git a/docs/NewCoupons.md b/docs/NewCoupons.md index f39f3192..cdc0a589 100644 --- a/docs/NewCoupons.md +++ b/docs/NewCoupons.md @@ -5,6 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **UsageLimit** | Pointer to **int32** | The number of times a coupon code can be redeemed. This can be set to 0 for no limit, but any campaign usage limits will still apply. | +**DiscountLimit** | Pointer to **float32** | The amount of discounts that can be given with this coupon code. | [optional] **StartDate** | Pointer to [**time.Time**](time.Time.md) | Timestamp at which point the coupon becomes valid. | [optional] **ExpiryDate** | Pointer to [**time.Time**](time.Time.md) | Expiry date of the coupon. Coupon never expires if this is omitted, zero, or negative. | [optional] **ValidCharacters** | Pointer to **[]string** | Set of characters to be used when generating random part of code. Defaults to [A-Z, 0-9] (in terms of RegExp). | @@ -41,6 +42,31 @@ HasUsageLimit returns a boolean if a field has been set. SetUsageLimit gets a reference to the given int32 and assigns it to the UsageLimit field. +### GetDiscountLimit + +`func (o *NewCoupons) GetDiscountLimit() float32` + +GetDiscountLimit returns the DiscountLimit field if non-nil, zero value otherwise. + +### GetDiscountLimitOk + +`func (o *NewCoupons) GetDiscountLimitOk() (float32, bool)` + +GetDiscountLimitOk returns a tuple with the DiscountLimit field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasDiscountLimit + +`func (o *NewCoupons) HasDiscountLimit() bool` + +HasDiscountLimit returns a boolean if a field has been set. + +### SetDiscountLimit + +`func (o *NewCoupons) SetDiscountLimit(v float32)` + +SetDiscountLimit gets a reference to the given float32 and assigns it to the DiscountLimit field. + ### GetStartDate `func (o *NewCoupons) GetStartDate() time.Time` diff --git a/docs/UpdateApplication.md b/docs/UpdateApplication.md index dae023ad..67e74f06 100644 --- a/docs/UpdateApplication.md +++ b/docs/UpdateApplication.md @@ -11,6 +11,7 @@ Name | Type | Description | Notes **CaseSensitivity** | Pointer to **string** | A string indicating how should campaigns in this application deal with case sensitivity on coupon codes. | [optional] **Attributes** | Pointer to [**map[string]interface{}**](.md) | Arbitrary properties associated with this campaign | [optional] **Limits** | Pointer to [**[]LimitConfig**](LimitConfig.md) | Default limits for campaigns created in this application | [optional] +**CampaignPriority** | Pointer to **string** | Default priority for campaigns created in this application, can be one of (universal, stackable, exclusive) | [optional] **AttributesSettings** | Pointer to [**AttributesSettings**](AttributesSettings.md) | | [optional] ## Methods @@ -190,6 +191,31 @@ HasLimits returns a boolean if a field has been set. SetLimits gets a reference to the given []LimitConfig and assigns it to the Limits field. +### GetCampaignPriority + +`func (o *UpdateApplication) GetCampaignPriority() string` + +GetCampaignPriority returns the CampaignPriority field if non-nil, zero value otherwise. + +### GetCampaignPriorityOk + +`func (o *UpdateApplication) GetCampaignPriorityOk() (string, bool)` + +GetCampaignPriorityOk returns a tuple with the CampaignPriority field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasCampaignPriority + +`func (o *UpdateApplication) HasCampaignPriority() bool` + +HasCampaignPriority returns a boolean if a field has been set. + +### SetCampaignPriority + +`func (o *UpdateApplication) SetCampaignPriority(v string)` + +SetCampaignPriority gets a reference to the given string and assigns it to the CampaignPriority field. + ### GetAttributesSettings `func (o *UpdateApplication) GetAttributesSettings() AttributesSettings` diff --git a/docs/UpdateCoupon.md b/docs/UpdateCoupon.md index d06389b9..3f52cb30 100644 --- a/docs/UpdateCoupon.md +++ b/docs/UpdateCoupon.md @@ -5,6 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **UsageLimit** | Pointer to **int32** | The number of times a coupon code can be redeemed. This can be set to 0 for no limit, but any campaign usage limits will still apply. | [optional] +**DiscountLimit** | Pointer to **float32** | The amount of discounts that can be given with this coupon code. | [optional] **StartDate** | Pointer to [**time.Time**](time.Time.md) | Timestamp at which point the coupon becomes valid. | [optional] **ExpiryDate** | Pointer to [**time.Time**](time.Time.md) | Expiry date of the coupon. Coupon never expires if this is omitted, zero, or negative. | [optional] **RecipientIntegrationId** | Pointer to **string** | The integration ID for this coupon's beneficiary's profile | [optional] @@ -37,6 +38,31 @@ HasUsageLimit returns a boolean if a field has been set. SetUsageLimit gets a reference to the given int32 and assigns it to the UsageLimit field. +### GetDiscountLimit + +`func (o *UpdateCoupon) GetDiscountLimit() float32` + +GetDiscountLimit returns the DiscountLimit field if non-nil, zero value otherwise. + +### GetDiscountLimitOk + +`func (o *UpdateCoupon) GetDiscountLimitOk() (float32, bool)` + +GetDiscountLimitOk returns a tuple with the DiscountLimit field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasDiscountLimit + +`func (o *UpdateCoupon) HasDiscountLimit() bool` + +HasDiscountLimit returns a boolean if a field has been set. + +### SetDiscountLimit + +`func (o *UpdateCoupon) SetDiscountLimit(v float32)` + +SetDiscountLimit gets a reference to the given float32 and assigns it to the DiscountLimit field. + ### GetStartDate `func (o *UpdateCoupon) GetStartDate() time.Time` diff --git a/docs/UpdateCouponBatch.md b/docs/UpdateCouponBatch.md index 02020977..a5fbb604 100644 --- a/docs/UpdateCouponBatch.md +++ b/docs/UpdateCouponBatch.md @@ -5,6 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **UsageLimit** | Pointer to **int32** | The number of times a coupon code can be redeemed. This can be set to 0 for no limit, but any campaign usage limits will still apply. | [optional] +**DiscountLimit** | Pointer to **float32** | The amount of discounts that can be given with this coupon code. | [optional] **StartDate** | Pointer to [**time.Time**](time.Time.md) | Timestamp at which point the coupon becomes valid. | [optional] **ExpiryDate** | Pointer to [**time.Time**](time.Time.md) | Expiry date of the coupon. Coupon never expires if this is omitted, zero, or negative. | [optional] **Attributes** | Pointer to [**map[string]interface{}**](.md) | Arbitrary properties associated with this item | [optional] @@ -37,6 +38,31 @@ HasUsageLimit returns a boolean if a field has been set. SetUsageLimit gets a reference to the given int32 and assigns it to the UsageLimit field. +### GetDiscountLimit + +`func (o *UpdateCouponBatch) GetDiscountLimit() float32` + +GetDiscountLimit returns the DiscountLimit field if non-nil, zero value otherwise. + +### GetDiscountLimitOk + +`func (o *UpdateCouponBatch) GetDiscountLimitOk() (float32, bool)` + +GetDiscountLimitOk returns a tuple with the DiscountLimit field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasDiscountLimit + +`func (o *UpdateCouponBatch) HasDiscountLimit() bool` + +HasDiscountLimit returns a boolean if a field has been set. + +### SetDiscountLimit + +`func (o *UpdateCouponBatch) SetDiscountLimit(v float32)` + +SetDiscountLimit gets a reference to the given float32 and assigns it to the DiscountLimit field. + ### GetStartDate `func (o *UpdateCouponBatch) GetStartDate() time.Time` diff --git a/model_application.go b/model_application.go index 589c7fcc..4389fadc 100644 --- a/model_application.go +++ b/model_application.go @@ -38,7 +38,9 @@ type Application struct { // Arbitrary properties associated with this campaign Attributes *map[string]interface{} `json:"attributes,omitempty"` // Default limits for campaigns created in this application - Limits *[]LimitConfig `json:"limits,omitempty"` + Limits *[]LimitConfig `json:"limits,omitempty"` + // Default priority for campaigns created in this application, can be one of (universal, stackable, exclusive) + CampaignPriority *string `json:"campaignPriority,omitempty"` AttributesSettings *AttributesSettings `json:"attributesSettings,omitempty"` // An array containing all the loyalty programs to which this application is subscribed LoyaltyPrograms []LoyaltyProgram `json:"loyaltyPrograms"` @@ -281,6 +283,39 @@ func (o *Application) SetLimits(v []LimitConfig) { o.Limits = &v } +// GetCampaignPriority returns the CampaignPriority field value if set, zero value otherwise. +func (o *Application) GetCampaignPriority() string { + if o == nil || o.CampaignPriority == nil { + var ret string + return ret + } + return *o.CampaignPriority +} + +// GetCampaignPriorityOk returns a tuple with the CampaignPriority field value if set, zero value otherwise +// and a boolean to check if the value has been set. +func (o *Application) GetCampaignPriorityOk() (string, bool) { + if o == nil || o.CampaignPriority == nil { + var ret string + return ret, false + } + return *o.CampaignPriority, true +} + +// HasCampaignPriority returns a boolean if a field has been set. +func (o *Application) HasCampaignPriority() bool { + if o != nil && o.CampaignPriority != nil { + return true + } + + return false +} + +// SetCampaignPriority gets a reference to the given string and assigns it to the CampaignPriority field. +func (o *Application) SetCampaignPriority(v string) { + o.CampaignPriority = &v +} + // GetAttributesSettings returns the AttributesSettings field value if set, zero value otherwise. func (o *Application) GetAttributesSettings() AttributesSettings { if o == nil || o.AttributesSettings == nil { diff --git a/model_application_session.go b/model_application_session.go index cb97a4ae..bd66202f 100644 --- a/model_application_session.go +++ b/model_application_session.go @@ -40,7 +40,7 @@ type ApplicationSession struct { // A map of labelled discount values, in the same currency as the session. Discounts map[string]float32 `json:"discounts"` // The total sum of the session before any discounts applied. - Total *float32 `json:"total,omitempty"` + Total float32 `json:"total"` // Arbitrary properties associated with this item Attributes *map[string]interface{} `json:"attributes,omitempty"` } @@ -246,37 +246,19 @@ func (o *ApplicationSession) SetDiscounts(v map[string]float32) { o.Discounts = v } -// GetTotal returns the Total field value if set, zero value otherwise. +// GetTotal returns the Total field value func (o *ApplicationSession) GetTotal() float32 { - if o == nil || o.Total == nil { + if o == nil { var ret float32 return ret } - return *o.Total -} - -// GetTotalOk returns a tuple with the Total field value if set, zero value otherwise -// and a boolean to check if the value has been set. -func (o *ApplicationSession) GetTotalOk() (float32, bool) { - if o == nil || o.Total == nil { - var ret float32 - return ret, false - } - return *o.Total, true -} - -// HasTotal returns a boolean if a field has been set. -func (o *ApplicationSession) HasTotal() bool { - if o != nil && o.Total != nil { - return true - } - return false + return o.Total } -// SetTotal gets a reference to the given float32 and assigns it to the Total field. +// SetTotal sets field value func (o *ApplicationSession) SetTotal(v float32) { - o.Total = &v + o.Total = v } // GetAttributes returns the Attributes field value if set, zero value otherwise. diff --git a/model_campaign_set.go b/model_campaign_set.go index e5e1e6f0..994b4dd5 100644 --- a/model_campaign_set.go +++ b/model_campaign_set.go @@ -22,8 +22,10 @@ type CampaignSet struct { // The exact moment this entity was created. Created time.Time `json:"created"` // The ID of the application that owns this entity. - ApplicationId int32 `json:"applicationId"` - Set CampaignSetBranchNode `json:"set"` + ApplicationId int32 `json:"applicationId"` + // Version of the campaign set + Version int32 `json:"version"` + Set CampaignSetBranchNode `json:"set"` } // GetId returns the Id field value @@ -71,6 +73,21 @@ func (o *CampaignSet) SetApplicationId(v int32) { o.ApplicationId = v } +// GetVersion returns the Version field value +func (o *CampaignSet) GetVersion() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Version +} + +// SetVersion sets field value +func (o *CampaignSet) SetVersion(v int32) { + o.Version = v +} + // GetSet returns the Set field value func (o *CampaignSet) GetSet() CampaignSetBranchNode { if o == nil { diff --git a/model_coupon.go b/model_coupon.go index 4878e345..fcdd1920 100644 --- a/model_coupon.go +++ b/model_coupon.go @@ -27,17 +27,23 @@ type Coupon struct { Value string `json:"value"` // The number of times a coupon code can be redeemed. This can be set to 0 for no limit, but any campaign usage limits will still apply. UsageLimit int32 `json:"usageLimit"` + // The amount of discounts that can be given with this coupon code. + DiscountLimit *float32 `json:"discountLimit,omitempty"` // Timestamp at which point the coupon becomes valid. StartDate *time.Time `json:"startDate,omitempty"` // Expiry date of the coupon. Coupon never expires if this is omitted, zero, or negative. ExpiryDate *time.Time `json:"expiryDate,omitempty"` // The number of times this coupon has been successfully used. UsageCounter int32 `json:"usageCounter"` + // The amount of discounts given on rules redeeming this coupon. Only usable if a coupon discount budget was set for this coupon. + DiscountCounter *float32 `json:"discountCounter,omitempty"` + // The remaining discount this coupon can give. + DiscountRemainder *float32 `json:"discountRemainder,omitempty"` // Arbitrary properties associated with this item Attributes *map[string]interface{} `json:"attributes,omitempty"` // The integration ID of the referring customer (if any) for whom this coupon was created as an effect. ReferralId *int32 `json:"referralId,omitempty"` - // The integration ID of a referred customer profile. + // The Integration ID of the customer that is allowed to redeem this coupon. RecipientIntegrationId *string `json:"recipientIntegrationId,omitempty"` // The ID of the Import which created this coupon. ImportId *int32 `json:"importId,omitempty"` @@ -122,6 +128,39 @@ func (o *Coupon) SetUsageLimit(v int32) { o.UsageLimit = v } +// GetDiscountLimit returns the DiscountLimit field value if set, zero value otherwise. +func (o *Coupon) GetDiscountLimit() float32 { + if o == nil || o.DiscountLimit == nil { + var ret float32 + return ret + } + return *o.DiscountLimit +} + +// GetDiscountLimitOk returns a tuple with the DiscountLimit field value if set, zero value otherwise +// and a boolean to check if the value has been set. +func (o *Coupon) GetDiscountLimitOk() (float32, bool) { + if o == nil || o.DiscountLimit == nil { + var ret float32 + return ret, false + } + return *o.DiscountLimit, true +} + +// HasDiscountLimit returns a boolean if a field has been set. +func (o *Coupon) HasDiscountLimit() bool { + if o != nil && o.DiscountLimit != nil { + return true + } + + return false +} + +// SetDiscountLimit gets a reference to the given float32 and assigns it to the DiscountLimit field. +func (o *Coupon) SetDiscountLimit(v float32) { + o.DiscountLimit = &v +} + // GetStartDate returns the StartDate field value if set, zero value otherwise. func (o *Coupon) GetStartDate() time.Time { if o == nil || o.StartDate == nil { @@ -203,6 +242,72 @@ func (o *Coupon) SetUsageCounter(v int32) { o.UsageCounter = v } +// GetDiscountCounter returns the DiscountCounter field value if set, zero value otherwise. +func (o *Coupon) GetDiscountCounter() float32 { + if o == nil || o.DiscountCounter == nil { + var ret float32 + return ret + } + return *o.DiscountCounter +} + +// GetDiscountCounterOk returns a tuple with the DiscountCounter field value if set, zero value otherwise +// and a boolean to check if the value has been set. +func (o *Coupon) GetDiscountCounterOk() (float32, bool) { + if o == nil || o.DiscountCounter == nil { + var ret float32 + return ret, false + } + return *o.DiscountCounter, true +} + +// HasDiscountCounter returns a boolean if a field has been set. +func (o *Coupon) HasDiscountCounter() bool { + if o != nil && o.DiscountCounter != nil { + return true + } + + return false +} + +// SetDiscountCounter gets a reference to the given float32 and assigns it to the DiscountCounter field. +func (o *Coupon) SetDiscountCounter(v float32) { + o.DiscountCounter = &v +} + +// GetDiscountRemainder returns the DiscountRemainder field value if set, zero value otherwise. +func (o *Coupon) GetDiscountRemainder() float32 { + if o == nil || o.DiscountRemainder == nil { + var ret float32 + return ret + } + return *o.DiscountRemainder +} + +// GetDiscountRemainderOk returns a tuple with the DiscountRemainder field value if set, zero value otherwise +// and a boolean to check if the value has been set. +func (o *Coupon) GetDiscountRemainderOk() (float32, bool) { + if o == nil || o.DiscountRemainder == nil { + var ret float32 + return ret, false + } + return *o.DiscountRemainder, true +} + +// HasDiscountRemainder returns a boolean if a field has been set. +func (o *Coupon) HasDiscountRemainder() bool { + if o != nil && o.DiscountRemainder != nil { + return true + } + + return false +} + +// SetDiscountRemainder gets a reference to the given float32 and assigns it to the DiscountRemainder field. +func (o *Coupon) SetDiscountRemainder(v float32) { + o.DiscountRemainder = &v +} + // GetAttributes returns the Attributes field value if set, zero value otherwise. func (o *Coupon) GetAttributes() map[string]interface{} { if o == nil || o.Attributes == nil { diff --git a/model_coupon_constraints.go b/model_coupon_constraints.go index e8bbbb52..cdff800f 100644 --- a/model_coupon_constraints.go +++ b/model_coupon_constraints.go @@ -19,6 +19,8 @@ import ( type CouponConstraints struct { // The number of times a coupon code can be redeemed. This can be set to 0 for no limit, but any campaign usage limits will still apply. UsageLimit *int32 `json:"usageLimit,omitempty"` + // The amount of discounts that can be given with this coupon code. + DiscountLimit *float32 `json:"discountLimit,omitempty"` // Timestamp at which point the coupon becomes valid. StartDate *time.Time `json:"startDate,omitempty"` // Expiry date of the coupon. Coupon never expires if this is omitted, zero, or negative. @@ -58,6 +60,39 @@ func (o *CouponConstraints) SetUsageLimit(v int32) { o.UsageLimit = &v } +// GetDiscountLimit returns the DiscountLimit field value if set, zero value otherwise. +func (o *CouponConstraints) GetDiscountLimit() float32 { + if o == nil || o.DiscountLimit == nil { + var ret float32 + return ret + } + return *o.DiscountLimit +} + +// GetDiscountLimitOk returns a tuple with the DiscountLimit field value if set, zero value otherwise +// and a boolean to check if the value has been set. +func (o *CouponConstraints) GetDiscountLimitOk() (float32, bool) { + if o == nil || o.DiscountLimit == nil { + var ret float32 + return ret, false + } + return *o.DiscountLimit, true +} + +// HasDiscountLimit returns a boolean if a field has been set. +func (o *CouponConstraints) HasDiscountLimit() bool { + if o != nil && o.DiscountLimit != nil { + return true + } + + return false +} + +// SetDiscountLimit gets a reference to the given float32 and assigns it to the DiscountLimit field. +func (o *CouponConstraints) SetDiscountLimit(v float32) { + o.DiscountLimit = &v +} + // GetStartDate returns the StartDate field value if set, zero value otherwise. func (o *CouponConstraints) GetStartDate() time.Time { if o == nil || o.StartDate == nil { diff --git a/model_customer_inventory.go b/model_customer_inventory.go index b3eb2b85..fa2f3bd2 100644 --- a/model_customer_inventory.go +++ b/model_customer_inventory.go @@ -18,6 +18,7 @@ import ( type CustomerInventory struct { Profile *CustomerProfile `json:"profile,omitempty"` Referrals *[]Referral `json:"referrals,omitempty"` + Coupons *[]Coupon `json:"coupons,omitempty"` } // GetProfile returns the Profile field value if set, zero value otherwise. @@ -86,6 +87,39 @@ func (o *CustomerInventory) SetReferrals(v []Referral) { o.Referrals = &v } +// GetCoupons returns the Coupons field value if set, zero value otherwise. +func (o *CustomerInventory) GetCoupons() []Coupon { + if o == nil || o.Coupons == nil { + var ret []Coupon + return ret + } + return *o.Coupons +} + +// GetCouponsOk returns a tuple with the Coupons field value if set, zero value otherwise +// and a boolean to check if the value has been set. +func (o *CustomerInventory) GetCouponsOk() ([]Coupon, bool) { + if o == nil || o.Coupons == nil { + var ret []Coupon + return ret, false + } + return *o.Coupons, true +} + +// HasCoupons returns a boolean if a field has been set. +func (o *CustomerInventory) HasCoupons() bool { + if o != nil && o.Coupons != nil { + return true + } + + return false +} + +// SetCoupons gets a reference to the given []Coupon and assigns it to the Coupons field. +func (o *CustomerInventory) SetCoupons(v []Coupon) { + o.Coupons = &v +} + type NullableCustomerInventory struct { Value CustomerInventory ExplicitNull bool diff --git a/model_customer_profile_update.go b/model_customer_profile_update.go new file mode 100644 index 00000000..b2d7b63d --- /dev/null +++ b/model_customer_profile_update.go @@ -0,0 +1,58 @@ +/* + * Talon.One API + * + * The Talon.One API is used to manage applications and campaigns, as well as to integrate with your application. The operations in the _Integration API_ section are used to integrate with our platform, while the other operations are used to manage applications and campaigns. ### Where is the API? The API is available at the same hostname as these docs. For example, if you are reading this page at `https://mycompany.talon.one/docs/api/`, the URL for the [updateCustomerProfile][] operation is `https://mycompany.talon.one/v1/customer_profiles/id` [updateCustomerProfile]: #operation--v1-customer_profiles--integrationId--put + * + * API version: 1.0.0 + * Generated by: OpenAPI Generator (https://openapi-generator.tech) + */ + +package talon + +import ( + "bytes" + "encoding/json" +) + +// CustomerProfileUpdate struct for CustomerProfileUpdate +type CustomerProfileUpdate struct { + CustomerProfile CustomerProfile `json:"customerProfile"` +} + +// GetCustomerProfile returns the CustomerProfile field value +func (o *CustomerProfileUpdate) GetCustomerProfile() CustomerProfile { + if o == nil { + var ret CustomerProfile + return ret + } + + return o.CustomerProfile +} + +// SetCustomerProfile sets field value +func (o *CustomerProfileUpdate) SetCustomerProfile(v CustomerProfile) { + o.CustomerProfile = v +} + +type NullableCustomerProfileUpdate struct { + Value CustomerProfileUpdate + ExplicitNull bool +} + +func (v NullableCustomerProfileUpdate) MarshalJSON() ([]byte, error) { + switch { + case v.ExplicitNull: + return []byte("null"), nil + default: + return json.Marshal(v.Value) + } +} + +func (v *NullableCustomerProfileUpdate) UnmarshalJSON(src []byte) error { + if bytes.Equal(src, []byte("null")) { + v.ExplicitNull = true + return nil + } + + return json.Unmarshal(src, &v.Value) +} diff --git a/model_inline_response_200_1.go b/model_inline_response_200_1.go index c20f1499..451779d4 100644 --- a/model_inline_response_200_1.go +++ b/model_inline_response_200_1.go @@ -16,8 +16,8 @@ import ( // InlineResponse2001 struct for InlineResponse2001 type InlineResponse2001 struct { - TotalResultSize int32 `json:"totalResultSize"` - Data []Coupon `json:"data"` + TotalResultSize int32 `json:"totalResultSize"` + Data []Application `json:"data"` } // GetTotalResultSize returns the TotalResultSize field value @@ -36,9 +36,9 @@ func (o *InlineResponse2001) SetTotalResultSize(v int32) { } // GetData returns the Data field value -func (o *InlineResponse2001) GetData() []Coupon { +func (o *InlineResponse2001) GetData() []Application { if o == nil { - var ret []Coupon + var ret []Application return ret } @@ -46,7 +46,7 @@ func (o *InlineResponse2001) GetData() []Coupon { } // SetData sets field value -func (o *InlineResponse2001) SetData(v []Coupon) { +func (o *InlineResponse2001) SetData(v []Application) { o.Data = v } diff --git a/model_inline_response_200_2.go b/model_inline_response_200_2.go index 39c7c982..3564410c 100644 --- a/model_inline_response_200_2.go +++ b/model_inline_response_200_2.go @@ -16,8 +16,8 @@ import ( // InlineResponse2002 struct for InlineResponse2002 type InlineResponse2002 struct { - TotalResultSize int32 `json:"totalResultSize"` - Data []Application `json:"data"` + TotalResultSize int32 `json:"totalResultSize"` + Data []Campaign `json:"data"` } // GetTotalResultSize returns the TotalResultSize field value @@ -36,9 +36,9 @@ func (o *InlineResponse2002) SetTotalResultSize(v int32) { } // GetData returns the Data field value -func (o *InlineResponse2002) GetData() []Application { +func (o *InlineResponse2002) GetData() []Campaign { if o == nil { - var ret []Application + var ret []Campaign return ret } @@ -46,7 +46,7 @@ func (o *InlineResponse2002) GetData() []Application { } // SetData sets field value -func (o *InlineResponse2002) SetData(v []Application) { +func (o *InlineResponse2002) SetData(v []Campaign) { o.Data = v } diff --git a/model_inline_response_200_3.go b/model_inline_response_200_3.go index 1c45a384..04adcc7d 100644 --- a/model_inline_response_200_3.go +++ b/model_inline_response_200_3.go @@ -16,8 +16,8 @@ import ( // InlineResponse2003 struct for InlineResponse2003 type InlineResponse2003 struct { - TotalResultSize int32 `json:"totalResultSize"` - Data []Campaign `json:"data"` + TotalResultSize int32 `json:"totalResultSize"` + Data []Ruleset `json:"data"` } // GetTotalResultSize returns the TotalResultSize field value @@ -36,9 +36,9 @@ func (o *InlineResponse2003) SetTotalResultSize(v int32) { } // GetData returns the Data field value -func (o *InlineResponse2003) GetData() []Campaign { +func (o *InlineResponse2003) GetData() []Ruleset { if o == nil { - var ret []Campaign + var ret []Ruleset return ret } @@ -46,7 +46,7 @@ func (o *InlineResponse2003) GetData() []Campaign { } // SetData sets field value -func (o *InlineResponse2003) SetData(v []Campaign) { +func (o *InlineResponse2003) SetData(v []Ruleset) { o.Data = v } diff --git a/model_inline_response_200_4.go b/model_inline_response_200_4.go index 60cedc51..c8bba2b1 100644 --- a/model_inline_response_200_4.go +++ b/model_inline_response_200_4.go @@ -16,8 +16,8 @@ import ( // InlineResponse2004 struct for InlineResponse2004 type InlineResponse2004 struct { - TotalResultSize int32 `json:"totalResultSize"` - Data []Ruleset `json:"data"` + TotalResultSize int32 `json:"totalResultSize"` + Data []Coupon `json:"data"` } // GetTotalResultSize returns the TotalResultSize field value @@ -36,9 +36,9 @@ func (o *InlineResponse2004) SetTotalResultSize(v int32) { } // GetData returns the Data field value -func (o *InlineResponse2004) GetData() []Ruleset { +func (o *InlineResponse2004) GetData() []Coupon { if o == nil { - var ret []Ruleset + var ret []Coupon return ret } @@ -46,7 +46,7 @@ func (o *InlineResponse2004) GetData() []Ruleset { } // SetData sets field value -func (o *InlineResponse2004) SetData(v []Ruleset) { +func (o *InlineResponse2004) SetData(v []Coupon) { o.Data = v } diff --git a/model_loyalty_ledger_entry.go b/model_loyalty_ledger_entry.go index 1a98f924..53e158b5 100644 --- a/model_loyalty_ledger_entry.go +++ b/model_loyalty_ledger_entry.go @@ -29,6 +29,8 @@ type LoyaltyLedgerEntry struct { Name string `json:"name"` // This specifies if we are adding loyalty points to the main ledger or a subledger SubLedgerID string `json:"subLedgerID"` + // This is the ID of the user who created this entry, if the addition or subtraction was done manually. + UserID *int32 `json:"userID,omitempty"` } // GetCreated returns the Created field value @@ -235,6 +237,39 @@ func (o *LoyaltyLedgerEntry) SetSubLedgerID(v string) { o.SubLedgerID = v } +// GetUserID returns the UserID field value if set, zero value otherwise. +func (o *LoyaltyLedgerEntry) GetUserID() int32 { + if o == nil || o.UserID == nil { + var ret int32 + return ret + } + return *o.UserID +} + +// GetUserIDOk returns a tuple with the UserID field value if set, zero value otherwise +// and a boolean to check if the value has been set. +func (o *LoyaltyLedgerEntry) GetUserIDOk() (int32, bool) { + if o == nil || o.UserID == nil { + var ret int32 + return ret, false + } + return *o.UserID, true +} + +// HasUserID returns a boolean if a field has been set. +func (o *LoyaltyLedgerEntry) HasUserID() bool { + if o != nil && o.UserID != nil { + return true + } + + return false +} + +// SetUserID gets a reference to the given int32 and assigns it to the UserID field. +func (o *LoyaltyLedgerEntry) SetUserID(v int32) { + o.UserID = &v +} + type NullableLoyaltyLedgerEntry struct { Value LoyaltyLedgerEntry ExplicitNull bool diff --git a/model_new_application.go b/model_new_application.go index d7570da5..424159c0 100644 --- a/model_new_application.go +++ b/model_new_application.go @@ -29,7 +29,9 @@ type NewApplication struct { // Arbitrary properties associated with this campaign Attributes *map[string]interface{} `json:"attributes,omitempty"` // Default limits for campaigns created in this application - Limits *[]LimitConfig `json:"limits,omitempty"` + Limits *[]LimitConfig `json:"limits,omitempty"` + // Default priority for campaigns created in this application, can be one of (universal, stackable, exclusive) + CampaignPriority *string `json:"campaignPriority,omitempty"` AttributesSettings *AttributesSettings `json:"attributesSettings,omitempty"` // Hex key for HMAC-signing API calls as coming from this application (16 hex digits) Key *string `json:"key,omitempty"` @@ -212,6 +214,39 @@ func (o *NewApplication) SetLimits(v []LimitConfig) { o.Limits = &v } +// GetCampaignPriority returns the CampaignPriority field value if set, zero value otherwise. +func (o *NewApplication) GetCampaignPriority() string { + if o == nil || o.CampaignPriority == nil { + var ret string + return ret + } + return *o.CampaignPriority +} + +// GetCampaignPriorityOk returns a tuple with the CampaignPriority field value if set, zero value otherwise +// and a boolean to check if the value has been set. +func (o *NewApplication) GetCampaignPriorityOk() (string, bool) { + if o == nil || o.CampaignPriority == nil { + var ret string + return ret, false + } + return *o.CampaignPriority, true +} + +// HasCampaignPriority returns a boolean if a field has been set. +func (o *NewApplication) HasCampaignPriority() bool { + if o != nil && o.CampaignPriority != nil { + return true + } + + return false +} + +// SetCampaignPriority gets a reference to the given string and assigns it to the CampaignPriority field. +func (o *NewApplication) SetCampaignPriority(v string) { + o.CampaignPriority = &v +} + // GetAttributesSettings returns the AttributesSettings field value if set, zero value otherwise. func (o *NewApplication) GetAttributesSettings() AttributesSettings { if o == nil || o.AttributesSettings == nil { diff --git a/model_new_campaign_set.go b/model_new_campaign_set.go index 2c21c186..5b8f5bfe 100644 --- a/model_new_campaign_set.go +++ b/model_new_campaign_set.go @@ -17,8 +17,10 @@ import ( // NewCampaignSet type NewCampaignSet struct { // The ID of the application that owns this entity. - ApplicationId int32 `json:"applicationId"` - Set CampaignSetBranchNode `json:"set"` + ApplicationId int32 `json:"applicationId"` + // Version of the campaign set + Version int32 `json:"version"` + Set CampaignSetBranchNode `json:"set"` } // GetApplicationId returns the ApplicationId field value @@ -36,6 +38,21 @@ func (o *NewCampaignSet) SetApplicationId(v int32) { o.ApplicationId = v } +// GetVersion returns the Version field value +func (o *NewCampaignSet) GetVersion() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Version +} + +// SetVersion sets field value +func (o *NewCampaignSet) SetVersion(v int32) { + o.Version = v +} + // GetSet returns the Set field value func (o *NewCampaignSet) GetSet() CampaignSetBranchNode { if o == nil { diff --git a/model_new_coupons.go b/model_new_coupons.go index 02fd7cb5..f7fa76a3 100644 --- a/model_new_coupons.go +++ b/model_new_coupons.go @@ -19,6 +19,8 @@ import ( type NewCoupons struct { // The number of times a coupon code can be redeemed. This can be set to 0 for no limit, but any campaign usage limits will still apply. UsageLimit int32 `json:"usageLimit"` + // The amount of discounts that can be given with this coupon code. + DiscountLimit *float32 `json:"discountLimit,omitempty"` // Timestamp at which point the coupon becomes valid. StartDate *time.Time `json:"startDate,omitempty"` // Expiry date of the coupon. Coupon never expires if this is omitted, zero, or negative. @@ -52,6 +54,39 @@ func (o *NewCoupons) SetUsageLimit(v int32) { o.UsageLimit = v } +// GetDiscountLimit returns the DiscountLimit field value if set, zero value otherwise. +func (o *NewCoupons) GetDiscountLimit() float32 { + if o == nil || o.DiscountLimit == nil { + var ret float32 + return ret + } + return *o.DiscountLimit +} + +// GetDiscountLimitOk returns a tuple with the DiscountLimit field value if set, zero value otherwise +// and a boolean to check if the value has been set. +func (o *NewCoupons) GetDiscountLimitOk() (float32, bool) { + if o == nil || o.DiscountLimit == nil { + var ret float32 + return ret, false + } + return *o.DiscountLimit, true +} + +// HasDiscountLimit returns a boolean if a field has been set. +func (o *NewCoupons) HasDiscountLimit() bool { + if o != nil && o.DiscountLimit != nil { + return true + } + + return false +} + +// SetDiscountLimit gets a reference to the given float32 and assigns it to the DiscountLimit field. +func (o *NewCoupons) SetDiscountLimit(v float32) { + o.DiscountLimit = &v +} + // GetStartDate returns the StartDate field value if set, zero value otherwise. func (o *NewCoupons) GetStartDate() time.Time { if o == nil || o.StartDate == nil { diff --git a/model_update_application.go b/model_update_application.go index 5f11f348..1260ada1 100644 --- a/model_update_application.go +++ b/model_update_application.go @@ -29,7 +29,9 @@ type UpdateApplication struct { // Arbitrary properties associated with this campaign Attributes *map[string]interface{} `json:"attributes,omitempty"` // Default limits for campaigns created in this application - Limits *[]LimitConfig `json:"limits,omitempty"` + Limits *[]LimitConfig `json:"limits,omitempty"` + // Default priority for campaigns created in this application, can be one of (universal, stackable, exclusive) + CampaignPriority *string `json:"campaignPriority,omitempty"` AttributesSettings *AttributesSettings `json:"attributesSettings,omitempty"` } @@ -210,6 +212,39 @@ func (o *UpdateApplication) SetLimits(v []LimitConfig) { o.Limits = &v } +// GetCampaignPriority returns the CampaignPriority field value if set, zero value otherwise. +func (o *UpdateApplication) GetCampaignPriority() string { + if o == nil || o.CampaignPriority == nil { + var ret string + return ret + } + return *o.CampaignPriority +} + +// GetCampaignPriorityOk returns a tuple with the CampaignPriority field value if set, zero value otherwise +// and a boolean to check if the value has been set. +func (o *UpdateApplication) GetCampaignPriorityOk() (string, bool) { + if o == nil || o.CampaignPriority == nil { + var ret string + return ret, false + } + return *o.CampaignPriority, true +} + +// HasCampaignPriority returns a boolean if a field has been set. +func (o *UpdateApplication) HasCampaignPriority() bool { + if o != nil && o.CampaignPriority != nil { + return true + } + + return false +} + +// SetCampaignPriority gets a reference to the given string and assigns it to the CampaignPriority field. +func (o *UpdateApplication) SetCampaignPriority(v string) { + o.CampaignPriority = &v +} + // GetAttributesSettings returns the AttributesSettings field value if set, zero value otherwise. func (o *UpdateApplication) GetAttributesSettings() AttributesSettings { if o == nil || o.AttributesSettings == nil { diff --git a/model_update_coupon.go b/model_update_coupon.go index f3754cb5..d2a98019 100644 --- a/model_update_coupon.go +++ b/model_update_coupon.go @@ -19,6 +19,8 @@ import ( type UpdateCoupon struct { // The number of times a coupon code can be redeemed. This can be set to 0 for no limit, but any campaign usage limits will still apply. UsageLimit *int32 `json:"usageLimit,omitempty"` + // The amount of discounts that can be given with this coupon code. + DiscountLimit *float32 `json:"discountLimit,omitempty"` // Timestamp at which point the coupon becomes valid. StartDate *time.Time `json:"startDate,omitempty"` // Expiry date of the coupon. Coupon never expires if this is omitted, zero, or negative. @@ -62,6 +64,39 @@ func (o *UpdateCoupon) SetUsageLimit(v int32) { o.UsageLimit = &v } +// GetDiscountLimit returns the DiscountLimit field value if set, zero value otherwise. +func (o *UpdateCoupon) GetDiscountLimit() float32 { + if o == nil || o.DiscountLimit == nil { + var ret float32 + return ret + } + return *o.DiscountLimit +} + +// GetDiscountLimitOk returns a tuple with the DiscountLimit field value if set, zero value otherwise +// and a boolean to check if the value has been set. +func (o *UpdateCoupon) GetDiscountLimitOk() (float32, bool) { + if o == nil || o.DiscountLimit == nil { + var ret float32 + return ret, false + } + return *o.DiscountLimit, true +} + +// HasDiscountLimit returns a boolean if a field has been set. +func (o *UpdateCoupon) HasDiscountLimit() bool { + if o != nil && o.DiscountLimit != nil { + return true + } + + return false +} + +// SetDiscountLimit gets a reference to the given float32 and assigns it to the DiscountLimit field. +func (o *UpdateCoupon) SetDiscountLimit(v float32) { + o.DiscountLimit = &v +} + // GetStartDate returns the StartDate field value if set, zero value otherwise. func (o *UpdateCoupon) GetStartDate() time.Time { if o == nil || o.StartDate == nil { diff --git a/model_update_coupon_batch.go b/model_update_coupon_batch.go index 36366acb..ce296a55 100644 --- a/model_update_coupon_batch.go +++ b/model_update_coupon_batch.go @@ -19,6 +19,8 @@ import ( type UpdateCouponBatch struct { // The number of times a coupon code can be redeemed. This can be set to 0 for no limit, but any campaign usage limits will still apply. UsageLimit *int32 `json:"usageLimit,omitempty"` + // The amount of discounts that can be given with this coupon code. + DiscountLimit *float32 `json:"discountLimit,omitempty"` // Timestamp at which point the coupon becomes valid. StartDate *time.Time `json:"startDate,omitempty"` // Expiry date of the coupon. Coupon never expires if this is omitted, zero, or negative. @@ -62,6 +64,39 @@ func (o *UpdateCouponBatch) SetUsageLimit(v int32) { o.UsageLimit = &v } +// GetDiscountLimit returns the DiscountLimit field value if set, zero value otherwise. +func (o *UpdateCouponBatch) GetDiscountLimit() float32 { + if o == nil || o.DiscountLimit == nil { + var ret float32 + return ret + } + return *o.DiscountLimit +} + +// GetDiscountLimitOk returns a tuple with the DiscountLimit field value if set, zero value otherwise +// and a boolean to check if the value has been set. +func (o *UpdateCouponBatch) GetDiscountLimitOk() (float32, bool) { + if o == nil || o.DiscountLimit == nil { + var ret float32 + return ret, false + } + return *o.DiscountLimit, true +} + +// HasDiscountLimit returns a boolean if a field has been set. +func (o *UpdateCouponBatch) HasDiscountLimit() bool { + if o != nil && o.DiscountLimit != nil { + return true + } + + return false +} + +// SetDiscountLimit gets a reference to the given float32 and assigns it to the DiscountLimit field. +func (o *UpdateCouponBatch) SetDiscountLimit(v float32) { + o.DiscountLimit = &v +} + // GetStartDate returns the StartDate field value if set, zero value otherwise. func (o *UpdateCouponBatch) GetStartDate() time.Time { if o == nil || o.StartDate == nil {